openapi: 3.0.1
info:
  title: Cisco Umbrella Token Authorization API
  version: 2.0.0
  description: Create Umbrella access tokens.
  contact:
    name: Cloud Security Developer Community
servers:
  - url: https://api.umbrella.com/{basePath}
    variables:
      basePath:
        default: auth/v2
tags:
 - name: Token
 - name: Umbrella
security:
  - http: []
paths:
  '/token':
    post:
      operationId: createAuthToken
      tags:
        - Token
        - Umbrella
      description: Create an authorization token.
      summary: Create Authorization Token
      requestBody:
        content:
            application/x-www-form-urlencoded:
              schema:
                type: object
                description: The authentication information that is required to create an access token.
                required:
                  - grant_type
                properties:
                  grant_type:
                    type: string
                    enum:
                      - client_credentials
                    description: The type of client grant type.
                    example: client_credentials
              example:
                grant_type: client_credentials
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
              example:
                token_type: bearer
                access_token: xxxxxx
                expires_in: 3600
        '400':
          $ref: '#/components/responses/400Error'
        '401':
          $ref: '#/components/responses/401Error'
        '403':
          $ref: '#/components/responses/403Error'
        '404':
          $ref: '#/components/responses/404Error'
        '500':
          $ref: '#/components/responses/500Error'

components:
  securitySchemes:
    http:
      type: http
      scheme: basic

  schemas:
    Token:
      type: object
      properties:
        token_type:
          type: string
          description: The type of token.
          example: bearer
        access_token:
          type: string
          description: The access token.
          example: xxxxxxx
        expires_in:
          type: integer
          description: The number of seconds in which the token expires.
          example: 3600
      required: [token_type, access_token, expires_in]
      example:
        token_type: bearer
        access_token: bearer access token
        expires_in: 3600

  responses:
    400Error:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    401Error:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    403Error:
      description: Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    404Error:
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    500Error:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
