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

# Login

> Exchange your client credentials for an access token. Use the returned token as a Bearer token in all subsequent API requests.

<ParamField header="x-api-key" type="string" required>
  Your Fire API key. Issued from the Fire dashboard under **Settings → API Keys**.
</ParamField>

<ParamField header="x-client-channel" type="string" required>
  Must be `integration`. Identifies the request as coming from an external integration.
</ParamField>

<ParamField header="account" type="string" required>
  Account identifier the request belongs to.
</ParamField>

<ParamField header="Content-Type" type="string" required default="application/json">
  Must be `application/json` for the JSON body.
</ParamField>

<ParamField body="client_id" type="string" required>
  Client identifier issued by Fire.
</ParamField>

<ParamField body="client_secret" type="string" required>
  Client secret issued by Fire.
</ParamField>

<ParamField body="grant_type" type="string" required default="client_credentials">
  OAuth 2.0 grant type. Must be `client_credentials`.
</ParamField>

<ResponseField name="accessToken" type="string">
  Access token. Include this in the `Authorization: Bearer <accessToken>` header for all API requests.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://stg.api.fire.rest/api/authentication/login' \
    --header 'x-api-key: <your_api_key>' \
    --header 'x-client-channel: integration' \
    --header 'account: <your_account_id>' \
    --header 'Content-Type: application/json' \
    --data '{
      "client_id": "<your_client_id>",
      "client_secret": "<your_client_secret>",
      "grant_type": "client_credentials"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": "unauthorized",
      "message": "Invalid credentials"
    }
  }
  ```
</ResponseExample>
