# Generate user auth tokens

## <mark style="color:$warning;">\[POST]</mark> /api/v2/user/tokens

Returns an access and a refresh token to log the user into the pay widget automatically. Used for screens skipping in the Pay Widget.

Request body type:

```typescript
type RequestBody = {
  email: string;
  countryIsoCode: string;
};
```

Request body example:

```json
{
  "email": "testuser+ng@fonbnk.com",
  "countryIsoCode": "NG"
}
```

Response type:

{% code overflow="wrap" expandable="true" %}

```typescript
type Response = {
  accessToken: string;
  refreshToken: string;
}
```

{% endcode %}

Response example:

{% code overflow="wrap" expandable="true" %}

```json
{
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyRGF0YSI6eyJ1c2VybmFtZSI6InVzZXIjLWhsRjNmek8iLCJfaWQiOiI2OTI4MWQ0ZjE4NjEzYmM5ZGU3MmVkOGUiLCJpc0RldlVzZXIiOmZhbHNlLCJjb3VudHJ5SXNvQ29kZSI6Ik5HIiwiaXNBbWJhc3NhZG9yIjpmYWxzZSwiZW1haWwiOiJ0ZXN0dXNlcituZ0Bmb25ibmsuY29tIn0sInR5cGUiOiJhY2Nlc3MiLCJ1aWQiOiIwMUtDNk02TTJEVkZSSzkxNUtZUTdQQkJBUCIsImlhdCI6MTc2NTQ1NDA3MywiZXhwIjoxNzY1NDU0OTczfQ.zRI7_Dins7VskO9epKJWIlZLwxPMiyKG8Fq_hjXOTAc",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyRGF0YSI6eyJ1c2VybmFtZSI6InVzZXIjLWhsRjNmek8iLCJfaWQiOiI2OTI4MWQ0ZjE4NjEzYmM5ZGU3MmVkOGUiLCJpc0RldlVzZXIiOmZhbHNlLCJjb3VudHJ5SXNvQ29kZSI6Ik5HIiwiaXNBbWJhc3NhZG9yIjpmYWxzZSwiZW1haWwiOiJ0ZXN0dXNlcituZ0Bmb25ibmsuY29tIn0sInR5cGUiOiJyZWZyZXNoIiwidWlkIjoiMDFLQzZNNk0ySjc2SEY0WlgzUFRQRTUwQjAiLCJpYXQiOjE3NjU0NTQwNzMsImV4cCI6MTc2NjY2MzY3M30.P1peJxGy7HivuubXbUEnqAW_3vbhem41zMU6v75uI6U"
}
```

{% endcode %}


---

# 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://docs.fonbnk.com/server-to-server/api-endpoints/generate-user-auth-tokens.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.
