---
title: "Refresh tokens"
description: "Exchange a refresh token for a new ID token."
---

> Documentation Index
> Fetch the complete documentation index at: https://truememory-docs.mvstg.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Auth API › Auth

`POST /auth/refresh`

Exchange a refresh token for a new ID token.

## Request body

_Required._

- `refresh_token` (`refresh_auth_refresh_post.refresh_token`; string, required)

## Example request

```json
{
  "refresh_token": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://truememory-auth.mvstg.com/auth/refresh \
  --header 'Content-Type: application/json' \
  --data '
{
  "refresh_token": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://truememory-auth.mvstg.com/auth/refresh';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({refresh_token: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-auth.mvstg.com/auth/refresh"

payload = { "refresh_token": "string" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "id_token": "string",
  "refresh_token": "string",
  "expires_in": "string",
  "user": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
    "gip_uid": "string",
    "email": "string",
    "email_verified": false,
    "username": "string",
    "display_name": "string",
    "photo_url": "string",
    "phone_number": "string",
    "disabled": false,
    "role": "user",
    "metadata": {},
    "raw_app_meta_data": {},
    "custom_claims": {},
    "last_sign_in_at": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "deleted_at": "2019-08-24T14:15:22Z",
    "deletion_completed_at": "2019-08-24T14:15:22Z"
  }
}
```

- `id_token` (`refresh_auth_refresh_post.response.200.id_token`; string, required)
- `refresh_token` (`refresh_auth_refresh_post.response.200.refresh_token`; string, required)
- `expires_in` (`refresh_auth_refresh_post.response.200.expires_in`; string, required)
- `user` (`refresh_auth_refresh_post.response.200.user`; any of, optional)
  - any of: `AuthUser`, `null`

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`refresh_auth_refresh_post.response.422.detail`; array<object>, optional)
  - `loc` (`refresh_auth_refresh_post.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`refresh_auth_refresh_post.response.422.detail.msg`; string, required)
  - `type` (`refresh_auth_refresh_post.response.422.detail.type`; string, required)
  - `input` (`refresh_auth_refresh_post.response.422.detail.input`; unknown, optional)
  - `ctx` (`refresh_auth_refresh_post.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/auth/refresh/index.md
