---
title: "Renew personal access token"
method: PUT
path: "/authn2/v0/personal-access-token/{personal_access_token_id}"
tags: ["esper_cloud_api_Personal Access Token"]
---

# Renew personal access token

`PUT /authn2/v0/personal-access-token/{personal_access_token_id}`

Renews a personal access token by updating its expiry date.

Use this endpoint to extend the validity of an existing API key before it expires, without needing to generate a new key and update credentials in all systems that use it.

**About Renew Personal Access Token**

Personal access tokens are API keys with an expiry date set at creation. This endpoint extends the expiry in place — the API key value itself does not change, only the expiry_at timestamp is updated. Personal access tokens are scoped to the authenticated caller — only API keys belonging to the user associated with the API key making the request can be renewed; those belonging to other users cannot be managed here. The API key value is returned in the response. API keys created with expiry_at: -1 (no expiry) can also be updated to add an expiry via this endpoint.

**Key Fields / Request Body**

expiry_at — (required) the new expiry date as a Unix timestamp integer; set to -1 for no expiry

**Key Fields (Response)**

id — the UUID of the token record

token — the API key value (unchanged); returned here for convenience

expiry_at — the updated expiry timestamp as set in the request

updated_at — timestamp confirming when the renewal was applied

**Common Use Cases**

Extending an API key's validity before it expires to avoid service interruption in automated integrations

Converting an API key from a fixed expiry to no expiry (or vice versa) by updating expiry_at

Renewing an API key as part of a scheduled credential rotation policy

**Best Practices**

Use GET /authn2/v0/personal-access-token/ to retrieve the personal_access_token_id if it was not stored at creation time — match by name or prefix

Renew API keys before they expire rather than after — a lapsed key will cause API calls to fail until renewed or replaced

Keep a record of each API key's expiry_at in your secrets management system so renewals can be scheduled proactively

**Workflow**

Call GET /authn2/v0/personal-access-token/ to identify the target token and retrieve its id if needed

PUT to this endpoint with the new expiry_at value

Confirm the updated expiry_at in the response

## Path parameters

- `personal_access_token_id` string, uuid, required

## Request body

- object
  - `expiry_at` integer, required — exipy date for token.

## Response `200`

OK

- EsperCloudApiPersonalAccessTokenUpdateResponse
  - `id` string, uuid — Unique ID for the generated token.
  - `name` string — Name for the token.
  - `description` string — Description for the token.
  - `created_at` string, timestamp — Timestamp indicating when the token was created.
  - `updated_at` string, timestamp — Timestamp indicating when the token was last updated.
  - `token` string — The generated access token value.
  - `prefix` string — Prefix for the generated token value.
  - `expiry_at` integer — exipy date for token.
  - `legacy_token_id` integer — token id corresponding to legacy system
  - `legacy_developer_app_id` string — developer app id corresponding to legacy system

## Other responses

- `400` — Bad request
- `401` — Unauthorized

---

[API](https://skmtc.net/esper/apis/esper-api-reference.md) · [All operations](https://skmtc.net/esper/apis/esper-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/esper/esper-api-reference/revisions/e1f64cbb488e/schema)
