openapi: 3.0.0
info:
  title: Authentication APIs
  description: Authentication API to generate an access_token for WatchGuard 
    Public APIs
  version: v1
  contact:
    name: API Support
    url: https://www.watchguard.com/wgrd-support/contact-support
  termsOfService: 
    https://www.watchguard.com/help/docs/api/Content/en-US/license_agreement.html?cshid=18007
servers:
  - url: https://api.usa.cloud.watchguard.com
    description: Prod USA Region
  - url: https://api.deu.cloud.watchguard.com
    description: Prod DEU region
  - url: https://api.jpn.cloud.watchguard.com
    description: Prod JPN region
paths:
  /oauth/token:
    post:
      description: OAuth 2.0 Authorization Framework supported endpoint. It 
        supports the Client Credentials grant mechanism to generate an access 
        token.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Request'
      responses:
        200:
          description: access_token generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        403:
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        400:
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        415:
          description: Unsupported MediaType
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    Error:
      type: object
      properties:
        Message:
          type: string
          description: Detail error message
        Code:
          type: string
          description: Error message code
    Request:
      type: object
      properties:
        grant_type:
          type: string
          description: Grant type value for Client Credentials grant mechanism.
          enum:
            - client_credentials
        scope:
          type: string
          description: The scope of the access request. Only api-access is 
            allowed as the scope.
          enum:
            - api-access
        audience:
          type: string
          description: Audience parameter value for the specified managed 
            account
          example: cd4b2ab4526e122cc89e4894b4f05be3
      required:
        - grant_type
    Response:
      type: object
      properties:
        access_token:
          type: string
          description: access_token used for authorization of public API calls.
        token_type:
          type: string
          description: Type of the token.
          enum:
            - Bearer
        expires_in:
          type: integer
          description: Maximum validity of the access token in seconds.
          example: 3600
        scope:
          type: string
          description: The scope of the access request. Only api-access is 
            allowed as the scope.
security:
  - basicAuth: []
externalDocs:
  description: Additional documentation
  url: https://www.watchguard.com/help/docs/api/Content/en-US/home.html
