---
title: "Update a deployment token"
method: PATCH
path: "/projects/{project_id}/deployment-tokens/{token_id}"
tags: ["Deployment Tokens"]
---

# Update a deployment token

`PATCH /projects/{project_id}/deployment-tokens/{token_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/deployment-tokens/{token_id}`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required
- `token_id` integer, required

## Request body

- UpdateDeploymentTokenRequest
  - `expires_at` string, date-time, nullable
  - `is_active` boolean, nullable
  - `name` string, nullable
  - `permissions` string[], nullable

## Response `200`

Deployment token updated successfully

- DeploymentTokenResponse
  - `created_at` string, date-time, required
  - `created_by` integer, nullable
  - `deployment_id` integer, nullable
  - `environment_id` integer, nullable
  - `expires_at` string, date-time, nullable
  - `id` integer, required
  - `is_active` boolean, required
  - `last_used_at` string, date-time, nullable
  - `name` string, required
  - `permissions` string[], nullable
  - `project_id` integer, required
  - `token_prefix` string, required

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Deployment token not found
- `409`: Token with this name already exists
- `500`: Internal server error

## Changes

- **2026-07-27** `1b060c0a4ba3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/deployment-tokens/:token_id/patch.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
