PUT/api/setup-keys/{keyId}

Replace setup key settings

Replaces the configurable settings for a setup key. Provide revoked to set the key's revocation status and auto_groups to specify which groups are assigned to registered peers.

1 parameter · 2 body fields
keyIdstringrequired
The unique identifier of the setup key to update.

Setup key settings to replace. Include both revoked and auto_groups.

auto_groupsarray<string>required
List of group IDs to auto-assign to peers registered with this key
revokedbooleanrequired
Setup key revocation status

5 status codes
200Returns the updated setup key object, including its key value and configuration.
allow_extra_dns_labelsbooleanrequired
Allow extra DNS labels to be added to the peer
auto_groupsarray<string>required
List of group IDs to auto-assign to peers registered with this key
ephemeralbooleanrequired
Indicate that the peer will be ephemeral or not
expiresstringrequired
Setup Key expiration date
idstringrequired
Setup Key ID
last_usedstringrequired
Setup key last usage date
namestringrequired
Setup key name identifier
revokedbooleanrequired
Setup key revocation status
statestringrequired
Setup key status, "valid", "overused","expired" or "revoked"
typestringrequired
Setup key type, one-off for single time usage and reusable
updated_atstringrequired
Setup key last update date
usage_limitintegerrequired
A number of times this key can be used. The value of 0 indicates the unlimited usage.
used_timesintegerrequired
Usage count of setup key
validbooleanrequired
Setup key validity status
keystringrequired
Setup Key as secret
400Returned when the request is invalid.
401Returned when the request lacks required authentication.
403Returned when the request is forbidden.
500Returned when an internal server error occurs.

Error handling

A 400 indicates invalid request data, a 401 indicates missing authentication, a 403 indicates insufficient permission, and a 500 indicates an internal server error. The keyId path parameter identifies the setup key to update, and the body must include revoked and auto_groups.