Skip to main content

Models APIs

The model APIs allow you to interact with models in Omni.

Refresh a schema

Refreshes the schema of the specified model. This will cause the model to reflect the latest changes to schemas, views, and fields from the data source. Note: This will remove structures that are no longer present in the source, but not anything created by users.

POST /v0/model/:id/refresh
curl -L -X 'https://myorg.omniapp.co/api/v0/model/bc1f9c9f-208d-48a2-9ae3-ff80f2c79fed/refresh' \
--H 'Content-Type: application/json' \
--H 'Authorization: Bearer <TOKEN>'

Parameters

NameTypeRequiredDescription
idURL parameterThe ID of the model to be refreshed.

Response

200 OK

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

{
"modelId": "bc1f9c9f-208d-48a2-9ae3-ff80f2c79fed",
"status": "running"
}
FieldTypeDescription
modelIdstringID of the model
statusstringStatus of the schema refresh. This value will be running to indicate that the refresh has started.
400 Bad Request
{
"detail": "<errorReason>",
"schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
"status": 400
}
IssueError detail
Invalid model IDBad Request: modelId: Invalid uuid
429 Too Many Requests

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

Reset a cache policy

note

Reach out to Omni support to enable the cache policy reset API.

Resets the cache for the specified cache policy.

POST /api/unstable/model/:modelId/cache_reset/:cachePolicyName
curl -L 'https://myorg.omniapp.co/api/unstable/model/bc1f9c9f-208d-48a2-9ae3-ff80f2c79fed/cache_reset/daily_cache_policy' \
--H 'Content-Type: application/json' \
--H 'Authorization: Bearer <TOKEN>'

Parameters

ParameterTypeRequiredDefaultDescription
modelIdURL parameterYes -The ID of the model.
cachePolicyNameURL parameterYes -The name of the cache policy to reset.
resetAtstring (date)No XNowAn ISO-8601 date string that sets the time the cache should be reset (invalidated). When set, cache entries created between this value and the current time will still be considered valid. Defaults to now. Cannot be a future date.

Response

200 OK

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

{
"success": true,
"cache_reset": {
"id": "98e14685-597b-4887-a50f-34e93985e00d",
"model_id": "bc1f9c9f-208d-48a2-9ae3-ff80f2c79fed",
"policy_name": "daily_cache_policy",
"created_at": 1742851818.561,
"updated_at": 1742932587.717,
"reset_at": 1738276252.872
}
}
400 Bad Request
{
"detail": "<errorReason>",
"schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
"status": 400
}
IssueError detail
Invalid model IDBad Request: modelId: Invalid uuid
429 Too Many Requests

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