---
title: "Update a data reaction"
method: PATCH
path: "/v1/apps/{appId}/reactions/{alertId}"
tags: ["Reactions"]
deprecated: true
---

# Update a data reaction

`PATCH /v1/apps/{appId}/reactions/{alertId}`

## Request

- Base URL: `https://api.spice.ai`
- URL: `https://api.spice.ai/v1/apps/{appId}/reactions/{alertId}`
- Auth: HTTP bearer

> **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

- `appId` integer, required
- `alertId` string, uuid, required

## Headers

- `X-Org-Name` string

## Request body

- object
  - `name` string
  - `description` string, nullable
  - `status` 'active' | 'disabled'
  - `templateId` string
  - `spec` object
  - `target` union: A notification sink in a create or update request. Cluster monitors, project monitors and data reactions accept the same shape.
    - EmailSinkInput
      - `type` 'email', required
      - `recipientUserIds` integer[]: Organization members to email, by user ID.
      - `emails` string[]
    - HttpSinkInput
      - `type` 'http', required
      - `url` string, uri, required: The URL each notification is sent to, using `method`. Must be https and must resolve to a public address.
      - `method` 'POST' | 'PUT' | 'PATCH': A create that omits it uses POST. An update that omits it keeps the stored method.
      - `token` string: Bearer token sent with each delivery. Stored encrypted and never returned.
    - SlackSinkInput
      - `type` 'slack', required
      - `channelId` string, required: Slack conversation id. The organization must already have Slack connected.
      - `channelName` string
  - `targets` ClusterMonitorTarget[]
    - union: A notification sink in a create or update request. Cluster monitors, project monitors and data reactions accept the same shape.
      - EmailSinkInput
        - `type` 'email', required
        - `recipientUserIds` integer[]: Organization members to email, by user ID.
        - `emails` string[]
      - HttpSinkInput
        - `type` 'http', required
        - `url` string, uri, required: The URL each notification is sent to, using `method`. Must be https and must resolve to a public address.
        - `method` 'POST' | 'PUT' | 'PATCH': A create that omits it uses POST. An update that omits it keeps the stored method.
        - `token` string: Bearer token sent with each delivery. Stored encrypted and never returned.
      - SlackSinkInput
        - `type` 'slack', required
        - `channelId` string, required: Slack conversation id. The organization must already have Slack connected.
        - `channelName` string
  - `recipientUserIds` integer[]

## Response `200`

Reaction updated

- Reaction: The fields a project monitor and a data reaction share. `Reaction` and `ProjectMonitor` each narrow `kind` and describe their own `spec`.
  - `id` string, uuid, required: Identifier of the monitor or reaction. This is the value the get, update and delete operations take.
  - `org_id` integer, required: Organization that owns the project
  - `app_id` integer, required: Project the monitor or reaction belongs to
  - `created_by` integer, nullable, required: User who created it, when it was created by a user credential
  - `name` string, required: Display name, unique case-insensitively among the project's live monitors and data reactions
  - `description` string, nullable, required
  - `kind` 'data', required: The reactions endpoints only ever return `data`.
  - `status` 'active' | 'disabled', required: Whether it is evaluating
  - `template_id` string, required: Template it was created from
  - `spec` object, required: 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.
  - `target` union, required: A configured sink. An HTTP bearer token is never returned.
    - EmailSinkView
      - `type` 'email', required
      - `recipientUserIds` integer[]
      - `emails` string[]
    - HttpSinkView
      - `type` 'http', required
      - `url` union, required: The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
        - string, uri
        - ''
      - `method` 'POST' | 'PUT' | 'PATCH'
    - SlackSinkView
      - `type` 'slack', required
      - `channelId` union, required: The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
        - string
        - ''
      - `channelName` string
  - `targets` ReactionSinkView[], required: Every configured sink, ordered email, then slack, then http. `target` is the first of these. An HTTP sink's token is never returned.
    - union: A configured sink. An HTTP bearer token is never returned.
      - EmailSinkView
        - `type` 'email', required
        - `recipientUserIds` integer[]
        - `emails` string[]
      - HttpSinkView
        - `type` 'http', required
        - `url` union, required: The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
          - string, uri
          - ''
        - `method` 'POST' | 'PUT' | 'PATCH'
      - SlackSinkView
        - `type` 'slack', required
        - `channelId` union, required: The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
          - string
          - ''
        - `channelName` string
  - `recipient_user_ids` integer[], required: 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_at` string, date-time, nullable, required: When it last fired, or null if it never has
  - `last_resolved_at` string, date-time, nullable, required: When it last resolved, or null if it never has
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Invalid request, specification, or dataset
- `401`: Unauthorized
- `403`: Insufficient scope or organization membership
- `404`: Project or reaction not found
- `409`: Name conflict or concurrent update
- `413`: Request body too large
- `422`: Project configuration is incomplete
- `429`: Another update is in progress for this reaction
- `500`: Internal server error
- `502`: Drasi update failed
- `503`: The project's Drasi data source or lock store is unavailable

---

[API](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api.md) - [All operations](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/revisions/5f3b75dd847d?raw)
