---
title: "Rename an API key, change a secret key’s scopes, or a public key’s origins"
method: PATCH
path: "/v1/keys/{keyId}"
---

# Rename an API key, change a secret key’s scopes, or a public key’s origins

`PATCH /v1/keys/{keyId}`

## Request

- Base URL: `https://api.grundfast.dk`
- URL: `https://api.grundfast.dk/v1/keys/{keyId}`
- Auth: API key in cookie `gf_session`

Body: { name?, scopes?, allowedOrigins? }. `scopes: null` removes a secret key’s narrowing; a list replaces it. allowedOrigins only applies to a public (gf_pub_) key and must keep at least one entry. Changes take effect on the key’s next call. The key itself, its kind, mode and permission never change — mint a new key for that.

## Path parameters

- `keyId` integer, required

## Request body

- UpdateApiKeyInput
  - `name` string
  - `allowedOrigins` string[]
  - `scopes` string[], nullable

## Response `200`

OK

## Other responses

- `400`: Error
- `403`: Error
- `404`: Error

---

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