> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.fax.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Get token information

> Returns metadata about the current access token including type, scopes, expiration date, and PAT-specific information if applicable. For PAT tokens, returns full metadata (id, name, preview, created/expiration dates, last used). For OAuth tokens, returns token type and scopes only.

<RequestExample>
  ```js NodeJS SDK theme={null}
  const axios = require('axios');
  const AuthenticationApiFp = require('@alohi/faxplus-api').AuthenticationApiFp;
  const Configuration = require('@alohi/faxplus-api').Configuration;

  const config = new Configuration({
      accessToken: accessToken,
      basePath: 'https://restapi.fax.plus/v3'
  });

  async function getTokenInfo() {
      const req = await AuthenticationApiFp(config).getTokenInfo();
      const resp = await req(axios);
      console.log(resp.data);
  }

  getTokenInfo()
  ```

  ```python Python SDK theme={null}
  from faxplus import ApiClient, AuthenticationApi
  from faxplus.configuration import Configuration

  conf = Configuration()
  conf.access_token = access_token
  api_client = ApiClient(configuration=conf)
  api = AuthenticationApi(api_client)
  resp = api.get_token_info()
  print(resp)
  ```

  ```java Java theme={null}
  /**
   * Example below uses Apache HTTP Client 4 with Fluent API
   **/

  String url = "https://restapi.fax.plus/v3/auth/token";

  String result = Request
      .Get(url)
      .addHeader("Accept", "application/json")
      .addHeader("Authorization", "Bearer {access-token}")
      .execute()
      .returnContent().asString();

  System.out.println(result.toString());
  ```

  ```go Go theme={null}
  package main

  import (
         "bytes"
         "net/http"
  )

  func main() {

      headers := map[string][]string{
          "Accept": []string{"application/json"},
          "Authorization": []string{"Bearer {access-token}"}
      }

      data := bytes.NewBuffer([]byte{jsonReq})
      req, err := http.NewRequest("GET", "https://restapi.fax.plus/v3/auth/token", data)
      req.Header = headers

      client := &http.Client{}
      resp, err := client.Do(req)
      // ...
  }
  ```

  ```php PHP theme={null}
  <?php

  require 'vendor/autoload.php';

  $headers = array(
      'Accept' => 'application/json',
      'Authorization' => 'Bearer {access-token}'
  );

  $client = new GuzzleHttp\Client();

  try {
      $response = $client->request('GET','https://restapi.fax.plus/v3/auth/token', array(
          'headers' => $headers,
          )
      );
      print_r($response->getBody()->getContents());
   }
   catch (GuzzleHttp\Exception\BadResponseException $e) {
      // handle exception or api errors.
      print_r($e->getMessage());
   }

   // ...
  ```

  ```bash cURL theme={null}
  # You can also use wget
  curl -X GET https://restapi.fax.plus/v3/auth/token \
    -H 'Accept: application/json'  \
    -H 'Authorization: Bearer {access-token}'
  ```
</RequestExample>


## OpenAPI

````yaml get /auth/token
openapi: 3.0.1
info:
  title: Fax.Plus REST API
  description: >-
    This is the Fax.Plus API v3 developed for third party developers and
    organizations. In order to have a better coding experience with this API,
    let's quickly go through some points:<br /><br /> - This API assumes
    **/accounts** as an entry point with the base url of
    **https://restapi.fax.plus/v3**. <br /><br /> - This API treats all date and
    times sent to it in requests as **UTC**. Also, all dates and times returned
    in responses are in **UTC**<br /><br /> - Once you have an access_token, you
    can easily send a request to the resource server with the base url of
    **https://restapi.fax.plus/v3** to access your permitted resources. As an
    example to get the user's profile info you would send a request to
    **https://restapi.fax.plus/v3/accounts/self** when **Authorization** header
    is set to **Bearer YOUR_ACCESS_TOKEN** and custom header of
    **x-fax-clientid** is set to YOUR_CLIENT_ID
  version: 3.4.0
  contact:
    name: Fax.Plus
    email: info@fax.plus
    url: https://github.com/alohi
servers:
  - url: https://restapi.fax.plus/v3
  - url: /v3
security: []
paths:
  /auth/token:
    get:
      tags:
        - Authentication
      summary: Get token information
      description: >-
        Returns metadata about the current access token including type, scopes,
        expiration date, and PAT-specific information if applicable. For PAT
        tokens, returns full metadata (id, name, preview, created/expiration
        dates, last used). For OAuth tokens, returns token type and scopes only.
      operationId: getTokenInfo
      responses:
        '200':
          description: Token information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenInfo'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - oauth2: []
        - personal_access_token: []
components:
  schemas:
    TokenInfo:
      type: object
      properties:
        token_type:
          type: string
          enum:
            - pat
            - oauth
          description: Type of the token
        scopes:
          type: array
          items:
            type: string
          description: List of scopes granted to this token
        id:
          type: string
          nullable: true
          description: Token ID (PAT only)
        name:
          type: string
          nullable: true
          description: Token name (PAT only)
        preview:
          type: string
          nullable: true
          description: Token preview string (PAT only)
        created_date:
          type: integer
          format: int64
          nullable: true
          description: Creation timestamp in milliseconds (PAT only)
        expiration_date:
          type: integer
          format: int64
          nullable: true
          description: Expiration timestamp in milliseconds (PAT only)
        last_used:
          type: integer
          format: int64
          nullable: true
          description: Last used timestamp in milliseconds (PAT only)
      required:
        - token_type
        - scopes
    Error:
      properties:
        description:
          type: string
        error:
          type: string
      additionalProperties: false
  responses:
    UnauthorizedError:
      description: Error object in case there's a problem with the authorization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
            description: >-
              The access token provided is expired, revoked, malformed, or
              invalid for other reasons.
    ServerError:
      description: Error object in case there's a server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal_server_error
            description: An unexpected error happened, please contact support
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 Authorization Grant
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://accounts.fax.plus/login?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost&scope=all
          tokenUrl: https://accounts.fax.plus/token
          refreshUrl: >-
            https://accounts.fax.plus/token?grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN
          scopes:
            all: >-
              for now when a user grants permission, all grants will be
              permitted
    personal_access_token:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Personal Access Token (PAT) is a Bearer token used for secure API calls.
        For direct API calls, the PAT is used in the Authorization header as
        'Bearer {PAT}'. For MCP usage, configure your PAT in your MCP client
        settings (e.g., in your IDE's MCP server configuration) - authentication
        will be handled automatically.

````