# 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>https://api.v7.botpenguin.com/ext/get-user-token</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 <contact@botpenguin.com>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://partners.botpenguin.com/api-documentation/partner-api-documentation/get-customer-api-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
