---
description: >-
  This page contains information on how can agency owners get the API token for
  the its customers.
---

# Get Customer API Token

### Get User API Access Token

This API endpoint retrieves a user API Access token based on the provided user ID.

#### Endpoint

<table><thead><tr><th width="160">Method</th><th>URL</th></tr></thead><tbody><tr><td>GET</td><td><a href="https://api.v7.botpenguin.com/ext/get-user-token">https://api.v7.botpenguin.com/ext/get-user-token</a></td></tr></tbody></table>

#### Parameters

<table><thead><tr><th width="158">Parameter</th><th width="130">Required</th><th>Description</th></tr></thead><tbody><tr><td>userId</td><td>Yes</td><td>The unique identifier for the user. You can get the same from the Get Customer API. </td></tr></tbody></table>

#### Headers

<table><thead><tr><th width="175">Header</th><th width="126">Value</th><th>Description</th></tr></thead><tbody><tr><td>authtype</td><td>Key</td><td>Must be set to 'Key'.</td></tr><tr><td>Authorization</td><td>Bearer</td><td>Bearer token for authentication. You can get the same from the agency admin's account on BotPenguin Dashboard.</td></tr></tbody></table>

#### Example Request

{% code overflow="wrap" %}
```bash
curl --location 'https://api.v7.botpenguin.com/ext/get-user-token?userId=*********' \
--header 'authtype: Key' \
--header 'Authorization: Bearer **********'
```
{% endcode %}

#### Success API Response

```json
{
    "success": true,
    "message": "",
    "data": {
        "permanentToken": {
            "key": "**********",
            "active": true
        }
    },
    "code": 200
}
```

#### Response Fields

| Field          | Description                                                              |
| -------------- | ------------------------------------------------------------------------ |
| success        | Indicates if the request was successful.                                 |
| message        | Additional information or error messages.                                |
| data           | Container for the response data.                                         |
| permanentToken | Object containing the permanent API access token details of the customer |
| key            | API access token generated for the user.                                 |
| active         | Indicates whether the token is currently active or not.                  |
| code           | The status code indicating the result of the request (200 for success).  |

### :question: Got any questions?

If you have any questions, you can look into our repository of FAQs, most likely, you will find your answer here, If not, write us at [support@botpenguin.com](mailto:support@botpenguin.com).
