---
type: api
title: Refresh authentication token
description: Issues a new authentication token.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/v4/operation/operation-refresh-token
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/v4/operation/operation-refresh-token
products:
  - Elastic Cloud Enterprise
---

# Refresh authentication token

## Paths

- `POST` `/users/auth/_refresh`

## Description

Issues a new authentication token.

## Authentication

- Basic: `Authorization: Basic <credentials>`
- Api key: `Authorization: <value>`

## Responses

#### `200`

The token refreshed successfully and was returned in the body of the response.

`application/json`

- `token` (string)
  The authorization bearer token that you use in subsequent requests
- `session_expiration_time` (string · format: date-time)
  The time that the session token will expire
#### `401`

The authentication token is invalid or expired. (code: `root.unauthorized`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `501`

The administrator needs to configure the authentication cluster. (code: `authc.no_authentication_cluster`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `502`

The authentication cluster failed to process the request. The response body contains details about the error. (code: `authc.authentication_cluster_error`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X POST "${API_URL}/users/auth/_refresh" \
  -u "${USERNAME}:${PASSWORD}"
```

