---
title: "Update Team API Key"
description: "Update an existing team API key by applying only the values included in the request payload."
api: "PATCH /api/v1/team-api-keys/{api_key_id}"
---

## Request

<ParamField header="x-stack-secret-server-key" type="string" required>
  The secret server key for authentication.
</ParamField>

<ParamField header="x-stack-project-id" type="string" required>
  The project ID.
</ParamField>

<ParamField path="api_key_id" type="string" required>
  The unique identifier of the team API key to update.
</ParamField>

<ParamField body="description" type="string">
  A new description for the API key.
</ParamField>

<ParamField body="revoked" type="boolean">
  Set to `true` to revoke the API key.
</ParamField>

## Response

<ResponseField name="id" type="string">
  The unique identifier of the API key.
</ResponseField>

<ResponseField name="description" type="string">
  The description of the API key.
</ResponseField>

<ResponseField name="team_id" type="string">
  The identifier of the team this API key belongs to.
</ResponseField>

<ResponseField name="expires_at" type="string">
  ISO 8601 timestamp of when the API key expires, or `null` if it does not expire.
</ResponseField>

<ResponseField name="manually_revoked_at" type="string">
  ISO 8601 timestamp of when the API key was manually revoked, or `null` if it has not been revoked.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of when the API key was created.
</ResponseField>

<CodeGroup>
```bash cURL
curl -X PATCH 'https://api.stack-auth.com/api/v1/team-api-keys/tak_1234567890' \
  -H 'Content-Type: application/json' \
  -H 'x-stack-secret-server-key: YOUR_SECRET_SERVER_KEY' \
  -H 'x-stack-project-id: YOUR_PROJECT_ID' \
  -d '{
    "description": "Updated API key description",
    "revoked": false
  }'
```

```json 200 Response
{
  "id": "tak_1234567890",
  "description": "Updated API key description",
  "team_id": "team_1234567890",
  "expires_at": "2025-12-31T23:59:59Z",
  "manually_revoked_at": null,
  "created_at": "2024-01-01T00:00:00Z"
}
```
</CodeGroup>
