Upload a File
Uploading a new file can be accomplished through the following request. You will pass in the file to upload, and Domo will store it and generate a unique identifier for the file, which is returned to you.Playground
POSTEndpoint:
/api/data/v1/data-files?name={name}&description={description}&public={public}
Security Consideration for Default Permissions
By default, thepublic param is set to true, granting all users in the Domo instance access to the file. Remember to set public to false if you want to restrict access to the user who originally uploaded the file. File permissions can be updated to give access to specific users and groups, if needed. You can find out how to do that by reviewing the Update file permissions API.Code Example
Query Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| name | String | Required | The name to be given to the file in Domo |
| description | String | Optional | A description of the file |
| public | Boolean | Optional | Whether the permissions of the file are set to public |
Request Body
The file to upload.Response
Returns the id of the created file.Upload a File Revision
The Files API provides versioning support for files that have been uploaded. You may add another version of a file by sending aPUT request to the files endpoint referencing the fileId of the file you wish to revise.
Playground
PUTEndpoint:
/api/data/v1/data-files/{dataFileId}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file for which you wish to upload a revision |
Request Body
The file to upload as a revision.Response
Returns the current revision id of the file.Get All Files Metadata
Each file that you upload has corresponding metadata. This endpoint allows you to list all the metadata for each file you have access to. If you want to limit the files returned, you can include query parameters that filter the response.Playground
GETEndpoint:
/api/data/v1/data-files/details?userId={userId}&expand={expand}&dataFileIds={dataFileIds}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| userId | Integer | Optional | A Domo User Id if you want to limit the files returned by a specific owner |
| expand | String | Optional | An array of string properties specifying the additional details you want to retrieve (either revisions, metadata, or both) |
Query Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileIds | String | Optional | An array of File Ids that you wish to be returned if you only want a subset of files |
Response
Returns an array of file objects.Get File Metadata by ID
Given a known file ID, this endpoint allows you to list the metadata for that specific file.Playground
GETEndpoint:
/api/data/v1/data-files/{dataFileId}/details?expand={expand}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file |
Query Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| expand | String Array | Optional | An array of string properties specifying the additional details you want to retrieve (either revisions, metadata, or both) |
Response
Returns the file details object.Get Revision Metadata by ID
Given a known file revision ID, this endpoint allows you to list the metadata for that specific revision.Playground
GETEndpoint:
/api/data/v1/data-files/{dataFileId}/revisions/{revisionId}/details?expand={expand}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file |
| revisionId | Integer | Required | The id of the file revision |
Query Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| expand | String Array | Optional | An array of string properties specifying the additional details you want to retrieve (either revisions, metadata, or both) |
Response
Returns the file revision details object.Get All File Revisions by ID
Given a known file ID, this endpoint fetches the existing revisions of the file.Playground
GETEndpoint:
/api/data/v1/data-files/${dataFileId}/revisions/details
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file |
Query Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| expand | String Array | Optional | An array of string properties specifying the additional details you want to retrieve (either revisions, metadata, or both) |
Response
Returns a list of all revisions of the file.Download a File
This endpoint fetches the file contents of a previously uploaded file, which can then be downloaded to the user’s machine. You can optionally include a revisionId as a path parameter to fetch a specific revision of the file.Playground
GETEndpoint:
/api/data/v1/data-files/{fileId}/revision/{revisionId}?filename={fileName}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| fileId | Integer | Required | The id of the file you wish to download |
| revisionId | Integer | optional | The id of the version you wish to download (remove /revision if not used) |
Query Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| fileName | String | Optional | The name you want to give the file |
Response
Returns the File to be downloaded.Copy/Move a File
This endpoint allows you to copy the current revision of a file to another target file. This essentially replaces the target file and leaves the source file intact.Playground
POSTEndpoint:
/api/data/v1/data-files/copy/{sourceDataFileId}/revisions/current/{targetDataFileId}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| sourceDataFileId | Integer | Required | The file id to move (source) |
| targetDataFileId | Integer | Required | The file id to be replaced (target) |
Response
Returns the current revision id for the target file.Duplicate a File
This endpoint will create a new file object in Domo from an existing one.Playground
POSTEndpoint:
/api/data/v1/data-files/{dataFileId}/duplicate
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The file id to duplicate |
Response
Returns the file metadata for the newly created duplicate.Delete a File
Permanently deletes a File from your instance by ID.Playground
DELETEEndpoint:
/api/data/v1/data-files/{dataFileId}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file you wish to delete |
Response
Returns the parameter of success or error based on the file id being valid.Delete a File Revision
Deletes a specific revision of a file by ID.Playground
DELETEEndpoint:
/api/data/v1/data-files/{dataFileId}/revisions/{revisionId}
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file |
| revisionId | Integer | Required | The id of the revision you wish to delete |
Response
Returns the parameter of success or error based on the file Id being valid.Get File Permissions
Retrieve existing file permissions for a specific file by IDPlayground
GETEndpoint:
/domo/data-files/v1/{fileId}/permissions
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file you wish to get permission details for |
Response
Update file permissions
Updates permissions for a specified file. Useful if needing to provide or expand access to a restricted/non-public filePlayground
PUTEndpoint:
/api/data/v1/data-files/{dataFileId}/permissions
Code Example
Path Parameters
| Property Name | Type | Required | Description |
|---|---|---|---|
| dataFileId | Integer | Required | The id of the file you wish to update permission details for |