# Get client access token

Retrieve an access token to authorize your API request. By default, the access token is valid for 1 hour, you don't need to regenerate it every time before calling Mosaic APIs.  NOTE: The request type and examples depend on the service you choose

Endpoint: POST /oidc/token

## Request fields (application/x-www-form-urlencoded):

  - `body` (object, required) — one of:
    - Default:
      - `client_id` (string, required)
        Client identifier
        Example: "YOUR_CLIENT_ID"
      - `client_secret` (string, required)
        Client secret
        Example: "YOUR_CLIENT_SECRET"
      - `grant_type` (string, required)
        Grant type must be client_credentials.
        Enum: "client_credentials"
      - `resource` (string)
        URI of the resource the request is attempting to access.
    - Identity Verification only:
      - `client_id` (string, required)
        Client identifier
        Example: "YOUR_CLIENT_ID"
      - `client_secret` (string, required)
        Client secret
        Example: "YOUR_CLIENT_SECRET"
      - `grant_type` (string, required)
        Should be set to client_credentials.
        Enum: same as `grant_type` in "Default" (1 values)
      - `resource` (string)
        URI of the resource the request is attempting to access.
        Enum: "https://verify.identity.security"

## Response 200 fields (application/json):

  - `access_token` (string, required)
    The access token issued by the authorization server

  - `token_type` (string, required)
    Returned as Bearer
    Example: "Bearer"

  - `expires_in` (integer, required)
    Expiration time of the access token in seconds
    Example: 3600

  - `scope` (string, required)
    Scope of the access token

## Response 400 fields (application/json):

  - `message` (string, required)
    Example: "Bad request"

  - `error_code` (number, required)
    Example: 400

## Response 500 fields (application/json):

  - `message` (string, required)
    Example: "Something went wrong - Internal server error"

  - `error_code` (number, required)
    Example: 500


