---
openapi: 3.0.3
info:
  title: OmaxTelecom Auth API
  version: 1.0.0
  description: |-
    Shared platform authentication for OmaxTelecom APIs.

    ## Quick Start

    1. Get your `client_id` and `client_secret` from [OmaxTelecom Console](https://console.omaxtelecom.com)
    2. Run **Auth → Get Access Token** to obtain a Bearer token
    3. Use the `access_token` in the `Authorization` header on Phone Validation, Number Lookup, MCC-MNC, Bappy, Telkor, and other partner APIs

    ## Authentication (OAuth 2.0)

    This API uses the **OAuth 2.0 Client Credentials** grant type ([RFC 6749 §4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)).

    **Token endpoint:**

    ```
    POST https://api.omaxtelecom.com/auth/token
    ```
servers:
- url: https://api.omaxtelecom.com
  description: OmaxTelecom platform
tags:
- name: Auth
  description: >-
    OAuth 2.0 authentication using the **Client Credentials** grant type ([RFC
    6749 §4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)).
    Use your **Client ID** and **Client Secret** from
    [OmaxTelecom Console](https://console.omaxtelecom.com) to obtain an access token.
paths:
  /auth/token:
    servers:
    - url: https://api.omaxtelecom.com
    post:
      tags:
      - Auth
      summary: Get Access Token
      description: |-
        ## Get Access Token

        Obtain a Bearer access token using the OAuth 2.0 **Client Credentials** grant ([RFC 6749 §4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)).

        ### Setup

        1. Get your `client_id` from [OmaxTelecom Console](https://console.omaxtelecom.com)
        2. Get your `client_secret` from [OmaxTelecom Console](https://console.omaxtelecom.com)

        ### Request

        ```
        POST https://api.omaxtelecom.com/auth/token
        Content-Type: application/x-www-form-urlencoded

        grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}
        ```

        ### Response (200 OK)

        ```json
        {
          "access_token": "eyJhbGciOiJSUzI1NiIs...",
          "expires_in": 300,
          "token_type": "Bearer",
          "scope": "openid"
        }
        ```

        ### Token Usage

        Include the token in the `Authorization` header:

        ```
        Authorization: Bearer {access_token}
        ```
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              properties:
                grant_type:
                  type: string
                  description: OAuth 2.0 grant type (RFC 6749 §4.4)
                  example: client_credentials
                client_id:
                  type: string
                  description: Your Client ID
                  example: '{{client_id}}'
                client_secret:
                  type: string
                  description: Your Client Secret
                  example: '{{client_secret}}'
      security:
      - noauthAuth: []
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/x-www-form-urlencoded
      - name: Accept
        in: header
        schema:
          type: string
        example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
components:
  securitySchemes:
    noauthAuth:
      type: http
      scheme: noauth
