Skip to content

Rename an API key or change its origins

PATCH
/v1/api-keys/{id}
curl --request PATCH \
--url https://api.pixonaut.app/v1/api-keys/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "allowedOrigins": [ "https://shop.acme.example", "https://eu.acme.example" ], "label": "Storefront widget (EU)" }'

Operation ID: apiKeys.update

Takes what creating that kind of key takes: a secret or integration key, api-keys:manage; an MCP key, being the member who created it. A key from the deployment’s configuration (managed) is not changed here, nor a key a connected store was given, except to rename its integration key: a store’s site is changed by connecting it again. Later audit entries name a renamed key by its new name; earlier ones keep the name it had when it acted.

id
required
string
Media typeapplication/json
object
allowedOrigins

A publishable key’s origins, replacing the ones it has. Refused for any other kind.

Array<string>
<= 20 items
label

The key’s new name.

string
>= 1 characters <= 100 characters

Examples

Exampleexample

Example

{
"allowedOrigins": [
"https://shop.acme.example",
"https://eu.acme.example"
],
"label": "Storefront widget (EU)"
}

The key, changed

Media typeapplication/json
object
allowedOrigins
required
Array<string>
id
required
string
kind
required
string
label
required
string

Examples

Exampleexample

Example

{
"allowedOrigins": [
"https://shop.acme.example",
"https://eu.acme.example"
],
"id": "0b1c2d3e-4f50-4a6b-8c7d-000000000006",
"kind": "pk",
"label": "Storefront widget (EU)"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: invalid_origin, origins_not_allowed, invalid_input

Media typeapplication/json
object
error
required
string
origin

Always sent with invalid_origin.

string

Examples

invalid_input

{
"error": "invalid_input"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: forbidden, feature_disabled, origin_forbidden

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: not_found

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "not_found"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: config_managed, connection_key

Media typeapplication/json
object
error
required
string

Examples

config_managed

{
"error": "config_managed"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: payload_too_large

Media typeapplication/json
object
bytes
number
error
required
string
maxBytes

Always sent with payload_too_large.

number

Examples

Examplepayload_too_large

payload_too_large

{
"error": "payload_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors