# Get Custom User (Team Member) Token

This endpoint generates a permanent token for a specified user based on their email and user type.

**Request URL**

```
https://api.v7.botpenguin.com/ext/get-user-token
```

**Request Method**

```
GET
```

**Request Headers**

| Header        | Value                       |
| ------------- | --------------------------- |
| Authorization | Bearer \[Your Access Token] |
| authtype      | Key                         |

**Request Parameters**

| Parameter | Description               | Type   | Required | Allowed Values                |
| --------- | ------------------------- | ------ | -------- | ----------------------------- |
| email     | Email address of the user | string | Yes      |                               |
| type      | Type of user              | string | Yes      | AGENT, CUSTOM\_USER, CUSTOMER |

{% hint style="info" %}
Allowed values for the Type query parameter

AGENT: For team users with default agent role&#x20;

CUSTOM\_USER: For team members with a custom role&#x20;

CUSTOMER: For the main customer role
{% endhint %}

**Sample Request**

{% code overflow="wrap" %}

```bash
curl --location 'https://api.v7.botpenguin.com/ext/get-user-token?email=test%40mail.com&type=CUSTOM_USER' \
--header 'Authorization: Bearer ***********' \
--header 'authtype: Key'
```

{% endcode %}

**Sample Response**

{% code overflow="wrap" %}

```json
{
    "success": true,
    "message": "",
    "data": {
        "permanentToken": {
            "key": "[Agent's Token]",
            "active": true
        }
    },
    "code": 200
}
```

{% endcode %}

**Response Attributes**

| Attribute | Description                              |
| --------- | ---------------------------------------- |
| success   | Indicates if the request was successful. |
| message   | Additional information or error message. |
| data      | Object containing the permanent token.   |
| code      | HTTP status code of the response.        |

**Data Attributes**

| Attribute      | Description                                    |
| -------------- | ---------------------------------------------- |
| permanentToken | Object containing the permanent token details. |
| key            | The generated permanent token key.             |
| active         | Flag indicating if the token is active.        |

#### Note:

* Make sure to replace `[Your Access Token]` with your actual access token.
* Mask confidential details such as access tokens before sharing or storing this documentation.


---

# 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-custom-user-team-member-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.
