Management APIs / Reactions

Create a data reaction

POSThttps://api.spice.ai/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.

Authorizations

  • AuthorizationstringRequired

    Bearer <token>. Authentication lists the tokens it accepts.

Path parameters

  • projectIdintegerRequired

    The ID of the project

Header parameters

  • X-Org-Namestring

    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 GET /v1/orgs (400 org_assertion_required otherwise).

    • Pattern: ^[A-Za-z0-9._-]{1,255}$

Body

application/jsonRequired

  • namestringRequired

    Display name. Unique, case-insensitively, among the project's live monitors and data reactions — a collision answers 409.

  • descriptionstring

  • templateIdstringRequired

  • specobjectRequired

    Reaction 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
    • opstringRequired

      Comparison operator. Required on every reaction spec.

      • Allowed values: GT, GEQ, LT, LEQ, EQ, NEQ
    • thresholdnumberRequired

      Numeric threshold. Required on every reaction spec. task_history_slow compares it against the task duration in milliseconds; dataset_row_match and dataset_query match on the query itself, so they conventionally send 0.

    • windowstring

      Evaluation 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
    • sustainSecsinteger

      How long the condition must hold before firing, in seconds. Like window, only project monitors act on it.

      • Default: 300
      • Minimum: 0
      • Maximum: 86400
    • severitystring

      Severity recorded on each reaction event and carried into the email or webhook notification.

      • Allowed values: warn, critical
      • Default: critical
    • datasetstring

      Single dataset to watch. Required by dataset_row_match when conditions is omitted.

      • Maximum length: 128
    • columnstring

      Column to compare. Required by dataset_row_match when conditions is omitted.

      • Maximum length: 64
    • valuestring | number

      Value to compare column against. Required by dataset_row_match when conditions is omitted.

    • datasetsarray of string

      Datasets the reaction watches. dataset_row_match uses this list. Omit it to derive names from conditions. dataset_query does not read this field.

      • Maximum items: 20
    • conditionsarray of object

      Row-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
      • datasetstringRequired

      • columnstringRequired

      • opstringRequired

        • Allowed values: EQ, NEQ, GT, GEQ, LT, LEQ, CONTAINS, STARTS_WITH, ENDS_WITH, IS_NULL, IS_NOT_NULL
      • valuestring | number

        Required except for IS_NULL and IS_NOT_NULL.

    • returnFieldsarray of object

      Dataset fields returned by generated row-match queries. Include identity and all monitored fields.

      • Maximum items: 20
      2 properties
      • datasetstringRequired

      • columnsarray of stringRequired

        • Minimum items: 1
        • Maximum items: 1000
    • queryLanguagestring

      Language of query, read by dataset_query. Defaults to gql when omitted.

      • Allowed values: cypher, gql
      • Default: gql
    • querystring

      Authored continuous query. Required by dataset_query.

      • Maximum length: 10000
    • includeDetailsboolean

      When true, notifications include matching row details. Off by default.

    • modelobject

      Optional 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
      • modelstringRequired

        Spicepod model or worker name

      • instructionsstringRequired

        System instructions sent with each matching query result

  • targetobject

    Reaction sink. Omit to email the caller.

    3 options

    One of

    type: emailobject
    • typestringRequired

      • Value: email
    • recipientUserIdsarray of integer

      Organization members to email, by user ID.

      • Maximum items: 50
    • emailsarray of string (email)

      • Maximum items: 20
    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri)Required

      The URL each notification is sent to, using method. Must be https and must resolve to a public address.

      • Minimum length: 1
      • Maximum length: 2048
    • methodstring

      A create that omits it uses POST. An update that omits it keeps the stored method.

      • Allowed values: POST, PUT, PATCH
    • tokenstring

      Bearer token sent with each delivery. Stored encrypted and never returned.

      • Minimum length: 1
      • Maximum length: 512
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstringRequired

      Slack conversation id. The organization must already have Slack connected.

      • Minimum length: 9
      • Maximum length: 32
      • Pattern: ^[CGD][A-Z0-9]{8,31}$
    • channelNamestring

      • Minimum length: 1
      • Maximum length: 80
  • targetsarray of object

    Full destination set. When present, this replaces target and 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
    • recipientUserIdsarray of integer

      Organization members to email, by user ID.

      • Maximum items: 50
    • emailsarray of string (email)

      • Maximum items: 20
    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri)Required

      The URL each notification is sent to, using method. Must be https and must resolve to a public address.

      • Minimum length: 1
      • Maximum length: 2048
    • methodstring

      A create that omits it uses POST. An update that omits it keeps the stored method.

      • Allowed values: POST, PUT, PATCH
    • tokenstring

      Bearer token sent with each delivery. Stored encrypted and never returned.

      • Minimum length: 1
      • Maximum length: 512
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstringRequired

      Slack conversation id. The organization must already have Slack connected.

      • Minimum length: 9
      • Maximum length: 32
      • Pattern: ^[CGD][A-Z0-9]{8,31}$
    • channelNamestring

      • Minimum length: 1
      • Maximum length: 80

Responses

201Reaction createdapplication/json

A 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)Required

    Identifier of the monitor or reaction. This is the value the get, update and delete operations take.

  • org_idintegerRequired

    Organization that owns the project

  • app_idintegerRequired

    Project the monitor or reaction belongs to

  • created_byinteger | nullRequired

    User who created it, when it was created by a user credential

  • namestringRequired

    Display name, unique case-insensitively among the project's live monitors and data reactions

  • descriptionstring | nullRequired

  • kindstringRequired

    The reactions endpoints only ever return data.

    • Value: data
  • statusstringRequired

    Whether it is evaluating

    • Allowed values: active, disabled
  • template_idstringRequired

    Template it was created from

  • specobjectRequired

    Reaction parameters, normalized for the response: a reaction whose model transform is still held on target is returned with that transform copied into spec.model. Which properties are meaningful is decided by template_id. The create operation's request body lists the properties each template reads.

  • targetobjectRequired

    The primary sink (email, then slack, then http). targets is the full list. An HTTP sink's token is write-only and is never returned.

    3 options

    One of

    type: emailobject
    • typestringRequired

      • Value: email
    • recipientUserIdsarray of integer

    • emailsarray of string (email)

    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri) | ""Required

      The 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
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstring | ""Required

      The 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
  • targetsarray of objectRequired

    Every configured sink, ordered email, then slack, then http. target is 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
    • recipientUserIdsarray of integer

    • emailsarray of string (email)

    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri) | ""Required

      The 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
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstring | ""Required

      The 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
  • recipient_user_idsarray of integerRequired

    Organization 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) | nullRequired

    When it last fired, or null if it never has

  • last_resolved_atstring (date-time) | nullRequired

    When it last resolved, or null if it never has

  • created_atstring (date-time)Required

  • updated_atstring (date-time)Required

400Invalid request body or project ID

401Unauthorized

403Insufficient scope

404Project not found

409A live monitor or data reaction in this project already has this name

413Request body too large

422A required project capability or Slack connection is unavailable

500Internal server error

502Failed to provision reaction

503The project's Drasi data source is starting or unavailable

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
    }
  }'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": 0,
  "app_id": 0,
  "created_by": 0,
  "name": "string",
  "description": "string",
  "kind": "data",
  "status": "active",
  "template_id": "string",
  "spec": {},
  "target": {
    "type": "email",
    "recipientUserIds": [
      0
    ],
    "emails": [
      "user@example.com"
    ]
  },
  "targets": [
    {
      "type": "email",
      "recipientUserIds": [
        0
      ],
      "emails": [
        "user@example.com"
      ]
    }
  ],
  "recipient_user_ids": [
    0
  ],
  "last_fired_at": "2026-01-01T00:00:00Z",
  "last_resolved_at": "2026-01-01T00:00:00Z",
  "created_at": "2026-01-01T00:00:00Z",
  "updated_at": "2026-01-01T00:00:00Z"
}

application/json

POSThttps://api.spice.ai/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.

Authorizations

  • AuthorizationstringRequired

    Bearer <token>. Authentication lists the tokens it accepts.

Path parameters

  • orgIdintegerRequired

    The org id from GET /v1/orgs

    • Minimum: 1
  • projectIdintegerRequired

    The ID of the project

Header parameters

  • X-Org-Namestring

    When present, X-Org-Name must name the same org as orgId. Otherwise the request returns org_path_mismatch (400).

    • Pattern: ^[A-Za-z0-9._-]{1,255}$

Body

application/jsonRequired

  • namestringRequired

    Display name. Unique, case-insensitively, among the project's live monitors and data reactions — a collision answers 409.

  • descriptionstring

  • templateIdstringRequired

  • specobjectRequired

    Reaction 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
    • opstringRequired

      Comparison operator. Required on every reaction spec.

      • Allowed values: GT, GEQ, LT, LEQ, EQ, NEQ
    • thresholdnumberRequired

      Numeric threshold. Required on every reaction spec. task_history_slow compares it against the task duration in milliseconds; dataset_row_match and dataset_query match on the query itself, so they conventionally send 0.

    • windowstring

      Evaluation 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
    • sustainSecsinteger

      How long the condition must hold before firing, in seconds. Like window, only project monitors act on it.

      • Default: 300
      • Minimum: 0
      • Maximum: 86400
    • severitystring

      Severity recorded on each reaction event and carried into the email or webhook notification.

      • Allowed values: warn, critical
      • Default: critical
    • datasetstring

      Single dataset to watch. Required by dataset_row_match when conditions is omitted.

      • Maximum length: 128
    • columnstring

      Column to compare. Required by dataset_row_match when conditions is omitted.

      • Maximum length: 64
    • valuestring | number

      Value to compare column against. Required by dataset_row_match when conditions is omitted.

    • datasetsarray of string

      Datasets the reaction watches. dataset_row_match uses this list. Omit it to derive names from conditions. dataset_query does not read this field.

      • Maximum items: 20
    • conditionsarray of object

      Row-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
      • datasetstringRequired

      • columnstringRequired

      • opstringRequired

        • Allowed values: EQ, NEQ, GT, GEQ, LT, LEQ, CONTAINS, STARTS_WITH, ENDS_WITH, IS_NULL, IS_NOT_NULL
      • valuestring | number

        Required except for IS_NULL and IS_NOT_NULL.

    • returnFieldsarray of object

      Dataset fields returned by generated row-match queries. Include identity and all monitored fields.

      • Maximum items: 20
      2 properties
      • datasetstringRequired

      • columnsarray of stringRequired

        • Minimum items: 1
        • Maximum items: 1000
    • queryLanguagestring

      Language of query, read by dataset_query. Defaults to gql when omitted.

      • Allowed values: cypher, gql
      • Default: gql
    • querystring

      Authored continuous query. Required by dataset_query.

      • Maximum length: 10000
    • includeDetailsboolean

      When true, notifications include matching row details. Off by default.

    • modelobject

      Optional 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
      • modelstringRequired

        Spicepod model or worker name

      • instructionsstringRequired

        System instructions sent with each matching query result

  • targetobject

    Reaction sink. Omit to email the caller.

    3 options

    One of

    type: emailobject
    • typestringRequired

      • Value: email
    • recipientUserIdsarray of integer

      Organization members to email, by user ID.

      • Maximum items: 50
    • emailsarray of string (email)

      • Maximum items: 20
    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri)Required

      The URL each notification is sent to, using method. Must be https and must resolve to a public address.

      • Minimum length: 1
      • Maximum length: 2048
    • methodstring

      A create that omits it uses POST. An update that omits it keeps the stored method.

      • Allowed values: POST, PUT, PATCH
    • tokenstring

      Bearer token sent with each delivery. Stored encrypted and never returned.

      • Minimum length: 1
      • Maximum length: 512
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstringRequired

      Slack conversation id. The organization must already have Slack connected.

      • Minimum length: 9
      • Maximum length: 32
      • Pattern: ^[CGD][A-Z0-9]{8,31}$
    • channelNamestring

      • Minimum length: 1
      • Maximum length: 80
  • targetsarray of object

    Full destination set. When present, this replaces target and 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
    • recipientUserIdsarray of integer

      Organization members to email, by user ID.

      • Maximum items: 50
    • emailsarray of string (email)

      • Maximum items: 20
    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri)Required

      The URL each notification is sent to, using method. Must be https and must resolve to a public address.

      • Minimum length: 1
      • Maximum length: 2048
    • methodstring

      A create that omits it uses POST. An update that omits it keeps the stored method.

      • Allowed values: POST, PUT, PATCH
    • tokenstring

      Bearer token sent with each delivery. Stored encrypted and never returned.

      • Minimum length: 1
      • Maximum length: 512
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstringRequired

      Slack conversation id. The organization must already have Slack connected.

      • Minimum length: 9
      • Maximum length: 32
      • Pattern: ^[CGD][A-Z0-9]{8,31}$
    • channelNamestring

      • Minimum length: 1
      • Maximum length: 80

Responses

201Reaction createdapplication/json

A 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)Required

    Identifier of the monitor or reaction. This is the value the get, update and delete operations take.

  • org_idintegerRequired

    Organization that owns the project

  • app_idintegerRequired

    Project the monitor or reaction belongs to

  • created_byinteger | nullRequired

    User who created it, when it was created by a user credential

  • namestringRequired

    Display name, unique case-insensitively among the project's live monitors and data reactions

  • descriptionstring | nullRequired

  • kindstringRequired

    The reactions endpoints only ever return data.

    • Value: data
  • statusstringRequired

    Whether it is evaluating

    • Allowed values: active, disabled
  • template_idstringRequired

    Template it was created from

  • specobjectRequired

    Reaction parameters, normalized for the response: a reaction whose model transform is still held on target is returned with that transform copied into spec.model. Which properties are meaningful is decided by template_id. The create operation's request body lists the properties each template reads.

  • targetobjectRequired

    The primary sink (email, then slack, then http). targets is the full list. An HTTP sink's token is write-only and is never returned.

    3 options

    One of

    type: emailobject
    • typestringRequired

      • Value: email
    • recipientUserIdsarray of integer

    • emailsarray of string (email)

    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri) | ""Required

      The 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
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstring | ""Required

      The 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
  • targetsarray of objectRequired

    Every configured sink, ordered email, then slack, then http. target is 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
    • recipientUserIdsarray of integer

    • emailsarray of string (email)

    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri) | ""Required

      The 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
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstring | ""Required

      The 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
  • recipient_user_idsarray of integerRequired

    Organization 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) | nullRequired

    When it last fired, or null if it never has

  • last_resolved_atstring (date-time) | nullRequired

    When it last resolved, or null if it never has

  • created_atstring (date-time)Required

  • updated_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

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).

404Project not found

409A live monitor or data reaction in this project already has this name

413Request body too large

422A required project capability or Slack connection is unavailable

500Internal server error

502Failed to provision reaction

503The project's Drasi data source is starting or unavailable

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
    }
  }'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": 0,
  "app_id": 0,
  "created_by": 0,
  "name": "string",
  "description": "string",
  "kind": "data",
  "status": "active",
  "template_id": "string",
  "spec": {},
  "target": {
    "type": "email",
    "recipientUserIds": [
      0
    ],
    "emails": [
      "user@example.com"
    ]
  },
  "targets": [
    {
      "type": "email",
      "recipientUserIds": [
        0
      ],
      "emails": [
        "user@example.com"
      ]
    }
  ],
  "recipient_user_ids": [
    0
  ],
  "last_fired_at": "2026-01-01T00:00:00Z",
  "last_resolved_at": "2026-01-01T00:00:00Z",
  "created_at": "2026-01-01T00:00:00Z",
  "updated_at": "2026-01-01T00:00:00Z"
}

application/json

POSThttps://api.spice.ai/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.

Authorizations

  • AuthorizationstringRequired

    Bearer <token>. Authentication lists the tokens it accepts.

Path parameters

  • appIdintegerRequired

    The ID of the project

Header parameters

  • X-Org-Namestring

    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 GET /v1/orgs (400 org_assertion_required otherwise).

    • Pattern: ^[A-Za-z0-9._-]{1,255}$

Body

application/jsonRequired

  • namestringRequired

    Display name. Unique, case-insensitively, among the project's live monitors and data reactions — a collision answers 409.

  • descriptionstring

  • templateIdstringRequired

  • specobjectRequired

    Reaction 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
    • opstringRequired

      Comparison operator. Required on every reaction spec.

      • Allowed values: GT, GEQ, LT, LEQ, EQ, NEQ
    • thresholdnumberRequired

      Numeric threshold. Required on every reaction spec. task_history_slow compares it against the task duration in milliseconds; dataset_row_match and dataset_query match on the query itself, so they conventionally send 0.

    • windowstring

      Evaluation 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
    • sustainSecsinteger

      How long the condition must hold before firing, in seconds. Like window, only project monitors act on it.

      • Default: 300
      • Minimum: 0
      • Maximum: 86400
    • severitystring

      Severity recorded on each reaction event and carried into the email or webhook notification.

      • Allowed values: warn, critical
      • Default: critical
    • datasetstring

      Single dataset to watch. Required by dataset_row_match when conditions is omitted.

      • Maximum length: 128
    • columnstring

      Column to compare. Required by dataset_row_match when conditions is omitted.

      • Maximum length: 64
    • valuestring | number

      Value to compare column against. Required by dataset_row_match when conditions is omitted.

    • datasetsarray of string

      Datasets the reaction watches. dataset_row_match uses this list. Omit it to derive names from conditions. dataset_query does not read this field.

      • Maximum items: 20
    • conditionsarray of object

      Row-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
      • datasetstringRequired

      • columnstringRequired

      • opstringRequired

        • Allowed values: EQ, NEQ, GT, GEQ, LT, LEQ, CONTAINS, STARTS_WITH, ENDS_WITH, IS_NULL, IS_NOT_NULL
      • valuestring | number

        Required except for IS_NULL and IS_NOT_NULL.

    • returnFieldsarray of object

      Dataset fields returned by generated row-match queries. Include identity and all monitored fields.

      • Maximum items: 20
      2 properties
      • datasetstringRequired

      • columnsarray of stringRequired

        • Minimum items: 1
        • Maximum items: 1000
    • queryLanguagestring

      Language of query, read by dataset_query. Defaults to gql when omitted.

      • Allowed values: cypher, gql
      • Default: gql
    • querystring

      Authored continuous query. Required by dataset_query.

      • Maximum length: 10000
    • includeDetailsboolean

      When true, notifications include matching row details. Off by default.

    • modelobject

      Optional 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
      • modelstringRequired

        Spicepod model or worker name

      • instructionsstringRequired

        System instructions sent with each matching query result

  • targetobject

    Reaction sink. Omit to email the caller.

    3 options

    One of

    type: emailobject
    • typestringRequired

      • Value: email
    • recipientUserIdsarray of integer

      Organization members to email, by user ID.

      • Maximum items: 50
    • emailsarray of string (email)

      • Maximum items: 20
    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri)Required

      The URL each notification is sent to, using method. Must be https and must resolve to a public address.

      • Minimum length: 1
      • Maximum length: 2048
    • methodstring

      A create that omits it uses POST. An update that omits it keeps the stored method.

      • Allowed values: POST, PUT, PATCH
    • tokenstring

      Bearer token sent with each delivery. Stored encrypted and never returned.

      • Minimum length: 1
      • Maximum length: 512
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstringRequired

      Slack conversation id. The organization must already have Slack connected.

      • Minimum length: 9
      • Maximum length: 32
      • Pattern: ^[CGD][A-Z0-9]{8,31}$
    • channelNamestring

      • Minimum length: 1
      • Maximum length: 80
  • targetsarray of object

    Full destination set. When present, this replaces target and 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
    • recipientUserIdsarray of integer

      Organization members to email, by user ID.

      • Maximum items: 50
    • emailsarray of string (email)

      • Maximum items: 20
    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri)Required

      The URL each notification is sent to, using method. Must be https and must resolve to a public address.

      • Minimum length: 1
      • Maximum length: 2048
    • methodstring

      A create that omits it uses POST. An update that omits it keeps the stored method.

      • Allowed values: POST, PUT, PATCH
    • tokenstring

      Bearer token sent with each delivery. Stored encrypted and never returned.

      • Minimum length: 1
      • Maximum length: 512
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstringRequired

      Slack conversation id. The organization must already have Slack connected.

      • Minimum length: 9
      • Maximum length: 32
      • Pattern: ^[CGD][A-Z0-9]{8,31}$
    • channelNamestring

      • Minimum length: 1
      • Maximum length: 80

Responses

201Reaction createdapplication/json

A 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)Required

    Identifier of the monitor or reaction. This is the value the get, update and delete operations take.

  • org_idintegerRequired

    Organization that owns the project

  • app_idintegerRequired

    Project the monitor or reaction belongs to

  • created_byinteger | nullRequired

    User who created it, when it was created by a user credential

  • namestringRequired

    Display name, unique case-insensitively among the project's live monitors and data reactions

  • descriptionstring | nullRequired

  • kindstringRequired

    The reactions endpoints only ever return data.

    • Value: data
  • statusstringRequired

    Whether it is evaluating

    • Allowed values: active, disabled
  • template_idstringRequired

    Template it was created from

  • specobjectRequired

    Reaction parameters, normalized for the response: a reaction whose model transform is still held on target is returned with that transform copied into spec.model. Which properties are meaningful is decided by template_id. The create operation's request body lists the properties each template reads.

  • targetobjectRequired

    The primary sink (email, then slack, then http). targets is the full list. An HTTP sink's token is write-only and is never returned.

    3 options

    One of

    type: emailobject
    • typestringRequired

      • Value: email
    • recipientUserIdsarray of integer

    • emailsarray of string (email)

    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri) | ""Required

      The 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
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstring | ""Required

      The 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
  • targetsarray of objectRequired

    Every configured sink, ordered email, then slack, then http. target is 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
    • recipientUserIdsarray of integer

    • emailsarray of string (email)

    type: httpobject
    • typestringRequired

      • Value: http
    • urlstring (uri) | ""Required

      The 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
    type: slackobject
    • typestringRequired

      • Value: slack
    • channelIdstring | ""Required

      The 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
  • recipient_user_idsarray of integerRequired

    Organization 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) | nullRequired

    When it last fired, or null if it never has

  • last_resolved_atstring (date-time) | nullRequired

    When it last resolved, or null if it never has

  • created_atstring (date-time)Required

  • updated_atstring (date-time)Required

400Invalid request body or project ID

401Unauthorized

403Insufficient scope

404Project not found

409A live monitor or data reaction in this project already has this name

413Request body too large

422A required project capability or Slack connection is unavailable

500Internal server error

502Failed to provision reaction

503The project's Drasi data source is starting or unavailable

OpenAPIapi.spice.ai/openapi.json

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
    }
  }'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "org_id": 0,
  "app_id": 0,
  "created_by": 0,
  "name": "string",
  "description": "string",
  "kind": "data",
  "status": "active",
  "template_id": "string",
  "spec": {},
  "target": {
    "type": "email",
    "recipientUserIds": [
      0
    ],
    "emails": [
      "user@example.com"
    ]
  },
  "targets": [
    {
      "type": "email",
      "recipientUserIds": [
        0
      ],
      "emails": [
        "user@example.com"
      ]
    }
  ],
  "recipient_user_ids": [
    0
  ],
  "last_fired_at": "2026-01-01T00:00:00Z",
  "last_resolved_at": "2026-01-01T00:00:00Z",
  "created_at": "2026-01-01T00:00:00Z",
  "updated_at": "2026-01-01T00:00:00Z"
}

application/json