Management APIs / Monitors

Update a project monitor

PATCHhttps://api.spice.ai/v1/projects/{projectId}/monitors/{alertId}

Updates a project monitor. Requires monitors:write and organization admin privileges.

Authorizations

  • AuthorizationstringRequired

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

Path parameters

  • projectIdintegerRequired

  • alertIdstring (uuid)Required

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

  • namestring

    • Minimum length: 1
    • Maximum length: 100
  • descriptionstring | null

    • Maximum length: 500
  • statusstring

    • Allowed values: active, disabled
  • templateIdstring

  • specobject

  • targetobject

    Omit to keep the existing destination.

    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
  • recipientUserIdsarray of integer

Responses

200Monitor updated

400Invalid request or monitor ID

401Unauthorized

403Insufficient scope or role

404Project or monitor not found

409Duplicate monitor name or monitor changed during update

413Request body too large

422Destination is unavailable or project configuration is incomplete

500Internal server error

502Monitor backend update failed

curl -X PATCH "https://api.spice.ai/v1/projects/<projectId>/monitors/<alertId>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "description": "string",
    "status": "active",
    "templateId": "string",
    "spec": {},
    "target": {
      "type": "email"
    },
    "recipientUserIds": [
      0
    ]
  }'

No response body

PATCHhttps://api.spice.ai/v1/orgs/{orgId}/projects/{projectId}/monitors/{alertId}

The org is orgId in the path. Updates a project monitor. Requires monitors:write and organization admin privileges.

Authorizations

  • AuthorizationstringRequired

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

Path parameters

  • orgIdintegerRequired

    The org id from GET /v1/orgs

    • Minimum: 1
  • projectIdintegerRequired

  • alertIdstring (uuid)Required

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

  • namestring

    • Minimum length: 1
    • Maximum length: 100
  • descriptionstring | null

    • Maximum length: 500
  • statusstring

    • Allowed values: active, disabled
  • templateIdstring

  • specobject

  • targetobject

    Omit to keep the existing destination.

    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
  • recipientUserIdsarray of integer

Responses

200Monitor updated

400Bad Request

Invalid request or monitor ID. orgId is not a valid org id (invalid_org_id), or X-Org-Name does not name that org (org_path_mismatch).

401Unauthorized

403Forbidden

Insufficient scope or role. The caller is not a member of the org (org_forbidden). A machine credential named a different org (org_assertion_mismatch). The org is deleted (org_deleted).

404Project or monitor not found

409Duplicate monitor name or monitor changed during update

413Request body too large

422Destination is unavailable or project configuration is incomplete

500Internal server error

502Monitor backend update failed

curl -X PATCH "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/monitors/<alertId>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "description": "string",
    "status": "active",
    "templateId": "string",
    "spec": {},
    "target": {
      "type": "email"
    },
    "recipientUserIds": [
      0
    ]
  }'

No response body

PATCHhttps://api.spice.ai/v1/apps/{appId}/monitors/{alertId}Deprecated

Legacy alias of /v1/projects/{projectId}/monitors/{alertId} — projects were previously called apps. Updates a project monitor. Requires monitors:write and organization admin privileges.

Authorizations

  • AuthorizationstringRequired

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

Path parameters

  • appIdintegerRequired

  • alertIdstring (uuid)Required

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

  • namestring

    • Minimum length: 1
    • Maximum length: 100
  • descriptionstring | null

    • Maximum length: 500
  • statusstring

    • Allowed values: active, disabled
  • templateIdstring

  • specobject

  • targetobject

    Omit to keep the existing destination.

    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
  • recipientUserIdsarray of integer

Responses

200Monitor updated

400Invalid request or monitor ID

401Unauthorized

403Insufficient scope or role

404Project or monitor not found

409Duplicate monitor name or monitor changed during update

413Request body too large

422Destination is unavailable or project configuration is incomplete

500Internal server error

502Monitor backend update failed

OpenAPIapi.spice.ai/openapi.json

curl -X PATCH "https://api.spice.ai/v1/apps/<appId>/monitors/<alertId>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "description": "string",
    "status": "active",
    "templateId": "string",
    "spec": {},
    "target": {
      "type": "email"
    },
    "recipientUserIds": [
      0
    ]
  }'

No response body