---
title: "Get a fresh XMPP connection token"
method: POST
path: "/v1/users/xmpp-token"
tags: ["Users"]
---

# Get a fresh XMPP connection token

`POST /v1/users/xmpp-token`

## Request

- Base URL: `https://api.chat.ethora.com`
- URL: `https://api.chat.ethora.com/v1/users/xmpp-token`
- Auth: HTTP bearer

**Auth**: User JWT

Returns a fresh short-lived JWT (in `xmppPassword`) for the authenticated
user to (re)connect to the XMPP server (ejabberd). It is the same value the
login / me responses put in `user.xmppPassword`: the client authenticates to
ejabberd with it as the SASL password — a JWT, not the raw account password.
Call this on reconnect when the previous token has expired.

## Response `200`

```
{ success: true, xmppPassword: string }
```

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `500`: Internal Server Error
- `503`: XMPP token unavailable (server missing XMPP_JWT_SECRET / XMPP_HOST).

---

[API](https://skmtc.dev/ethora/apis/platform-api.md) · [All operations](https://skmtc.dev/ethora/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ethora/apis/platform-api/revisions/01b6e64378ee?raw)
