How to Set an Expiry Date on an API Key
Choose when a key should stop working
Written by Erick Horn
June 27, 2026
Updated October 16, 2026
How to set an expiry date on an API key
Open API Keys, select a key, and use its Expiration card. Choose Never, in 7, 30, or 90 days, or a custom date, then click Set expiration. After that time, requests using the key return 401 ER0230.
An expiry date is useful for a demo, temporary script, contractor, or trial integration. The key stops automatically when its access period ends.
Where do you set a key’s expiry date?
On the key’s detail page, use the Expires dropdown:
- Never: no end date; the default for new keys.
- In 7, 30, or 90 days: count forward from now.
- Custom: choose a future date from the calendar.
Click Set expiration. Only that key is affected; other keys, quota, and your subscription stay the same. You can change the date later.

Can you set an expiration when creating a key?
Yes. The Create key dialog has the same options. Choose the date before confirming. See how to create, rename and revoke API keys.
The date must be in the future. A past date is rejected with Expiration must be in the future.
What happens when an API key expires?
Every request using it returns HTTP 401 with code ER0230:
{
"status": "not_ok",
"request_id": "…",
"errors": [
{
"status": 401,
"code": "ER0230",
"message": "API key has expired.",
"links": { "about": "https://docs.apitube.io/platform/news-api/http-response-codes" },
"timestamp": "…"
}
]
}
This applies to both api_test_ and Live keys. To use an expired key again, change its date to a future time or choose Never in the dashboard. A request cannot extend its own key’s expiry.
See how to fix authentication errors for other 401 causes.
How do you get warned before a key expires?
Check the dashboard for:
- Key status: within seven days of expiry, an Active key shows Expires in Nd. After expiry, it shows Expired in red.
- Notifications: API key expiring soon identifies keys due to expire within seven days. API key expired identifies keys that no longer work.
Extend the date or replace the key before applications start receiving errors.
Who can change a key’s expiry?
Workspace owners, admins, and members can change it. Viewers cannot.
Common Questions
- How do I remove or extend an expiry?
- Does an expired key stop my whole account?
- Do expired keys still count toward my key limit?
- Can I expire a Test key?
How do I remove or extend an expiry?
Choose Never or a later date under Expires, then click Set expiration. It applies to the next request. The secret, name, history, and restrictions stay the same.
Does an expired key stop my whole account?
No. Only requests using that key fail. Other keys and your account allowances remain available.
Do expired keys still count toward my key limit?
Yes. A key occupies a slot until you revoke it, even when expired. Each workspace allows 20 keys per mode. Revoke an expired key to free its slot.
Can I expire a Test key?
Yes. Test and Live keys use the same expiry settings and return 401 ER0230 after expiry.