openapi: 3.1.0 info: title: Sentry Crons API description: >- The Crons API provides endpoints for managing cron job monitors in Sentry, including creating, retrieving, updating, and deleting monitors, managing monitor environments, and retrieving check-in history for tracked scheduled tasks. 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: Check-Ins description: View monitor check-in history - name: Monitors description: Manage cron job monitors paths: /organizations/{organization_id_or_slug}/monitors/: get: operationId: listOrganizationMonitors summary: Sentry Retrieve monitors for an organization description: Returns a list of monitors for the given organization. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - name: cursor in: query description: Pagination cursor. schema: type: string - name: environment in: query description: Filter by environment name. schema: type: string responses: '200': description: A list of monitors. content: application/json: schema: type: array items: $ref: '#/components/schemas/Monitor' '401': description: Unauthorized. '403': description: Forbidden. post: operationId: createMonitor summary: Sentry Create a monitor description: Creates a new monitor for the given organization. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' requestBody: required: true content: application/json: schema: type: object required: - name - type - config properties: name: type: string description: The name of the monitor. slug: type: string description: The slug for the monitor. type: type: string enum: - cron_job description: The type of monitor. config: type: object required: - schedule_type - schedule properties: schedule_type: type: string enum: - crontab - interval schedule: oneOf: - type: string description: Crontab expression. - type: array items: type: integer description: Interval value and unit. checkin_margin: type: integer description: Margin of minutes before a check-in is marked as missed. max_runtime: type: integer description: Max runtime in minutes before a check-in is marked as timed out. timezone: type: string description: The timezone for the schedule. project: type: string description: The project slug. responses: '201': description: Monitor created. content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Bad request. '401': description: Unauthorized. '403': description: Forbidden. /organizations/{organization_id_or_slug}/monitors/{monitor_id_or_slug}/: get: operationId: retrieveMonitor summary: Sentry Retrieve a monitor description: Returns details for a specific monitor. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' responses: '200': description: Monitor details. content: application/json: schema: $ref: '#/components/schemas/Monitor' '401': description: Unauthorized. '404': description: Monitor not found. put: operationId: updateMonitor summary: Sentry Update a monitor description: Updates a monitor. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' requestBody: required: true content: application/json: schema: type: object properties: name: type: string slug: type: string config: type: object properties: schedule_type: type: string schedule: oneOf: - type: string - type: array items: type: integer checkin_margin: type: integer max_runtime: type: integer timezone: type: string responses: '200': description: Monitor updated. content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Bad request. '401': description: Unauthorized. '404': description: Monitor not found. delete: operationId: deleteMonitor summary: Sentry Delete a monitor or monitor environments description: >- Deletes a monitor or specific monitor environments. Use the environment query parameter to selectively delete environments. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' - name: environment in: query description: Specific environment to delete rather than the entire monitor. schema: type: string responses: '202': description: Monitor or environment scheduled for deletion. '401': description: Unauthorized. '404': description: Monitor not found. /organizations/{organization_id_or_slug}/monitors/{monitor_id_or_slug}/checkins/: get: operationId: listMonitorCheckIns summary: Sentry Retrieve check-ins for a monitor description: Returns a list of check-ins for a specific monitor. tags: - Check-Ins parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' - name: cursor in: query description: Pagination cursor. schema: type: string responses: '200': description: A list of check-ins. content: application/json: schema: type: array items: $ref: '#/components/schemas/CheckIn' '401': description: Unauthorized. '404': description: Monitor not found. /projects/{organization_id_or_slug}/{project_id_or_slug}/monitors/{monitor_id_or_slug}/: get: operationId: retrieveMonitorForProject summary: Sentry Retrieve a monitor for a project description: Returns a monitor scoped to a specific project. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' responses: '200': description: Monitor details. content: application/json: schema: $ref: '#/components/schemas/Monitor' '401': description: Unauthorized. '404': description: Monitor not found. put: operationId: updateMonitorForProject summary: Sentry Update a monitor for a project description: Updates a monitor scoped to a specific project. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' requestBody: required: true content: application/json: schema: type: object properties: name: type: string config: type: object responses: '200': description: Monitor updated. content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Bad request. '401': description: Unauthorized. '404': description: Monitor not found. delete: operationId: deleteMonitorForProject summary: Sentry Delete a monitor or monitor environments for a project description: Deletes a monitor or its environments scoped to a project. tags: - Monitors parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' - name: environment in: query description: Specific environment to delete. schema: type: string responses: '202': description: Monitor or environment scheduled for deletion. '401': description: Unauthorized. '404': description: Monitor not found. /projects/{organization_id_or_slug}/{project_id_or_slug}/monitors/{monitor_id_or_slug}/checkins/: get: operationId: listMonitorCheckInsForProject summary: Sentry Retrieve check-ins for a monitor by project description: Returns a list of check-ins for a monitor scoped to a project. tags: - Check-Ins parameters: - $ref: '#/components/parameters/OrganizationIdOrSlug' - $ref: '#/components/parameters/ProjectIdOrSlug' - $ref: '#/components/parameters/MonitorIdOrSlug' - name: cursor in: query description: Pagination cursor. schema: type: string responses: '200': description: A list of check-ins. content: application/json: schema: type: array items: $ref: '#/components/schemas/CheckIn' '401': description: Unauthorized. '404': description: Monitor not found. components: securitySchemes: BearerAuth: type: http scheme: bearer description: Authentication token for the Sentry API. 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 MonitorIdOrSlug: name: monitor_id_or_slug in: path required: true description: The ID or slug of the monitor. schema: type: string schemas: Monitor: type: object properties: id: type: string slug: type: string name: type: string type: type: string config: type: object properties: schedule_type: type: string schedule: oneOf: - type: string - type: array items: type: integer checkin_margin: type: integer nullable: true max_runtime: type: integer nullable: true timezone: type: string status: type: string dateCreated: type: string format: date-time project: type: object properties: id: type: string slug: type: string name: type: string environments: type: array items: type: object properties: name: type: string status: type: string lastCheckIn: type: string format: date-time nullable: true nextCheckIn: type: string format: date-time nullable: true required: - id - name - type - config CheckIn: type: object properties: id: type: string status: type: string enum: - ok - error - in_progress - missed - timeout duration: type: integer nullable: true description: Duration in milliseconds. dateCreated: type: string format: date-time environment: type: string required: - id - status - dateCreated