# 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):

  - `client_id` (string, required)
    Client identifier

  - `client_secret` (string, required)
    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.

  - `grant_type` (string, required)
    Should be set to client_credentials.
    Enum: "client_credentials"

## Response 200:

  - `200` (unknown)
    Access token successfully retrieved

## 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

