Sentry Tokens API

Manage repository upload tokens

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

sentry-system-tokens-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Sentry Alerts Tokens 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: Tokens
  description: Manage repository upload tokens
paths:
  /organizations/{organization_id_or_slug}/prevent/tokens/:
    get:
      operationId: listRepositoryTokens
      summary: Sentry Retrieve a paginated list of repository tokens for a given owner
      description: Returns repository upload tokens.
      tags:
      - Tokens
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      - name: cursor
        in: query
        description: Pagination cursor.
        schema:
          type: string
      responses:
        '200':
          description: A list of tokens.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    token:
                      type: string
                    repositoryId:
                      type: string
                    dateCreated:
                      type: string
                      format: date-time
        '401':
          description: Unauthorized.
  /organizations/{organization_id_or_slug}/prevent/tokens/regenerate/:
    post:
      operationId: regenerateToken
      summary: Sentry Regenerate a repository upload token and return the new token
      description: Regenerates a repository upload token.
      tags:
      - Tokens
      parameters:
      - $ref: '#/components/parameters/OrganizationIdOrSlug'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - repositoryId
              properties:
                repositoryId:
                  type: string
                  description: The ID of the repository to regenerate the token for.
      responses:
        '200':
          description: New token generated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
        '401':
          description: Unauthorized.
        '404':
          description: Repository 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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authentication token for the Sentry API.