---
title: "Update API key"
method: PATCH
path: "/v1/api-keys/{id}"
tags: ["API Keys"]
---

# Update API key

`PATCH /v1/api-keys/{id}`

## Request

- Base URL: `https://smtpfa.st/api`
- URL: `https://smtpfa.st/api/v1/api-keys/{id}`
- Auth: HTTP bearer

Rename a key or change its scopes. The secret is unchanged; scope changes apply on the key's next request. Requires the apikey:manage scope when called with an API key.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string
  - `scopes` string[]: Replaces the key's scopes

## Response `200`

The updated key

- object
  - `id` string
  - `name` string
  - `keyPrefix` string
  - `scopes` string[]

## Other responses

- `400`: Bad request - check your payload
- `401`: Invalid or missing API key
- `403`: Forbidden - domain not verified or insufficient permissions
- `404`: Resource not found
- `429`: Rate limit exceeded - retry after the period indicated in the Retry-After header
- `500`: Internal server error

---

[API](https://skmtc.dev/smtpfa/apis/smtpfast-api.md) · [All operations](https://skmtc.dev/smtpfa/apis/smtpfast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smtpfa/apis/smtpfast-api/revisions/79dda742f53e?raw)
