# Token

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /auth/token:
    post:
      summary: Token
      deprecated: false
      description: >-
        Authenticates a partner using API key and secret, returning a
        short-lived bearer token scoped to allowed operations.
      tags:
        - Vrtx APIs/Auth
        - Auth
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                  enum:
                    - client_credentials
                  examples:
                    - client_credentials
                client_id:
                  type: string
                  minLength: 1
                  examples:
                    - partner-sandbox
                client_secret:
                  type: string
                  minLength: 1
                  examples:
                    - 1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
                scope:
                  type: string
                  examples:
                    - write read
              required:
                - grant_type
                - client_id
                - client_secret
              x-apidog-orders:
                - grant_type
                - client_id
                - client_secret
                - scope
            example:
              grant_type: client_credentials
              client_id: partner-sandbox
              client_secret: 1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
              scope: write read
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    minLength: 1
                  token_type:
                    type: string
                    default: Bearer
                  expires_in:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                  scope:
                    type: string
                  issued_at:
                    type: integer
                    minimum: 0
                required:
                  - access_token
                  - token_type
                  - expires_in
                  - issued_at
                x-apidog-orders:
                  - access_token
                  - token_type
                  - expires_in
                  - scope
                  - issued_at
          headers: {}
          x-apidog-name: OK
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INVALID_INPUT
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - FORBIDDEN
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: FORBIDDEN
                error_message: Access forbidden
                details: []
                status_code: 403
          headers: {}
          x-apidog-name: Forbidden
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - NOT_FOUND
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: NOT_FOUND
                error_message: Resource not found
                details: []
                status_code: 404
          headers: {}
          x-apidog-name: Not Found
        '405':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INVALID_INPUT
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: INVALID_INPUT
                error_message: Input validation failed
                details: []
                status_code: 405
          headers: {}
          x-apidog-name: Method Not Allowed
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - CONFLICT
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: CONFLICT
                error_message: Resource conflict
                details: []
                status_code: 409
          headers: {}
          x-apidog-name: Conflict
        '410':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - NOT_FOUND
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: NOT_FOUND
                error_message: Resource not found
                details: []
                status_code: 410
          headers: {}
          x-apidog-name: Gone
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INVALID_INPUT
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: INVALID_INPUT
                error_message: Input validation failed
                details:
                  - field_name: amount
                    description: Amount must be greater than zero
                    code: VALIDATION_ERROR
                status_code: 422
          headers: {}
          x-apidog-name: Unprocessable Entity
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - RATE_LIMITED
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: RATE_LIMITED
                error_message: Too many requests
                details: []
                status_code: 429
          headers: {}
          x-apidog-name: Too Many Requests
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INTERNAL_ERROR
                      - EXTERNAL_SERVICE_ERROR
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              examples:
                example1:
                  summary: example1
                  value:
                    error_code: INTERNAL_ERROR
                    error_message: An internal server error occurred
                    details: []
                    status_code: 500
                example2:
                  summary: example2
                  value:
                    error_code: EXTERNAL_SERVICE_ERROR
                    error_message: An external service error occurred
                    details: []
                    status_code: 500
          headers: {}
          x-apidog-name: Internal Server Error
        '501':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INTERNAL_ERROR
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: INTERNAL_ERROR
                error_message: An internal server error occurred
                details: []
                status_code: 501
          headers: {}
          x-apidog-name: Not Implemented
        '503':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - SERVICE_UNAVAILABLE
                      - EXTERNAL_SERVICE_ERROR
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
          headers: {}
          x-apidog-name: Service Unavailable
        '504':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - EXTERNAL_SERVICE_ERROR
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: EXTERNAL_SERVICE_ERROR
                error_message: An external service error occurred
                details: []
                status_code: 504
          headers: {}
          x-apidog-name: Gateway Timeout
        '505':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - UNSUPPORTED_VERSION
                  error_message:
                    type: string
                  details:
                    type: array
                    items:
                      type: string
                  status_code:
                    type: number
                required:
                  - error_code
                  - error_message
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: UNSUPPORTED_VERSION
                error_message: An internal server error occurred
                details: []
                status_code: 500
          headers: {}
          x-apidog-name: HTTP Version Not Supported
      security:
        - bearer: []
      x-apidog-folder: Vrtx APIs/Auth
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1053095/apis/api-24712037-run
components:
  schemas: {}
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth1:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
    bearerAuth2:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth3:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT issued by Keycloak. The client_id/azp in the token must map to a
        configured tenant (public, fai, neomrs; e.g., fai-sandbox -> fai) or
        requests will return 403.
    bearerAuth4:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.sandbox.vrtx.sa
    description: Sandbox
security:
  - bearer: []

```
