Skip to main content

Content APIs

The content APIs allow you to interact with both documents and folders in Omni through a unified interface.

Content object

Represents either a document or folder in Omni. The specific fields available depend on the type field.

{
"type": "document",
"identifier": "doc123",
"name": "Monthly Metrics",
"scope": "organization",
"owner": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Jane Smith"
},
"connectionId": "789e0123-e45b-67d8-a456-426614174000",
"deleted": false,
"folder": null
}

List content

Retrieves a paginated list of documents and folders. This endpoint supports filtering, sorting, and cursor-based pagination.

GET /api/v1/content
curl -X GET 'https://myorg.omniapp.co/api/v1/content' \
--H 'Authorization: Bearer <TOKEN>' \
--H 'Content-Type: application/json'

Parameters

Note: All parameters must be provided as query parameters.

ParameterTypeRequiredDefaultDescription
includestringNo Xnull

Comma-separated list of additional fields to include in the response:

  • _count - Adds count metrics:
    • Folders: number of documents and favorites
    • Documents: number of favorites and views
  • labels - Includes associated content labels
creatorIdstringNo* XnullUUID of organization membership (*Required for restricted scope)
folderIdstringNo XnullUUID of folder to filter content by
labelsstringNo XnullComma-separated list of labels (e.g., finance,marketing)
pathstringNo XnullPath pattern to filter by (e.g., /folder/subfolder or /folder/*)
scopestringNo XorganizationContent scope (organization or restricted)
pageSizenumberNo X20

Items per page:

  • Minimum - 1
  • Maximum - 100
sortFieldstringNo Xname

Field to sort by:

  • name - Sort by content name
  • favorites - Sort by favorite count
sortDirectionstringNo XdescSort direction (asc or desc)
cursorstringNo XnullCursor for pagination

Response

200 OK

Successful requests return a 200 OK status and a response body similar to:

{
"records": [
{
"type": "folder",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Analytics",
"path": "analytics",
"scope": "organization",
"owner": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Jane Smith"
},
"labels": [
{
"name": "reports",
"verified": true
}
]
},
{
"type": "document",
"identifier": "doc123",
"name": "Monthly Metrics",
"scope": "organization",
"owner": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Jane Smith"
},
"connectionId": "789e0123-e45b-67d8-a456-426614174000",
"deleted": false,
"folder": null
}
],
"pageInfo": {
"hasNextPage": true,
"nextCursor": "Product Analytics",
"pageSize": 20,
"totalRecords": 45
}
}
400 Bad Request

Results from invalid request parameters. Response bodies will be similar to:

{
"detail": "Bad Request: <errorReason>",
"status": 400
}

Common error cases:

  • Page size must be at least 1
  • Page size cannot exceed 100
  • Invalid sort field
  • creatorId required when scope is restricted
  • Unrecognized query parameters
404 Not Found

Returned when the specified creator cannot be found:

{
"detail": "User with id <uuid> does not exist",
"status": 404
}
429 Too Many Requests

Results from too many requests in a given time frame. Refer to the Rate limiting documentation for more information.