{
  "id": "authorize",
  "title": "Authorize user requests",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/rest-api/requests/users/authorize/",
  "summary": "Users authorization requests",
  "content": "\n| Method | Path | Description |\n|--------|------|-------------|\n| [POST](#post-authorize) | `/v1/users/authorize` | Generate a token to authorize an authenticated user |\n\n## Authorize user {#post-authorize}\n\n    POST /v1/users/authorize\n\nGenerates a JSON Web Token (JWT) for a user to use as authorization to access the REST API. The request authentication header must include the relevant username and password.\n\n### Request {#post-request}\n\n#### Example HTTP request\n\n    POST /v1/users/authorize\n\n#### Example JSON body\n\nThe request body is optional unless you want to specify the token's time to live:\n\n```json\n{\n  \"ttl\": \u003ctime_in_seconds\u003e\n}\n```\n\n#### Request headers\n| Key    | Value            | Description         |\n|--------|------------------|---------------------|\n| Host   | cnm.cluster.fqdn | Domain name         |\n| Accept | application/json | Accepted media type |\n\n#### Request body\n\nOptionally include a JSON object in the request body to specify the time to live (`ttl`), which determines the amount of time in seconds the token will be valid. The default `ttl` is `300` seconds. The minimum `ttl` is `1` second and the maximum `ttl` is `86400` seconds.\n\n### Response {#post-response}\n\nReturns a JSON object that contains the generated access token.\n\n#### Example JSON body\n\n```json\n{\n  \"access_token\": \"eyJ5bGciOiKIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXViOjE0NjU0...\"\n}\n```\n\n### Error codes {#post-error-codes}\n\nWhen errors are reported, the server may return a JSON object with\n`error_code` and `message` fields that provide additional information.\nThe following are possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| password_expired | The password has expired and must be changed. |\n\n### Status codes {#post-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | The user is authorized. |\n| [400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request) | The request could not be understood by the server due to malformed syntax. |\n| [401 Unauthorized](https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized) | The user is unauthorized. |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

