openapi: 3.1.0 info: title: Sentry Alerts Service Hooks 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: Service Hooks description: Manage project service hooks paths: /projects/{organization_id_or_slug}/{project_id_or_slug}/hooks/: get: operationId: listProjectServiceHooks summary: Sentry List a project's service hooks description: Returns a list of service hooks bound to a project. tags: - Service Hooks parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - name: cursor in: query description: Pagination cursor. schema: type: string responses: '200': description: A list of service hooks. content: application/json: schema: type: array items: $ref: '#/components/schemas/ServiceHook' '401': description: Unauthorized. '403': description: Forbidden. post: operationId: createProjectServiceHook summary: Sentry Register a new service hook description: Creates a new service hook for a project. tags: - Service Hooks parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' requestBody: required: true content: application/json: schema: type: object required: - url - events properties: url: type: string format: uri description: The URL to send webhook events to. events: type: array items: type: string description: The events to subscribe to. responses: '201': description: Service hook created. content: application/json: schema: $ref: '#/components/schemas/ServiceHook' '400': description: Bad request. '401': description: Unauthorized. '403': description: Forbidden. /projects/{organization_id_or_slug}/{project_id_or_slug}/hooks/{hook_id}/: get: operationId: retrieveProjectServiceHook summary: Sentry Retrieve a service hook description: Returns a service hook bound to a project. tags: - Service Hooks parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - $ref: '#/components/parameters/HookId' responses: '200': description: Service hook details. content: application/json: schema: $ref: '#/components/schemas/ServiceHook' '401': description: Unauthorized. '404': description: Service hook not found. put: operationId: updateProjectServiceHook summary: Sentry Update a service hook description: Updates a service hook. tags: - Service Hooks parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - $ref: '#/components/parameters/HookId' requestBody: required: true content: application/json: schema: type: object properties: url: type: string format: uri events: type: array items: type: string responses: '200': description: Service hook updated. content: application/json: schema: $ref: '#/components/schemas/ServiceHook' '400': description: Bad request. '401': description: Unauthorized. '404': description: Service hook not found. delete: operationId: deleteProjectServiceHook summary: Sentry Remove a service hook description: Removes a service hook from a project. tags: - Service Hooks parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - $ref: '#/components/parameters/HookId' responses: '204': description: Service hook removed. '401': description: Unauthorized. '404': description: Service hook 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 ProjectIdOrSlug: name: project_id_or_slug in: path required: true description: The ID or slug of the project. schema: type: string HookId: name: hook_id in: path required: true description: The ID of the service hook. schema: type: string schemas: ServiceHook: type: object properties: id: type: string url: type: string format: uri secret: type: string status: type: string events: type: array items: type: string dateCreated: type: string format: date-time required: - id - url - events securitySchemes: BearerAuth: type: http scheme: bearer description: Authentication token for the Sentry API.