Reactions
Reference for the Reactions operations of the Spice Cloud Management API: list data reactions, create a data reaction, get a data reaction, update a data reaction, and delete a data reaction.
OpenAPIapi.spice.ai/openapi.json
List data reactions
GET/v1/projects/{projectId}/reactions
Returns Drasi data reactions for the specified project. Requires reactions:read.
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>/reactions" \
-H "Authorization: Bearer <token>"Responses
200OK
List of data reactions
application/jsonreactionsarray of object17 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found
500Internal Server Error
Internal server error
Create a data reaction
POST/v1/projects/{projectId}/reactions
Creates a Drasi data reaction from a data template. Requires reactions:write. Email and HTTP are sinks. Optional spec.model transforms the matching query result with a spicepod model that can tool-call back to Cloud to send the configured sink.
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.
descriptionstringtemplateIdstringRequiredspecobjectRequiredReaction parameters. Which properties apply is decided by
templateId— each property below names the templates that read it, and a property a template does not read is accepted and ignored rather than rejected.15 properties
opstringRequiredComparison operator. Required on every reaction spec.
- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredNumeric threshold. Required on every reaction spec.
task_history_slowcompares it against the task duration in milliseconds;dataset_row_matchanddataset_querymatch on the query itself, so they conventionally send 0.windowstringEvaluation window. Only project monitors (
/v1/projects/{projectId}/monitors) act on it — a data reaction fires on the matching row, so the value is stored and never read.- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsintegerHow long the condition must hold before firing, in seconds. Like
window, only project monitors act on it.- Default:
300 - Minimum:
0 - Maximum:
86400
- Default:
severitystringSeverity recorded on each reaction event and carried into the email or webhook notification.
- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstringSingle dataset to watch. Required by
dataset_row_matchwhenconditionsis omitted.- Maximum length:
128
- Maximum length:
columnstringColumn to compare. Required by
dataset_row_matchwhenconditionsis omitted.- Maximum length:
64
- Maximum length:
valuestring | numberValue to compare
columnagainst. Required bydataset_row_matchwhenconditionsis omitted.datasetsarray of stringDatasets the reaction watches.
dataset_row_matchuses this list. Omit it to derive names fromconditions.dataset_querydoes not read this field.- Maximum items:
20
- Maximum items:
conditionsarray of objectRow-match predicates, read by
dataset_row_match. CONTAINS, STARTS_WITH, ENDS_WITH, IS_NULL, and IS_NOT_NULL are allowed in addition to equality and ordering. IS_NULL and IS_NOT_NULL omit value.- Maximum items:
20
4 properties
datasetstringRequiredcolumnstringRequiredopstringRequired- 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:
queryLanguagestringLanguage of
query, read bydataset_query. Defaults togqlwhen omitted.- Allowed values:
cypher,gql - Default:
gql
- Allowed values:
querystringAuthored continuous query. Required by
dataset_query.- Maximum length:
10000
- Maximum length:
includeDetailsbooleanWhen true, notifications include matching row details. Off by default.
modelobjectOptional spicepod model transform (data reactions only). The model can call one tool for each selected sink (send_email, send_webhook, or send_slack).
2 properties
modelstringRequiredSpicepod model or worker name
instructionsstringRequiredSystem instructions sent with each matching query result
targetobjectReaction sink. Omit to email the caller.
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:
Example request
curl -X POST "https://api.spice.ai/v1/projects/<projectId>/reactions" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"templateId": "string",
"spec": {
"op": "GT",
"threshold": 0
}
}'Responses
201Created
Reaction created
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid request body or project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found
409Conflict
A live monitor or data reaction in this project already has this name
413Content Too Large
Request body too large
422Unprocessable Content
A required project capability or Slack connection is unavailable
500Internal Server Error
Internal server error
502Bad Gateway
Failed to provision reaction
503Service Unavailable
The project's Drasi data source is starting or unavailable
Get a data reaction
GET/v1/projects/{projectId}/reactions/{alertId}
Returns a single data reaction. Requires reactions:read.
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>/reactions/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Reaction
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid project or reaction ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or reaction not found
500Internal Server Error
Internal server error
Update a data reaction
PATCH/v1/projects/{projectId}/reactions/{alertId}
Updates reaction fields supplied in the request. Requires reactions:write and organization membership.
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:
templateIdstringspecobjecttargetobjectA notification sink in a create or update request. Cluster monitors, project monitors and data reactions accept the same shape.
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 object- 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 integer
Example request
curl -X PATCH "https://api.spice.ai/v1/projects/<projectId>/reactions/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "string",
"spec": {},
"target": {
"type": "email"
},
"targets": [
{
"type": "email"
}
],
"recipientUserIds": [
0
]
}'Responses
200OK
Reaction updated
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid request, specification, or dataset
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope or organization membership
404Not Found
Project or reaction not found
409Conflict
Name conflict or concurrent update
413Content Too Large
Request body too large
422Unprocessable Content
Project configuration is incomplete
429Too Many Requests
Another update is in progress for this reaction
500Internal Server Error
Internal server error
502Bad Gateway
Drasi update failed
503Service Unavailable
The project's Drasi data source or lock store is unavailable
Delete a data reaction
DELETE/v1/projects/{projectId}/reactions/{alertId}
Soft-deletes a data reaction and tears down its Drasi query. Requires reactions: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>/reactions/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Reaction deleted
400Bad Request
Invalid project or reaction ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or reaction not found
500Internal Server Error
Internal server error
502Bad Gateway
Failed to delete reaction
List data reactions
GET/v1/orgs/{orgId}/projects/{projectId}/reactions
The org is orgId in the path. Returns Drasi data reactions for the specified project. Requires reactions:read.
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>/reactions" \
-H "Authorization: Bearer <token>"Responses
200OK
List of data reactions
application/jsonreactionsarray of object17 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
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 data reaction
POST/v1/orgs/{orgId}/projects/{projectId}/reactions
The org is orgId in the path. Creates a Drasi data reaction from a data template. Requires reactions:write. Email and HTTP are sinks. Optional spec.model transforms the matching query result with a spicepod model that can tool-call back to Cloud to send the configured sink.
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.
descriptionstringtemplateIdstringRequiredspecobjectRequiredReaction parameters. Which properties apply is decided by
templateId— each property below names the templates that read it, and a property a template does not read is accepted and ignored rather than rejected.15 properties
opstringRequiredComparison operator. Required on every reaction spec.
- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredNumeric threshold. Required on every reaction spec.
task_history_slowcompares it against the task duration in milliseconds;dataset_row_matchanddataset_querymatch on the query itself, so they conventionally send 0.windowstringEvaluation window. Only project monitors (
/v1/projects/{projectId}/monitors) act on it — a data reaction fires on the matching row, so the value is stored and never read.- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsintegerHow long the condition must hold before firing, in seconds. Like
window, only project monitors act on it.- Default:
300 - Minimum:
0 - Maximum:
86400
- Default:
severitystringSeverity recorded on each reaction event and carried into the email or webhook notification.
- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstringSingle dataset to watch. Required by
dataset_row_matchwhenconditionsis omitted.- Maximum length:
128
- Maximum length:
columnstringColumn to compare. Required by
dataset_row_matchwhenconditionsis omitted.- Maximum length:
64
- Maximum length:
valuestring | numberValue to compare
columnagainst. Required bydataset_row_matchwhenconditionsis omitted.datasetsarray of stringDatasets the reaction watches.
dataset_row_matchuses this list. Omit it to derive names fromconditions.dataset_querydoes not read this field.- Maximum items:
20
- Maximum items:
conditionsarray of objectRow-match predicates, read by
dataset_row_match. CONTAINS, STARTS_WITH, ENDS_WITH, IS_NULL, and IS_NOT_NULL are allowed in addition to equality and ordering. IS_NULL and IS_NOT_NULL omit value.- Maximum items:
20
4 properties
datasetstringRequiredcolumnstringRequiredopstringRequired- 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:
queryLanguagestringLanguage of
query, read bydataset_query. Defaults togqlwhen omitted.- Allowed values:
cypher,gql - Default:
gql
- Allowed values:
querystringAuthored continuous query. Required by
dataset_query.- Maximum length:
10000
- Maximum length:
includeDetailsbooleanWhen true, notifications include matching row details. Off by default.
modelobjectOptional spicepod model transform (data reactions only). The model can call one tool for each selected sink (send_email, send_webhook, or send_slack).
2 properties
modelstringRequiredSpicepod model or worker name
instructionsstringRequiredSystem instructions sent with each matching query result
targetobjectReaction sink. Omit to email the caller.
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:
Example request
curl -X POST "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/reactions" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"templateId": "string",
"spec": {
"op": "GT",
"threshold": 0
}
}'Responses
201Created
Reaction created
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
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
409Conflict
A live monitor or data reaction in this project already has this name
413Content Too Large
Request body too large
422Unprocessable Content
A required project capability or Slack connection is unavailable
500Internal Server Error
Internal server error
502Bad Gateway
Failed to provision reaction
503Service Unavailable
The project's Drasi data source is starting or unavailable
Get a data reaction
GET/v1/orgs/{orgId}/projects/{projectId}/reactions/{alertId}
The org is orgId in the path. Returns a single data reaction. Requires reactions:read.
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>/reactions/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Reaction
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid project or reaction 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 reaction not found
500Internal Server Error
Internal server error
Update a data reaction
PATCH/v1/orgs/{orgId}/projects/{projectId}/reactions/{alertId}
The org is orgId in the path. Updates reaction fields supplied in the request. Requires reactions:write and organization membership.
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:
templateIdstringspecobjecttargetobjectA notification sink in a create or update request. Cluster monitors, project monitors and data reactions accept the same shape.
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 object- 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 integer
Example request
curl -X PATCH "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/reactions/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "string",
"spec": {},
"target": {
"type": "email"
},
"targets": [
{
"type": "email"
}
],
"recipientUserIds": [
0
]
}'Responses
200OK
Reaction updated
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid request, specification, or dataset. 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 organization membership. 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 reaction not found
409Conflict
Name conflict or concurrent update
413Content Too Large
Request body too large
422Unprocessable Content
Project configuration is incomplete
429Too Many Requests
Another update is in progress for this reaction
500Internal Server Error
Internal server error
502Bad Gateway
Drasi update failed
503Service Unavailable
The project's Drasi data source or lock store is unavailable
Delete a data reaction
DELETE/v1/orgs/{orgId}/projects/{projectId}/reactions/{alertId}
The org is orgId in the path. Soft-deletes a data reaction and tears down its Drasi query. Requires reactions: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>/reactions/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Reaction deleted
400Bad Request
Invalid project or reaction 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 reaction not found
500Internal Server Error
Internal server error
502Bad Gateway
Failed to delete reaction
List data reactions
GET/v1/apps/{appId}/reactionsDeprecated
Legacy alias of /v1/projects/{projectId}/reactions — projects were previously called apps. Returns Drasi data reactions for the specified project. Requires reactions:read.
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>/reactions" \
-H "Authorization: Bearer <token>"Responses
200OK
List of data reactions
application/jsonreactionsarray of object17 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found
500Internal Server Error
Internal server error
Create a data reaction
POST/v1/apps/{appId}/reactionsDeprecated
Legacy alias of /v1/projects/{projectId}/reactions — projects were previously called apps. Creates a Drasi data reaction from a data template. Requires reactions:write. Email and HTTP are sinks. Optional spec.model transforms the matching query result with a spicepod model that can tool-call back to Cloud to send the configured sink.
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.
descriptionstringtemplateIdstringRequiredspecobjectRequiredReaction parameters. Which properties apply is decided by
templateId— each property below names the templates that read it, and a property a template does not read is accepted and ignored rather than rejected.15 properties
opstringRequiredComparison operator. Required on every reaction spec.
- Allowed values:
GT,GEQ,LT,LEQ,EQ,NEQ
- Allowed values:
thresholdnumberRequiredNumeric threshold. Required on every reaction spec.
task_history_slowcompares it against the task duration in milliseconds;dataset_row_matchanddataset_querymatch on the query itself, so they conventionally send 0.windowstringEvaluation window. Only project monitors (
/v1/projects/{projectId}/monitors) act on it — a data reaction fires on the matching row, so the value is stored and never read.- Allowed values:
1m,5m,15m,30m,1h - Default:
5m
- Allowed values:
sustainSecsintegerHow long the condition must hold before firing, in seconds. Like
window, only project monitors act on it.- Default:
300 - Minimum:
0 - Maximum:
86400
- Default:
severitystringSeverity recorded on each reaction event and carried into the email or webhook notification.
- Allowed values:
warn,critical - Default:
critical
- Allowed values:
datasetstringSingle dataset to watch. Required by
dataset_row_matchwhenconditionsis omitted.- Maximum length:
128
- Maximum length:
columnstringColumn to compare. Required by
dataset_row_matchwhenconditionsis omitted.- Maximum length:
64
- Maximum length:
valuestring | numberValue to compare
columnagainst. Required bydataset_row_matchwhenconditionsis omitted.datasetsarray of stringDatasets the reaction watches.
dataset_row_matchuses this list. Omit it to derive names fromconditions.dataset_querydoes not read this field.- Maximum items:
20
- Maximum items:
conditionsarray of objectRow-match predicates, read by
dataset_row_match. CONTAINS, STARTS_WITH, ENDS_WITH, IS_NULL, and IS_NOT_NULL are allowed in addition to equality and ordering. IS_NULL and IS_NOT_NULL omit value.- Maximum items:
20
4 properties
datasetstringRequiredcolumnstringRequiredopstringRequired- 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:
queryLanguagestringLanguage of
query, read bydataset_query. Defaults togqlwhen omitted.- Allowed values:
cypher,gql - Default:
gql
- Allowed values:
querystringAuthored continuous query. Required by
dataset_query.- Maximum length:
10000
- Maximum length:
includeDetailsbooleanWhen true, notifications include matching row details. Off by default.
modelobjectOptional spicepod model transform (data reactions only). The model can call one tool for each selected sink (send_email, send_webhook, or send_slack).
2 properties
modelstringRequiredSpicepod model or worker name
instructionsstringRequiredSystem instructions sent with each matching query result
targetobjectReaction sink. Omit to email the caller.
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:
Example request
curl -X POST "https://api.spice.ai/v1/apps/<appId>/reactions" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"templateId": "string",
"spec": {
"op": "GT",
"threshold": 0
}
}'Responses
201Created
Reaction created
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid request body or project ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project not found
409Conflict
A live monitor or data reaction in this project already has this name
413Content Too Large
Request body too large
422Unprocessable Content
A required project capability or Slack connection is unavailable
500Internal Server Error
Internal server error
502Bad Gateway
Failed to provision reaction
503Service Unavailable
The project's Drasi data source is starting or unavailable
Get a data reaction
GET/v1/apps/{appId}/reactions/{alertId}Deprecated
Legacy alias of /v1/projects/{projectId}/reactions/{alertId} — projects were previously called apps. Returns a single data reaction. Requires reactions:read.
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>/reactions/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Reaction
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid project or reaction ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or reaction not found
500Internal Server Error
Internal server error
Update a data reaction
PATCH/v1/apps/{appId}/reactions/{alertId}Deprecated
Legacy alias of /v1/projects/{projectId}/reactions/{alertId} — projects were previously called apps. Updates reaction fields supplied in the request. Requires reactions:write and organization membership.
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:
templateIdstringspecobjecttargetobjectA notification sink in a create or update request. Cluster monitors, project monitors and data reactions accept the same shape.
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 object- 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 integer
Example request
curl -X PATCH "https://api.spice.ai/v1/apps/<appId>/reactions/<alertId>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"status": "active",
"templateId": "string",
"spec": {},
"target": {
"type": "email"
},
"targets": [
{
"type": "email"
}
],
"recipientUserIds": [
0
]
}'Responses
200OK
Reaction updated
application/jsonA data reaction, as returned by the list, get, create and update operations. Every property is always present; a nullable one carries null rather than being omitted. 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 reactions endpoints only ever return
data.- Value:
data
- Value:
statusstringRequiredWhether it is evaluating
- Allowed values:
active,disabled
- Allowed values:
template_idstringRequiredTemplate it was created from
specobjectRequiredReaction parameters, normalized for the response: a reaction whose model transform is still held on
targetis returned with that transform copied intospec.model. Which properties are meaningful is decided bytemplate_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 it 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.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)Required
400Bad Request
Invalid request, specification, or dataset
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope or organization membership
404Not Found
Project or reaction not found
409Conflict
Name conflict or concurrent update
413Content Too Large
Request body too large
422Unprocessable Content
Project configuration is incomplete
429Too Many Requests
Another update is in progress for this reaction
500Internal Server Error
Internal server error
502Bad Gateway
Drasi update failed
503Service Unavailable
The project's Drasi data source or lock store is unavailable
Delete a data reaction
DELETE/v1/apps/{appId}/reactions/{alertId}Deprecated
Legacy alias of /v1/projects/{projectId}/reactions/{alertId} — projects were previously called apps. Soft-deletes a data reaction and tears down its Drasi query. Requires reactions: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>/reactions/<alertId>" \
-H "Authorization: Bearer <token>"Responses
200OK
Reaction deleted
400Bad Request
Invalid project or reaction ID
401Unauthorized
Unauthorized
403Forbidden
Insufficient scope
404Not Found
Project or reaction not found
500Internal Server Error
Internal server error
502Bad Gateway
Failed to delete reaction