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

# Get API Token

> Retrieve the API token for a specific sub-account. This endpoint is only available to agency owners.

<Note>
  This endpoint requires an **agency owner** token.
</Note>

## Headers

<ParamField header="token" type="string" required>
  Token from the agency owner account.
</ParamField>

## Query Parameters

<ParamField query="accountEmail" type="string" required>
  The email address of the sub-account to retrieve the API token for.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful.
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable result message.
</ResponseField>

<ResponseField name="token" type="string">
  The API token for the specified sub-account.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.linkedcamp.com/tokens?accountEmail=user@example.com" \
    -H "token: YOUR_AGENCY_OWNER_TOKEN"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.linkedcamp.com/tokens",
      headers={"token": "YOUR_AGENCY_OWNER_TOKEN"},
      params={"accountEmail": "user@example.com"},
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.linkedcamp.com/tokens?accountEmail=user@example.com",
    {
      headers: { "token": "YOUR_AGENCY_OWNER_TOKEN" },
    }
  );
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Api token found successfully!",
    "token": "abc123..."
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "message": "Invalid agency owner token."
  }
  ```
</ResponseExample>
