Document APIs
The document APIs allow you to interact with documents in Omni.
Document object
Represents a document in Omni.
- Example
- Fields
{
"connectionId": "c0f12353-4817-4398-bcc0-d501e6dd2f64",
"deleted": false,
"folder": {
"id": "ce3b1dcd-c768-4f01-a479-353325c4c5b0",
"name": "In Progress Reports",
"path": "in-progress-reports",
"scope": "organization"
},
"identifier": "12db1a0a",
"labels": [
{
"name": "Marketing",
"verified": false
}
],
"name": "Blob Web Traffic",
"owner": {
"id": "9e8719d9-276a-4964-9395-a493189a247c",
"name": "Blobby"
},
"scope": "public",
"type": "document",
"updatedAt": "2025-01-07T10:00:00Z"
}
Field | Type | Description |
---|---|---|
connectionId | string | ID of the database connection the document is built on |
deleted | boolean | Whether the document has a non-normal status |
folder | object | Folder details. Will be null if the document isn't in a folder. |
folder.id | string | Unique identifier of the folder |
folder.name | string | Name of the folder (1-255 characters) |
folder.path | string | Path of the folder |
folder.scope | string | Scope of the folder:
|
identifier | string | Unique identifier of the document. Corresponds to the Identifier field in the document's settings. |
labels | array of objects | Labels associated with the document |
labels.name | string | Name of the label |
labels.verified | boolean | Whether the label is verified |
name | string | Name of the document |
owner | object | Details about the document owner |
owner.id | string | UUID of the user that owns the document |
owner.name | string | Name of the owner |
scope | string | Document scope, indicating the level of access the document has:
|
type | string | Type of content, always set to document |
updatedAt | string | ISO-8601 formatted date-time of last update |
List documents
Retrieves a paginated list of document items. This endpoint supports filtering, sorting, and cursor-based pagination.
- Basic request
- Filters & sorting
- Pagination with cursor
curl 'https://myorg.omniapp.co/api/unstable/documents' \
--H 'Authorization: Bearer <TOKEN>' \
--H 'Content-Type: application/json'
curl 'https://myorg.omniapp.co/api/unstable/documents?labels=finance,marketing&pageSize=10&sortField=updatedAt&sortDirection=desc' \
--H 'Authorization: Bearer <TOKEN>' \
--H 'Content-Type: application/json'
curl 'https://myorg.omniapp.co/api/unstable/documents?cursor=Product Totals&pageSize=20' \
--H 'Authorization: Bearer <TOKEN>' \
--H 'Content-Type: application/json'
Parameters
Note: All parameters must be provided as query parameters.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
cursor | string | No X | null | Cursor for pagination. Used with |
pageSize | number | No X | 20 | The number of items to retrieve per page:
|
sortField | string | No X | desc | Field to sort by. Must be one of the following:
|
sortDirection | string | No X | desc | Direction to sort results. Must be |
labels | string | No X | null | Comma-separated list of labels to filter results. For example: |
creatorId | string | No X | null | UUID of the user who created the document(s). Retrieve user IDs with the List users and Retrieve a user endpoints. |
Response
200 OK
Successful requests will return a 200 OK
status and a response body similar to the following:
{
"pageInfo": {
"hasNextPage": true,
"nextCursor": "Product Totals",
"pageSize": 20,
"totalRecords": 58
},
"records": [
{}
}
Field | Type | Description |
---|---|---|
records | array of objects | An array of document objects that meet the provided filters, if provided. |
pageInfo |
| An object containing information about the current page of results. |
pageInfo.hasNextPage | boolean | If |
pageInfo.nextCursor | string | The |
pageInfo.pageSize | string | The total number of items on the current page. |
pageInfo.totalItems | number | The total number of items in the results set, across all pages. |
400 Bad Request
Results from invalid request parameters. Response bodies will be an object similar to the following:
{
"detail": "<errorReason>",
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:Error"
],
"status": 400
}
Issue | Error detail |
---|---|
|
|
|
|
Invalid |
|
Invalid |
|
Unknown query parameter |
|
404 Not Found
Results from the provided creatorId
not being found. Note: An invalid uuid will result in a 400
. In this situation, the provided creatorId
is a valid uuid, but it cannot be found.
Response bodies will be an object similar to the following:
{
"detail": "User with id <uuid> does not exist",
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:Error"
],
"status": 404
}