---
title: "Update API key"
method: POST
path: "/api/v2/api-key/{id}"
tags: ["service-account"]
---

# Update API key

`POST /api/v2/api-key/{id}`

## Request

- Base URL: `https://central.zerotier.com`
- URL: `https://central.zerotier.com/api/v2/api-key/{id}`
- Auth: HTTP bearer

Update the name or description of an API key.

## Path parameters

- `id` string, required

## Request body

- UpdateApiKeyRequest
  - `description` string

## Response `200`

Updated API key metadata

- ApiKeyResponse
  - `id` string, required
  - `serviceAccountId` string, required
  - `description` string, required
  - `expires` string, date-time: Expiration time of the API key
  - `creationTime` string, date-time, required: Time the API key was created
  - `lastModified` string, date-time, required: Time the API key was last modified
  - `lastUsed` string, date-time: Time the API key was last used

## Other responses

- `400`: Invalid data provided
- `401`: Missing or invalid authentication token
- `403`: Insufficient permissions
- `413`: Request body exceeds the 1 MB size limit
- `500`: Internal server error

---

[API](https://skmtc.dev/zerotier/apis/zerotier-central-v2-api.md) - [All operations](https://skmtc.dev/zerotier/apis/zerotier-central-v2-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zerotier/apis/zerotier-central-v2-api/revisions/b2e7468ad104?raw)
