Sentry Environments API

Manage project and organization environments

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

sentry-system-environments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Sentry Alerts Environments 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: Environments
  description: Manage project and organization environments
paths:
  /organizations/{organization_id_or_slug}/environments/:
    get:
      operationId: listOrganizationEnvironments
      summary: Sentry List an organization's environments
      description: Returns a list of environments for the given organization.
      tags:
      - Environments
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      responses:
        '200':
          description: A list of environments.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Environment'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
  /projects/{organization_id_or_slug}/{project_id_or_slug}/environments/:
    get:
      operationId: listProjectEnvironments
      summary: Sentry List a project's environments
      description: Returns a list of environments for the given project.
      tags:
      - Environments
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      responses:
        '200':
          description: A list of environments.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Environment'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Project not found.
  /projects/{organization_id_or_slug}/{project_id_or_slug}/environments/{environment}/:
    get:
      operationId: retrieveProjectEnvironment
      summary: Sentry Retrieve a project environment
      description: Returns details for a specific project environment.
      tags:
      - Environments
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      - $ref: '#/components/parameters/EnvironmentName'
      responses:
        '200':
          description: Environment details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '401':
          description: Unauthorized.
        '404':
          description: Environment not found.
    put:
      operationId: updateProjectEnvironment
      summary: Sentry Update a project environment
      description: Updates settings for a project environment.
      tags:
      - Environments
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - $ref: '#/components/parameters/ProjectIdOrSlug'
      - $ref: '#/components/parameters/EnvironmentName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isHidden:
                  type: boolean
                  description: Whether the environment is hidden.
      responses:
        '200':
          description: Environment updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
        '404':
          description: Environment not found.
components:
  parameters:
    EnvironmentName:
      name: environment
      in: path
      required: true
      description: The name of the environment.
      schema:
        type: string
    ProjectIdOrSlug:
      name: project_id_or_slug
      in: path
      required: true
      description: The ID or slug of the project.
      schema:
        type: string
    OrganizationIdOrSlug:
      name: organization_id_or_slug
      in: path
      required: true
      description: The ID or slug of the organization.
      schema:
        type: string
  schemas:
    Environment:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        isHidden:
          type: boolean
        dateCreated:
          type: string
          format: date-time
      required:
      - id
      - name
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authentication token for the Sentry API.