Monitors
Reference for the Monitors operations of the Spice Cloud Management API: list project monitors, create a project monitor, get a project monitor, update a project monitor, and delete a project monitor.
OpenAPIapi.spice.ai/openapi.json
List project monitors
GET/v1/projects/{projectId}/monitors
Returns the project's monitors. Requires monitors:read. Monitors on a project that is not managed, or on a template that is not available to the organization, are omitted. An existing container_cpu monitor without an effective CPU limit remains visible with evaluation_unavailable_reason set to cpu_limit_missing.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | The ID of the project |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Example request
curl "https://api.spice.ai/v1/projects/<projectId>/monitors" \
-H "Authorization: Bearer <token>"Responses
200OK
List of project monitors
application/jsonmonitorsarray of object18 properties
idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found
500Internal Server Error
Internal server error
Create a project monitor
POST/v1/projects/{projectId}/monitors
Creates a project monitor from a runtime template. Requires monitors:write. A monitor evaluates a runtime metric on a schedule and fires when the comparison holds; to fire on matching dataset rows instead, create a data reaction at /v1/projects/{projectId}/reactions.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | The ID of the project |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Request body
Required
application/json
namestringRequiredDisplay name. Unique, case-insensitively, among the project's live monitors and data reactions — a collision answers 409.
- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring- Maximum length:
500
- Maximum length:
kindstringOptional assertion that
templateIdnames a monitor. A value that disagrees with the template is refused rather than ignored; omit it and the template decides.- Value:
runtime
- Value:
templateIdstringRequiredThe runtime template the monitor evaluates.
query_latency_p95is retained for existing monitors but cannot be used to create new ones; usequery_latency_p99.container_cpuis available only on managed projects with a defined CPU limit. A data-reaction template is refused here — create those at/v1/projects/{projectId}/reactions.- Allowed values:
query_failures,query_latency_p95,query_latency_p99,llm_failures,dataset_refresh_errors,http_5xx,flight_failures,memory_working_set,container_cpu,dataset_status,instance_health
- Allowed values:
specobjectRequiredMonitor parameters. Which properties apply is decided by
templateId— each property below names the templates that read it, and a property no monitor template reads is stored rather than rejected.specis shared with data reactions, so it accepts their properties too;modelis the one that is refused rather than stored.15 properties
opstringRequiredComparison applied to the metric. Required on every monitor spec.
instance_healthrequiresGT.- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredValue compared against the metric. HTTP failure monitors count estimated 5xx responses in the selected window. Rate-based conditions use responses per second.
dataset_refresh_errorscounts refresh errors in the window.query_latency_p99uses milliseconds.memory_working_setuses percent of the instance memory limit. A stored memory threshold above 1000 uses bytes.container_cpuuses percent of the defined CPU limit.dataset_statuscompares load-state numbers.instance_healthrequires 0. Every monitor spec requires a threshold.windowstringRange evaluated by
query_failures,query_latency_p99,llm_failures,dataset_refresh_errors,http_5xx,flight_failures, andcontainer_cpu.memory_working_setanddataset_statusread the current value and ignore this field.instance_healthreads current failure states and uses a fixed five-minute eviction observation window, independent of this field. Data reactions store this field but do not use it.- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsintegerSustain delay in seconds. Failure monitors default to 0. Other monitors default to 300. Explicit values are preserved.
- Minimum:
0 - Maximum:
86400
- Minimum:
severitystringSeverity the monitor fires at. Recorded on each monitor event and carried into the email or webhook notification.
- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstringRead by
dataset_status, which watches this one dataset. Omit it to match any dataset in the project.- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
includeDetailsbooleanWhen true, the recorded event and the notification may carry a
detailsstring quoted from the firing payload when it contains useful information. Off by default, because that payload may be sensitive. A notification's own summary, description, and observed value do not depend on it.valuestring | numberRead by
dataset_statusfor notification wording only, and only whenthresholdis not one of the state numbers above and this names a state. It never changes what the monitor evaluates. Otherwise a data-reaction property.columnstringA data-reaction property that no monitor evaluates. Leave it unset — a monitor carrying both
columnanddatasethas its notification describe that row predicate instead of its own metric comparison.- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
datasetsarray of stringA data-reaction property that no monitor reads.
- Maximum items:
20
- Maximum items:
conditionsarray of objectA data-reaction property that no monitor evaluates. Leave it unset — a monitor carrying conditions has its notification describe them instead of its own metric comparison. IS_NULL and IS_NOT_NULL omit value.
- Maximum items:
20
4 properties
datasetstringRequired- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
columnstringRequired- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
opstringRequired- Allowed values:
EQ,NEQ,GT,GEQ,LT,LEQ,CONTAINS,STARTS_WITH,ENDS_WITH,IS_NULL,IS_NOT_NULL
- Allowed values:
valuestring | numberRequired except for IS_NULL and IS_NOT_NULL.
- Maximum items:
returnFieldsarray of objectDataset fields returned by generated row-match queries. Include identity and all monitored fields.
- Maximum items:
20
2 properties
datasetstringRequiredcolumnsarray of stringRequired- Minimum items:
1 - Maximum items:
1000
- Minimum items:
- Maximum items:
queryLanguagestringA data-reaction property that no monitor reads.
- Allowed values:
cypher,gql
- Allowed values:
querystringA data-reaction property that no monitor reads.
- Maximum length:
10000
- Maximum length:
modelobjectModel transform. Data reactions only — sending it with a monitor template is refused with 400, not ignored.
2 properties
modelstringRequired- Minimum length:
1 - Maximum length:
128
- Minimum length:
instructionsstringRequired- Minimum length:
1 - Maximum length:
4000
- Minimum length:
targetobjectNotification sink. Omit it to email the user the credential belongs to; a machine credential has no user, so its monitors email the organization owner.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectFull destination set. When present, this replaces
targetand is the complete list. At most one sink of each type.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipientUserIdsarray of integerLegacy spelling of
target.recipientUserIds, read only when an email target omits its own.- Maximum items:
50
- Maximum items:
Example request
curl -X POST "https://api.spice.ai/v1/projects/<projectId>/monitors" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"templateId": "query_failures",
"spec": {
"op": "GT",
"threshold": 0
}
}'Responses
201Created
Monitor created
application/jsonA project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted.
evaluation_unavailable_reasonis present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid request body or project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found, or the template is not available for this project (
codeismonitor_template_unavailable). Monitors run only on managed projects, and only released templates are available unless the organization has early access.409Conflict
A live monitor or data reaction in this project already has this name
413Content Too Large
Request body too large
422Unprocessable Content
Slack is not connected for the organization
500Internal Server Error
Internal server error
502Bad Gateway
Failed to provision monitor
Get a project monitor
GET/v1/projects/{projectId}/monitors/{alertId}
Returns a single project monitor. Requires monitors:read. An existing container_cpu monitor without an effective CPU limit remains visible with evaluation_unavailable_reason set to cpu_limit_missing.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Example request
curl "https://api.spice.ai/v1/projects/<projectId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Monitor
application/jsonA project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted.
evaluation_unavailable_reasonis present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid project or monitor ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or monitor not found
500Internal Server Error
Internal server error
Update a project monitor
PATCH/v1/projects/{projectId}/monitors/{alertId}
Updates a project monitor. Requires monitors:write and organization admin privileges.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Request body
Required
application/json
namestring- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring | null- Maximum length:
500
- Maximum length:
statusstring- Allowed values:
active,disabled
- Allowed values:
templateIdstringspecobjecttargetobjectOmit to keep the existing destination.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
recipientUserIdsarray of integer
Example request
curl -X PATCH "https://api.spice.ai/v1/projects/<projectId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "string",
"spec": {},
"target": {
"type": "email"
},
"recipientUserIds": [
0
]
}'Responses
200OK
Monitor updated
400Bad Request
Invalid request or monitor ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope or role
404Not Found
Project or monitor not found
409Conflict
Duplicate monitor name or monitor changed during update
413Content Too Large
Request body too large
422Unprocessable Content
Destination is unavailable or project configuration is incomplete
500Internal Server Error
Internal server error
502Bad Gateway
Monitor backend update failed
Delete a project monitor
DELETE/v1/projects/{projectId}/monitors/{alertId}
Soft-deletes a project monitor and tears down the monitor it provisioned. Requires monitors:write.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Example request
curl -X DELETE "https://api.spice.ai/v1/projects/<projectId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Monitor deleted
400Bad Request
Invalid project or monitor ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or monitor not found
500Internal Server Error
Internal server error
502Bad Gateway
Failed to delete monitor
List project monitors
GET/v1/orgs/{orgId}/projects/{projectId}/monitors
The org is orgId in the path. Returns the project's monitors. Requires monitors:read. Monitors on a project that is not managed, or on a template that is not available to the organization, are omitted. An existing container_cpu monitor without an effective CPU limit remains visible with evaluation_unavailable_reason set to cpu_limit_missing.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
orgId | integer | Yes | The org id from GET /v1/orgs
|
projectId | integer | Yes | The ID of the project |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | When present, X-Org-Name must name the same org as orgId. Otherwise the request returns org_path_mismatch (400).
|
Example request
curl "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/monitors" \
-H "Authorization: Bearer <token>"Responses
200OK
List of project monitors
application/jsonmonitorsarray of object18 properties
idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid project ID. orgId is not a valid org id (
invalid_org_id), or X-Org-Name does not name that org (org_path_mismatch).401Unauthorized
Unauthorized
403Forbidden
Insufficient scope. The caller is not a member of the org (
org_forbidden). A machine credential named a different org (org_assertion_mismatch). The org is deleted (org_deleted).404Not Found
Project not found
500Internal Server Error
Internal server error
Create a project monitor
POST/v1/orgs/{orgId}/projects/{projectId}/monitors
The org is orgId in the path. Creates a project monitor from a runtime template. Requires monitors:write. A monitor evaluates a runtime metric on a schedule and fires when the comparison holds; to fire on matching dataset rows instead, create a data reaction at /v1/projects/{projectId}/reactions.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
orgId | integer | Yes | The org id from GET /v1/orgs
|
projectId | integer | Yes | The ID of the project |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | When present, X-Org-Name must name the same org as orgId. Otherwise the request returns org_path_mismatch (400).
|
Request body
Required
application/json
namestringRequiredDisplay name. Unique, case-insensitively, among the project's live monitors and data reactions — a collision answers 409.
- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring- Maximum length:
500
- Maximum length:
kindstringOptional assertion that
templateIdnames a monitor. A value that disagrees with the template is refused rather than ignored; omit it and the template decides.- Value:
runtime
- Value:
templateIdstringRequiredThe runtime template the monitor evaluates.
query_latency_p95is retained for existing monitors but cannot be used to create new ones; usequery_latency_p99.container_cpuis available only on managed projects with a defined CPU limit. A data-reaction template is refused here — create those at/v1/projects/{projectId}/reactions.- Allowed values:
query_failures,query_latency_p95,query_latency_p99,llm_failures,dataset_refresh_errors,http_5xx,flight_failures,memory_working_set,container_cpu,dataset_status,instance_health
- Allowed values:
specobjectRequiredMonitor parameters. Which properties apply is decided by
templateId— each property below names the templates that read it, and a property no monitor template reads is stored rather than rejected.specis shared with data reactions, so it accepts their properties too;modelis the one that is refused rather than stored.15 properties
opstringRequiredComparison applied to the metric. Required on every monitor spec.
instance_healthrequiresGT.- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredValue compared against the metric. HTTP failure monitors count estimated 5xx responses in the selected window. Rate-based conditions use responses per second.
dataset_refresh_errorscounts refresh errors in the window.query_latency_p99uses milliseconds.memory_working_setuses percent of the instance memory limit. A stored memory threshold above 1000 uses bytes.container_cpuuses percent of the defined CPU limit.dataset_statuscompares load-state numbers.instance_healthrequires 0. Every monitor spec requires a threshold.windowstringRange evaluated by
query_failures,query_latency_p99,llm_failures,dataset_refresh_errors,http_5xx,flight_failures, andcontainer_cpu.memory_working_setanddataset_statusread the current value and ignore this field.instance_healthreads current failure states and uses a fixed five-minute eviction observation window, independent of this field. Data reactions store this field but do not use it.- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsintegerSustain delay in seconds. Failure monitors default to 0. Other monitors default to 300. Explicit values are preserved.
- Minimum:
0 - Maximum:
86400
- Minimum:
severitystringSeverity the monitor fires at. Recorded on each monitor event and carried into the email or webhook notification.
- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstringRead by
dataset_status, which watches this one dataset. Omit it to match any dataset in the project.- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
includeDetailsbooleanWhen true, the recorded event and the notification may carry a
detailsstring quoted from the firing payload when it contains useful information. Off by default, because that payload may be sensitive. A notification's own summary, description, and observed value do not depend on it.valuestring | numberRead by
dataset_statusfor notification wording only, and only whenthresholdis not one of the state numbers above and this names a state. It never changes what the monitor evaluates. Otherwise a data-reaction property.columnstringA data-reaction property that no monitor evaluates. Leave it unset — a monitor carrying both
columnanddatasethas its notification describe that row predicate instead of its own metric comparison.- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
datasetsarray of stringA data-reaction property that no monitor reads.
- Maximum items:
20
- Maximum items:
conditionsarray of objectA data-reaction property that no monitor evaluates. Leave it unset — a monitor carrying conditions has its notification describe them instead of its own metric comparison. IS_NULL and IS_NOT_NULL omit value.
- Maximum items:
20
4 properties
datasetstringRequired- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
columnstringRequired- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
opstringRequired- Allowed values:
EQ,NEQ,GT,GEQ,LT,LEQ,CONTAINS,STARTS_WITH,ENDS_WITH,IS_NULL,IS_NOT_NULL
- Allowed values:
valuestring | numberRequired except for IS_NULL and IS_NOT_NULL.
- Maximum items:
returnFieldsarray of objectDataset fields returned by generated row-match queries. Include identity and all monitored fields.
- Maximum items:
20
2 properties
datasetstringRequiredcolumnsarray of stringRequired- Minimum items:
1 - Maximum items:
1000
- Minimum items:
- Maximum items:
queryLanguagestringA data-reaction property that no monitor reads.
- Allowed values:
cypher,gql
- Allowed values:
querystringA data-reaction property that no monitor reads.
- Maximum length:
10000
- Maximum length:
modelobjectModel transform. Data reactions only — sending it with a monitor template is refused with 400, not ignored.
2 properties
modelstringRequired- Minimum length:
1 - Maximum length:
128
- Minimum length:
instructionsstringRequired- Minimum length:
1 - Maximum length:
4000
- Minimum length:
targetobjectNotification sink. Omit it to email the user the credential belongs to; a machine credential has no user, so its monitors email the organization owner.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectFull destination set. When present, this replaces
targetand is the complete list. At most one sink of each type.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipientUserIdsarray of integerLegacy spelling of
target.recipientUserIds, read only when an email target omits its own.- Maximum items:
50
- Maximum items:
Example request
curl -X POST "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/monitors" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"templateId": "query_failures",
"spec": {
"op": "GT",
"threshold": 0
}
}'Responses
201Created
Monitor created
application/jsonA project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted.
evaluation_unavailable_reasonis present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid request body or project ID. orgId is not a valid org id (
invalid_org_id), or X-Org-Name does not name that org (org_path_mismatch).401Unauthorized
Unauthorized
403Forbidden
Insufficient scope. The caller is not a member of the org (
org_forbidden). A machine credential named a different org (org_assertion_mismatch). The org is deleted (org_deleted).404Not Found
Project not found, or the template is not available for this project (
codeismonitor_template_unavailable). Monitors run only on managed projects, and only released templates are available unless the organization has early access.409Conflict
A live monitor or data reaction in this project already has this name
413Content Too Large
Request body too large
422Unprocessable Content
Slack is not connected for the organization
500Internal Server Error
Internal server error
502Bad Gateway
Failed to provision monitor
Get a project monitor
GET/v1/orgs/{orgId}/projects/{projectId}/monitors/{alertId}
The org is orgId in the path. Returns a single project monitor. Requires monitors:read. An existing container_cpu monitor without an effective CPU limit remains visible with evaluation_unavailable_reason set to cpu_limit_missing.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
orgId | integer | Yes | The org id from GET /v1/orgs
|
projectId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | When present, X-Org-Name must name the same org as orgId. Otherwise the request returns org_path_mismatch (400).
|
Example request
curl "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Monitor
application/jsonA project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted.
evaluation_unavailable_reasonis present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid project or monitor ID. orgId is not a valid org id (
invalid_org_id), or X-Org-Name does not name that org (org_path_mismatch).401Unauthorized
Unauthorized
403Forbidden
Insufficient scope. The caller is not a member of the org (
org_forbidden). A machine credential named a different org (org_assertion_mismatch). The org is deleted (org_deleted).404Not Found
Project or monitor not found
500Internal Server Error
Internal server error
Update a project monitor
PATCH/v1/orgs/{orgId}/projects/{projectId}/monitors/{alertId}
The org is orgId in the path. Updates a project monitor. Requires monitors:write and organization admin privileges.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
orgId | integer | Yes | The org id from GET /v1/orgs
|
projectId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | When present, X-Org-Name must name the same org as orgId. Otherwise the request returns org_path_mismatch (400).
|
Request body
Required
application/json
namestring- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring | null- Maximum length:
500
- Maximum length:
statusstring- Allowed values:
active,disabled
- Allowed values:
templateIdstringspecobjecttargetobjectOmit to keep the existing destination.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
recipientUserIdsarray of integer
Example request
curl -X PATCH "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "string",
"spec": {},
"target": {
"type": "email"
},
"recipientUserIds": [
0
]
}'Responses
200OK
Monitor updated
400Bad Request
Invalid request or monitor ID. orgId is not a valid org id (
invalid_org_id), or X-Org-Name does not name that org (org_path_mismatch).401Unauthorized
Unauthorized
403Forbidden
Insufficient scope or role. The caller is not a member of the org (
org_forbidden). A machine credential named a different org (org_assertion_mismatch). The org is deleted (org_deleted).404Not Found
Project or monitor not found
409Conflict
Duplicate monitor name or monitor changed during update
413Content Too Large
Request body too large
422Unprocessable Content
Destination is unavailable or project configuration is incomplete
500Internal Server Error
Internal server error
502Bad Gateway
Monitor backend update failed
Delete a project monitor
DELETE/v1/orgs/{orgId}/projects/{projectId}/monitors/{alertId}
The org is orgId in the path. Soft-deletes a project monitor and tears down the monitor it provisioned. Requires monitors:write.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
orgId | integer | Yes | The org id from GET /v1/orgs
|
projectId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | When present, X-Org-Name must name the same org as orgId. Otherwise the request returns org_path_mismatch (400).
|
Example request
curl -X DELETE "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Monitor deleted
400Bad Request
Invalid project or monitor ID. orgId is not a valid org id (
invalid_org_id), or X-Org-Name does not name that org (org_path_mismatch).401Unauthorized
Unauthorized
403Forbidden
Insufficient scope. The caller is not a member of the org (
org_forbidden). A machine credential named a different org (org_assertion_mismatch). The org is deleted (org_deleted).404Not Found
Project or monitor not found
500Internal Server Error
Internal server error
502Bad Gateway
Failed to delete monitor
List project monitors
GET/v1/apps/{appId}/monitorsDeprecated
Legacy alias of /v1/projects/{projectId}/monitors — projects were previously called apps. Returns the project's monitors. Requires monitors:read. Monitors on a project that is not managed, or on a template that is not available to the organization, are omitted. An existing container_cpu monitor without an effective CPU limit remains visible with evaluation_unavailable_reason set to cpu_limit_missing.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
appId | integer | Yes | The ID of the project |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Example request
curl "https://api.spice.ai/v1/apps/<appId>/monitors" \
-H "Authorization: Bearer <token>"Responses
200OK
List of project monitors
application/jsonmonitorsarray of object18 properties
idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found
500Internal Server Error
Internal server error
Create a project monitor
POST/v1/apps/{appId}/monitorsDeprecated
Legacy alias of /v1/projects/{projectId}/monitors — projects were previously called apps. Creates a project monitor from a runtime template. Requires monitors:write. A monitor evaluates a runtime metric on a schedule and fires when the comparison holds; to fire on matching dataset rows instead, create a data reaction at /v1/projects/{projectId}/reactions.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
appId | integer | Yes | The ID of the project |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Request body
Required
application/json
namestringRequiredDisplay name. Unique, case-insensitively, among the project's live monitors and data reactions — a collision answers 409.
- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring- Maximum length:
500
- Maximum length:
kindstringOptional assertion that
templateIdnames a monitor. A value that disagrees with the template is refused rather than ignored; omit it and the template decides.- Value:
runtime
- Value:
templateIdstringRequiredThe runtime template the monitor evaluates.
query_latency_p95is retained for existing monitors but cannot be used to create new ones; usequery_latency_p99.container_cpuis available only on managed projects with a defined CPU limit. A data-reaction template is refused here — create those at/v1/projects/{projectId}/reactions.- Allowed values:
query_failures,query_latency_p95,query_latency_p99,llm_failures,dataset_refresh_errors,http_5xx,flight_failures,memory_working_set,container_cpu,dataset_status,instance_health
- Allowed values:
specobjectRequiredMonitor parameters. Which properties apply is decided by
templateId— each property below names the templates that read it, and a property no monitor template reads is stored rather than rejected.specis shared with data reactions, so it accepts their properties too;modelis the one that is refused rather than stored.15 properties
opstringRequiredComparison applied to the metric. Required on every monitor spec.
instance_healthrequiresGT.- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredValue compared against the metric. HTTP failure monitors count estimated 5xx responses in the selected window. Rate-based conditions use responses per second.
dataset_refresh_errorscounts refresh errors in the window.query_latency_p99uses milliseconds.memory_working_setuses percent of the instance memory limit. A stored memory threshold above 1000 uses bytes.container_cpuuses percent of the defined CPU limit.dataset_statuscompares load-state numbers.instance_healthrequires 0. Every monitor spec requires a threshold.windowstringRange evaluated by
query_failures,query_latency_p99,llm_failures,dataset_refresh_errors,http_5xx,flight_failures, andcontainer_cpu.memory_working_setanddataset_statusread the current value and ignore this field.instance_healthreads current failure states and uses a fixed five-minute eviction observation window, independent of this field. Data reactions store this field but do not use it.- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsintegerSustain delay in seconds. Failure monitors default to 0. Other monitors default to 300. Explicit values are preserved.
- Minimum:
0 - Maximum:
86400
- Minimum:
severitystringSeverity the monitor fires at. Recorded on each monitor event and carried into the email or webhook notification.
- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstringRead by
dataset_status, which watches this one dataset. Omit it to match any dataset in the project.- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
includeDetailsbooleanWhen true, the recorded event and the notification may carry a
detailsstring quoted from the firing payload when it contains useful information. Off by default, because that payload may be sensitive. A notification's own summary, description, and observed value do not depend on it.valuestring | numberRead by
dataset_statusfor notification wording only, and only whenthresholdis not one of the state numbers above and this names a state. It never changes what the monitor evaluates. Otherwise a data-reaction property.columnstringA data-reaction property that no monitor evaluates. Leave it unset — a monitor carrying both
columnanddatasethas its notification describe that row predicate instead of its own metric comparison.- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
datasetsarray of stringA data-reaction property that no monitor reads.
- Maximum items:
20
- Maximum items:
conditionsarray of objectA data-reaction property that no monitor evaluates. Leave it unset — a monitor carrying conditions has its notification describe them instead of its own metric comparison. IS_NULL and IS_NOT_NULL omit value.
- Maximum items:
20
4 properties
datasetstringRequired- Minimum length:
1 - Maximum length:
128 - Pattern:
^(?!.*\.\.)[A-Za-z_][A-Za-z0-9_.-]*$
- Minimum length:
columnstringRequired- Minimum length:
1 - Maximum length:
64 - Pattern:
^[A-Za-z_][A-Za-z0-9_]*$
- Minimum length:
opstringRequired- Allowed values:
EQ,NEQ,GT,GEQ,LT,LEQ,CONTAINS,STARTS_WITH,ENDS_WITH,IS_NULL,IS_NOT_NULL
- Allowed values:
valuestring | numberRequired except for IS_NULL and IS_NOT_NULL.
- Maximum items:
returnFieldsarray of objectDataset fields returned by generated row-match queries. Include identity and all monitored fields.
- Maximum items:
20
2 properties
datasetstringRequiredcolumnsarray of stringRequired- Minimum items:
1 - Maximum items:
1000
- Minimum items:
- Maximum items:
queryLanguagestringA data-reaction property that no monitor reads.
- Allowed values:
cypher,gql
- Allowed values:
querystringA data-reaction property that no monitor reads.
- Maximum length:
10000
- Maximum length:
modelobjectModel transform. Data reactions only — sending it with a monitor template is refused with 400, not ignored.
2 properties
modelstringRequired- Minimum length:
1 - Maximum length:
128
- Minimum length:
instructionsstringRequired- Minimum length:
1 - Maximum length:
4000
- Minimum length:
targetobjectNotification sink. Omit it to email the user the credential belongs to; a machine credential has no user, so its monitors email the organization owner.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectFull destination set. When present, this replaces
targetand is the complete list. At most one sink of each type.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipientUserIdsarray of integerLegacy spelling of
target.recipientUserIds, read only when an email target omits its own.- Maximum items:
50
- Maximum items:
Example request
curl -X POST "https://api.spice.ai/v1/apps/<appId>/monitors" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"templateId": "query_failures",
"spec": {
"op": "GT",
"threshold": 0
}
}'Responses
201Created
Monitor created
application/jsonA project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted.
evaluation_unavailable_reasonis present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid request body or project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found, or the template is not available for this project (
codeismonitor_template_unavailable). Monitors run only on managed projects, and only released templates are available unless the organization has early access.409Conflict
A live monitor or data reaction in this project already has this name
413Content Too Large
Request body too large
422Unprocessable Content
Slack is not connected for the organization
500Internal Server Error
Internal server error
502Bad Gateway
Failed to provision monitor
Get a project monitor
GET/v1/apps/{appId}/monitors/{alertId}Deprecated
Legacy alias of /v1/projects/{projectId}/monitors/{alertId} — projects were previously called apps. Returns a single project monitor. Requires monitors:read. An existing container_cpu monitor without an effective CPU limit remains visible with evaluation_unavailable_reason set to cpu_limit_missing.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
appId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Example request
curl "https://api.spice.ai/v1/apps/<appId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Monitor
application/jsonA project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted.
evaluation_unavailable_reasonis present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.idstring (uuid)RequiredIdentifier of the monitor or reaction. This is the value the get, update and delete operations take.
org_idintegerRequiredOrganization that owns the project
app_idintegerRequiredProject the monitor or reaction belongs to
created_byinteger | nullRequiredUser who created it, when it was created by a user credential
namestringRequiredDisplay name, unique case-insensitively among the project's live monitors and data reactions
descriptionstring | nullRequiredkindstringRequiredThe monitors endpoints only ever return
runtime.- Value:
runtime
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredMonitor parameters. Which properties are meaningful is decided by
template_id. The create operation's request body lists the properties each template reads.targetobjectRequiredThe primary sink (email, then slack, then http).
targetsis the full list. An HTTP sink'stokenis write-only and is never returned.3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
targetsarray of objectRequiredEvery configured sink, ordered email, then slack, then http.
targetis the first of these. An HTTP sink's token is never returned.- Minimum items:
1 - Maximum items:
3
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integeremailsarray of string (email)
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri) | ""RequiredThe sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
methodstring- Allowed values:
POST,PUT,PATCH
- Allowed values:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstring | ""RequiredThe Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
- Minimum items:
recipient_user_idsarray of integerRequiredOrganization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by
emails. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.last_fired_atstring (date-time) | nullRequiredWhen it last fired, or null if it never has
last_resolved_atstring (date-time) | nullRequiredWhen it last resolved, or null if it never has
created_atstring (date-time)Requiredupdated_atstring (date-time)Requiredevaluation_unavailable_reasonstringPresent when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed.
- Value:
cpu_limit_missing
- Value:
400Bad Request
Invalid project or monitor ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or monitor not found
500Internal Server Error
Internal server error
Update a project monitor
PATCH/v1/apps/{appId}/monitors/{alertId}Deprecated
Legacy alias of /v1/projects/{projectId}/monitors/{alertId} — projects were previously called apps. Updates a project monitor. Requires monitors:write and organization admin privileges.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
appId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Request body
Required
application/json
namestring- Minimum length:
1 - Maximum length:
100
- Minimum length:
descriptionstring | null- Maximum length:
500
- Maximum length:
statusstring- Allowed values:
active,disabled
- Allowed values:
templateIdstringspecobjecttargetobjectOmit to keep the existing destination.
3 options
One of
type: emailobject
typestringRequired- Value:
email
- Value:
recipientUserIdsarray of integerOrganization members to email, by user ID.
- Maximum items:
50
- Maximum items:
emailsarray of string (email)- Maximum items:
20
- Maximum items:
type: httpobject
typestringRequired- Value:
http
- Value:
urlstring (uri)RequiredThe URL each notification is sent to, using
method. Must be https and must resolve to a public address.- Minimum length:
1 - Maximum length:
2048
- Minimum length:
methodstringA create that omits it uses POST. An update that omits it keeps the stored method.
- Allowed values:
POST,PUT,PATCH
- Allowed values:
tokenstringBearer token sent with each delivery. Stored encrypted and never returned.
- Minimum length:
1 - Maximum length:
512
- Minimum length:
type: slackobject
typestringRequired- Value:
slack
- Value:
channelIdstringRequiredSlack conversation id. The organization must already have Slack connected.
- Minimum length:
9 - Maximum length:
32 - Pattern:
^[CGD][A-Z0-9]{8,31}$
- Minimum length:
channelNamestring- Minimum length:
1 - Maximum length:
80
- Minimum length:
recipientUserIdsarray of integer
Example request
curl -X PATCH "https://api.spice.ai/v1/apps/<appId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "string",
"spec": {},
"target": {
"type": "email"
},
"recipientUserIds": [
0
]
}'Responses
200OK
Monitor updated
400Bad Request
Invalid request or monitor ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope or role
404Not Found
Project or monitor not found
409Conflict
Duplicate monitor name or monitor changed during update
413Content Too Large
Request body too large
422Unprocessable Content
Destination is unavailable or project configuration is incomplete
500Internal Server Error
Internal server error
502Bad Gateway
Monitor backend update failed
Delete a project monitor
DELETE/v1/apps/{appId}/monitors/{alertId}Deprecated
Legacy alias of /v1/projects/{projectId}/monitors/{alertId} — projects were previously called apps. Soft-deletes a project monitor and tears down the monitor it provisioned. Requires monitors:write.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
appId | integer | Yes | |
alertId | string (uuid) | Yes |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes |
|
X-Org-Name | string | No | The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but
|
Example request
curl -X DELETE "https://api.spice.ai/v1/apps/<appId>/monitors/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Monitor deleted
400Bad Request
Invalid project or monitor ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or monitor not found
500Internal Server Error
Internal server error
502Bad Gateway
Failed to delete monitor