---
title: "Renew (extend the expiry of) a spanning personal access token."
method: POST
path: "/api/me/api-tokens/{tokenId}/renew"
tags: ["Me"]
---

# Renew (extend the expiry of) a spanning personal access token.

`POST /api/me/api-tokens/{tokenId}/renew`

## Request

- Base URL: `https://hiveship.app/api`
- URL: `https://hiveship.app/api/api/me/api-tokens/{tokenId}/renew`
- Auth: API key in cookie `hiveship_access`

## Path parameters

- `tokenId` string, required

## Request body

- object
  - `expiresInDays` integer, required

## Response `200`

Renewed spanning token with the new expiry (plaintext NOT re-issued)

- object
  - `success` boolean, required
  - `data` object, required
    - `id` string, cuid, required
    - `name` string, required
    - `tokenHint` string, required
    - `scopes` string[], required
    - `lastUsedAt` string, date-time, nullable, required
    - `revokedAt` string, date-time, nullable, required
    - `expiresAt` string, date-time, nullable, required
    - `userId` string, cuid, required
    - `workspaceId` string, cuid, nullable, required
    - `createdAt` string, date-time, required

## Other responses

- `201`
- `400`: Validation error
- `403`: PAT callers rejected — cookie session required
- `404`: Token not found

---

[API](https://skmtc.dev/hiveship/apis/hiveship-api.md) · [All operations](https://skmtc.dev/hiveship/apis/hiveship-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hiveship/apis/hiveship-api/revisions/73d3e26544e4?raw)
