code: EXPIRED. Nothing else about the key changes, so you can extend an expired trial key and it keeps its metadata, credits, and permissions.
Set an expiry
integer | null
Unix timestamp in milliseconds. The maximum is
4102444800000 (1 January 2100). On keys.updateKey, omitting the field keeps the current expiry and null removes it. A timestamp in the past is accepted and makes the key expired at once.What happens at expiry
Expiry is checked against Unkey’s clock, not your server’s. An expired key uses no rate limits or credits. The response looks like this:expires value is also returned on valid verifications, so your backend can warn a user that their key is about to lapse.
Expired keys are kept
Expired keys aren’t deleted. They stay in the keyspace, show up inapis.listKeys and the dashboard, and keep returning EXPIRED. You can extend one and keep its analytics history. To remove expired keys, delete them yourself. See Disabling and deleting keys.
Extend or remove an expiry
EXPIRED. Verifying keys explains the timing.