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.
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
Name | Type | Required | Description |
---|---|---|---|
id | URL parameter | ✓ | The 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"
}
Field | Type | Description |
---|---|---|
modelId | string | ID of the model |
status | string | Status 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
}
Issue | Error detail |
---|---|
Invalid model ID | Bad 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
Reach out to Omni support to enable the cache policy reset API.
Resets the cache for the specified cache policy.
- Basic request
- With reset date
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>'
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>' \
--d '{
"resetAt": "2025-01-30T22:30:52.872Z"
}'
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
modelId | URL parameter | Yes ✓ | - | The ID of the model. |
cachePolicyName | URL parameter | Yes ✓ | - | The name of the cache policy to reset. |
resetAt | string (date) | No X | Now | An 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
}
Issue | Error detail |
---|---|
Invalid model ID | Bad 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.