POST
/
v1
/
keys.updateKey
curl --request POST \
  --url https://api.unkey.dev/v1/keys.updateKey \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyId": "key_123",
  "name": "Customer X",
  "ownerId": "user_123",
  "externalId": "user_123",
  "meta": {
    "roles": [
      "admin",
      "user"
    ],
    "stripeCustomerId": "cus_1234"
  },
  "expires": 0,
  "ratelimit": {
    "type": "fast",
    "limit": 10,
    "refillRate": 1,
    "refillInterval": 60
  },
  "remaining": 1000,
  "refill": {
    "interval": "daily",
    "amount": 100
  },
  "enabled": true,
  "roles": [
    {
      "id": "perm_123"
    },
    {
      "name": "dns.record.create"
    },
    {
      "name": "dns.record.delete",
      "create": true
    }
  ],
  "permissions": [
    {
      "id": "perm_123"
    },
    {
      "name": "dns.record.create"
    },
    {
      "name": "dns.record.delete",
      "create": true
    }
  ]
}'
{}

Changelog

DateChanges
Dec 06 2023Introduced endpoint

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Update a key's configuration. The apis.<API_ID>.update_key permission is required.

Response

200
application/json

The key was successfully updated, it may take up to 30s for this to take effect in all regions

The response is of type object.