PUT
/
keys
/
{id}
curl --request PUT \
  --url https://api.datkey.dev/keys/{id} \
  --header 'Content-Type: application/json' \
  --data '{
  "expires_at": 123,
  "verification_limit": 123
}'
{
  "key": {
    "id": "<key_id>",
    "name": "<key_name>",
    "key": "flox_sk_05ad2bf*********",
    "prefix": "flox_sk",
    "length": 16,
    "verifications": 10,
    "verification_limit": 12,
    "expires_at": 1733237153,
    "meta": null,
    "created_at": "2023-12-05T11:31:23.000000Z",
    "updated_at": "2023-12-05T13:03:24.000000Z"
  }
}

Headers

x-api-key
string

your workspace API key

Path Parameters

id
string
required

your key ID

Body

application/json
expires_at
integer

a unix time stamp in the future of when you want the key to expire

verification_limit
integer

maximum verification allowed for this key

Response

200
application/json
OK
api_id
string

The ID of the API the key belongs to

Example:

"{api_id}"

name
string

The name assigned to the key

Example:

"{api_name}"

prefix
string

The prefix assigned to the key

Example:

"prefix"

length
integer
default:16

The length assigned to the key

Required range: 16 <= x <= 255
meta
object

extra details you passed via the meta attribute

Example:
{ "user_id": "123456" }
expires_at
integer

Unix timestamp of when the key expires, returns null when not set

verification_limit
integer

maximum verification allowed for this key, returns null when not set