---
title: "Refresh an access token"
method: POST
path: "/_matrix/client/v3/refresh"
---

# Refresh an access token

`POST /_matrix/client/v3/refresh`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v3/refresh`
- Auth: none declared
- TypeScript: <https://skmtc.dev/matrix/apis/matrix-client-server-api/docs/_matrix/client/v3/refresh/post.ts> (a function with typed inputs; its response is checked against the schema)

Refresh an access token. Clients should use the returned access token
when making subsequent API calls, and store the returned refresh token
(if given) in order to refresh the new access token when necessary.

After an access token has been refreshed, a server can choose to
invalidate the old access token immediately, or can choose not to, for
example if the access token would expire soon anyways. Clients should
not make any assumptions about the old access token still being valid,
and should use the newly provided access token instead.

The old refresh token remains valid until the new access token or refresh token
is used, at which point the old refresh token is revoked.

Note that this endpoint does not require authentication via an
access token. Authentication is provided via the refresh token.

Application Service identity assertion is disabled for this endpoint.

## Request body

- object
  - `refresh_token` string, required: The refresh token

## Response `200`

A new access token and refresh token were generated.

- object
  - `access_token` string, required: The new access token to use.
  - `expires_in_ms` integer: The lifetime of the access token, in milliseconds. If not given, the client can assume that the access token will not expire.
  - `refresh_token` string: The new refresh token to use when the access token needs to be refreshed again. If not given, the old refresh token can be re-used.

## Other responses

- `401`: The provided token was unknown, or has already been used.
- `429`: This request was rate-limited.

---

[API](https://skmtc.dev/matrix/apis/matrix-client-server-api.md) - [All operations](https://skmtc.dev/matrix/apis/matrix-client-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/matrix/apis/matrix-client-server-api/revisions/c7fe4072c681?raw)
