> For the complete documentation index, see [llms.txt](https://help.citrusad.com/retail-media-interface/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.citrusad.com/retail-media-interface/partner/es/partner-api-authentication/user-key-authentication.md).

# Token de clave de usuario

## Solicitud de tokens

Para recibir el token de acceso requerido, realice una solicitud al `/user-key-token` punto de conexión añadiendo los siguientes parámetros utilizando el `application/x-www-form-urlencoded` formato con una codificación de caracteres UTF-8 en el cuerpo de la solicitud HTTP.

```http
POST https://auth.<env>.citrusad.com/v2/user-key-token
Content-Type: application/x-www-form-urlencoded
user_key=<USER_KEY>
```

Recibirá una respuesta con un `accessToken`,`expiresIn`, y `tokenType`.

```json
{
    "accessToken": "ACCESS_TOKEN",
    "expiresIn": 84000,
    "tokenType": "Bearer"
}
```

{% hint style="info" %}
Su token de **acceso** se utiliza para acceder a la Epsilon Retail Media API.
{% endhint %}

## Token de actualización

Cuando su token de acceso expire, recibirá un error de token no válido por parte de la API de campaña. En este caso, realizará una solicitud al `/token` punto de conexión con su token de actualización como se ilustra en el siguiente diagrama:

<figure><img src="/files/Zdm18giKQTGUmLvH6KdO" alt="Authentication refresh flow.png" width="100%"><figcaption></figcaption></figure>

Por lo general, un usuario solo necesitará un nuevo token de acceso cuando el anterior expire, o cuando obtenga o pierda acceso a los recursos adjuntos a sus reclamaciones. Es una mala práctica llamar al punto de conexión para obtener un nuevo token de acceso para cada solicitud a nuestra API.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.citrusad.com/retail-media-interface/partner/es/partner-api-authentication/user-key-authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
