Sentry Issue Alerts API

Manage issue alert rules at the project level

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

sentry-system-issue-alerts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Sentry Alerts Issue Alerts API
  description: The Alerts API provides endpoints for managing alert rules in Sentry, including creating, retrieving, updating, and deleting metric alert rules and issue alert rules, as well as managing spike protection notification actions.
  version: 0.0.1
  contact:
    name: Sentry Support
    url: https://sentry.io/support/
    email: support@sentry.io
servers:
- url: https://sentry.io/api/0
  description: Sentry Production API
security:
- BearerAuth: []
tags:
- name: Issue Alerts
  description: Manage issue alert rules at the project level
paths:
  /projects/{organization_id_or_slug}/{project_id_or_slug}/rules/:
    get:
      operationId: listIssueAlertRules
      summary: Sentry List a project's issue alert rules
      description: Returns a list of issue alert rules for a project.
      tags:
      - Issue Alerts
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      responses:
        '200':
          description: A list of issue alert rules.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IssueAlertRule'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
    post:
      operationId: createIssueAlertRule
      summary: Sentry Create an issue alert rule for a project
      description: Creates a new issue alert rule for the given project.
      tags:
      - Issue Alerts
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - conditions
              - actions
              - actionMatch
              - frequency
              properties:
                name:
                  type: string
                  description: The name of the alert rule.
                conditions:
                  type: array
                  items:
                    type: object
                  description: The conditions for the alert to trigger.
                actions:
                  type: array
                  items:
                    type: object
                  description: The actions to perform when conditions are met.
                filters:
                  type: array
                  items:
                    type: object
                  description: Optional filters to apply.
                actionMatch:
                  type: string
                  enum:
                  - all
                  - any
                  - none
                  description: How to match conditions.
                filterMatch:
                  type: string
                  enum:
                  - all
                  - any
                  - none
                frequency:
                  type: integer
                  description: How often to trigger in minutes.
                environment:
                  type: string
                owner:
                  type: string
      responses:
        '201':
          description: Issue alert rule created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssueAlertRule'
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
  /projects/{organization_id_or_slug}/{project_id_or_slug}/rules/{rule_id}/:
    get:
      operationId: retrieveIssueAlertRule
      summary: Sentry Retrieve an issue alert rule for a project
      description: Returns a specific issue alert rule.
      tags:
      - Issue Alerts
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      - $ref: '#/components/parameters/RuleId'
      responses:
        '200':
          description: Issue alert rule details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssueAlertRule'
        '401':
          description: Unauthorized.
        '404':
          description: Alert rule not found.
    put:
      operationId: updateIssueAlertRule
      summary: Sentry Update an issue alert rule
      description: Updates an issue alert rule.
      tags:
      - Issue Alerts
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      - $ref: '#/components/parameters/RuleId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                conditions:
                  type: array
                  items:
                    type: object
                actions:
                  type: array
                  items:
                    type: object
                actionMatch:
                  type: string
                frequency:
                  type: integer
      responses:
        '200':
          description: Issue alert rule updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssueAlertRule'
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
        '404':
          description: Alert rule not found.
    delete:
      operationId: deleteIssueAlertRule
      summary: Sentry Delete an issue alert rule
      description: Deletes an issue alert rule.
      tags:
      - Issue Alerts
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      - $ref: '#/components/parameters/RuleId'
      responses:
        '204':
          description: Alert rule deleted.
        '401':
          description: Unauthorized.
        '404':
          description: Alert rule not found.
components:
  parameters:
    OrganizationIdOrSlug:
      name: organization_id_or_slug
      in: path
      required: true
      description: The ID or slug of the organization.
      schema:
        type: string
    RuleId:
      name: rule_id
      in: path
      required: true
      description: The ID of the issue alert rule.
      schema:
        type: integer
    ProjectIdOrSlug:
      name: project_id_or_slug
      in: path
      required: true
      description: The ID or slug of the project.
      schema:
        type: string
  schemas:
    IssueAlertRule:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        conditions:
          type: array
          items:
            type: object
        actions:
          type: array
          items:
            type: object
        filters:
          type: array
          items:
            type: object
        actionMatch:
          type: string
        filterMatch:
          type: string
        frequency:
          type: integer
        environment:
          type: string
          nullable: true
        owner:
          type: string
          nullable: true
        dateCreated:
          type: string
          format: date-time
      required:
      - id
      - name
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authentication token for the Sentry API.