openapi: 3.0.2
info:
  title: Security API
  version: '4.0'
  x-logo:
    url: https://dataservices-docs.segmint.net/images/segmint-logo.png
  description: 'The security API for authentication with the rest of the Segmint Marketing
    API'
servers:
- url: https://api.segmint.net/v4/security
  description: The production environment
- url: https://api-stage.segmint.net/v4/security
  description: The staging environment
tags:
- name: Token
  description: Get an Authorization Token
components:
  responses:
    unexpected_error:
      description: An unexpected error occurred. Please try again later. If the problem
        persists please contact us.
    unauthorized:
      description: The request was not authorized. The bearer token may have been
        missing or expired.
    forbidden:
      description: You do not have permission to use this endpoint.
  securitySchemes:
    Basic:
      type: http
      scheme: basic
      description: Basic auth using your `client_id` and `secret`.
security:
- Basic: []
paths:
  "/oauth/token":
    post:
      summary: Get an authorization token.
      description: |- 
        Authenticate with the API and get an authorization token.
        ### <span style="color:var(--red)">Fields marked with an * are required. </span>
      tags:
      - Token
      parameters:
      - in: query
        required: true
        name: grant_type
        schema:
          type: string
          enum:
          - client_credentials
          example: client_credentials
      responses:
        '200':
          description: Successful authentication with the API.
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    description: The access token used to access the rest of the API.
                  expires_in:
                    type: string
                    description: The number of seconds in which this token will expire
                  token_type:
                    type: string
                  scope:
                    type: string
        '400':
          description: Bad Request.
        '401':
          description: The Authorize header is missing or your client id and secret
            are wrong.
        '404':
          description: The endpoint is not found. Likely the url is wrong.
        '500':
          description: Server error.
