Every key belongs to one workspace and one mode. A restricted key holds only the scopes it needs, read or write per resource, with an expiry and a daily spend cap. See Keys and test mode.
Check a key
GET/v1/key_check
Which workspace a key belongs to, its mode, its kind, its scopes and when it expires. It changes and bills nothing, so an agent can check its key before it starts.
- Who may
- Any key
- CLI
widar auth status- MCP tool
check_key- Returns
- The key’s workspace, mode, kind, scopes and expiry.
No parameters.
curl -X GET https://api.widar.com/v1/key_check \
-H "Authorization: Bearer $WIDAR_API_KEY"{
"object": "key_check",
"workspace": { "id": "ws_Lm3Qx8Rk2VnT", "name": "Lumen Labs" },
"mode": "test",
"kind": "secret",
"scopes": [],
"expires_at": null
}GET/v1/keys
The workspace’s keys, live and test, each shown by its start and last four characters.
- Who may
- Owner, Admin and Developer
- CLI
widar keys list- MCP tool
list_api_keys- Returns
- The keys, never their secrets.
No parameters.
curl -X GET https://api.widar.com/v1/keys \
-H "Authorization: Bearer $WIDAR_API_KEY"GET /v1/keys
POST/v1/keys
A key for a server (secret or restricted) or for a page or an app (publishable), live or test.
- Who may
- Owner, Admin and Developer
- CLI
widar keys create --name <name> [--kind <secret|restricted|publishable>] [--mode <live|test>] [--scopes <scope,...>] [--origins <url,...>] [--allow-native]- MCP tool
create_api_key- Returns
- The key, and its secret shown once.
Parameters
nameRequiredThe name. At most 80 characters.
kindThe kind. One of
secret,restricted,publishable.modelive or test; the call’s own mode when left out One of
live,test.scopesa restricted key’s, each resource:read or resource:write; write includes read At most 30 items.
originsThe origins. At most 20 items.
allow_nativea publishable key’s: it also starts a verification from a native app, which sends no origin; with it, origins may be empty
curl -X POST https://api.widar.com/v1/keys \
-H "Authorization: Bearer $WIDAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>"
}'POST /v1/keys
POST/v1/keys/{key_id}/roll
Replace a key’s secret; the old one keeps working for the hours you give, up to 30 days, then stops.
- Who may
- Owner, Admin and Developer
- CLI
widar keys roll <key_id> [--expire-old-in-hours <0-720>]- MCP tool
roll_api_key- Returns
- The key with its new secret, shown once.
Parameters
key_idRequiredThe key’s id. In the path.
expire_old_in_hoursThe expire old in hours. At most 720.
curl -X POST https://api.widar.com/v1/keys/key_7Kq2Xw9/roll \
-H "Authorization: Bearer $WIDAR_API_KEY"POST /v1/keys/{key_id}/roll
PATCH/v1/keys/{key_id}
Rename a key, change the scopes of a restricted key, the origins of a publishable key and whether a native app may start with it, or the most a secret or restricted key may spend in a UTC day. Its secret stays the same.
- Who may
- Owner, Admin and Developer
- CLI
widar keys update <key_id> [--name <name>] [--scopes <scope,...>] [--origins <url,...>] [--allow-native <true|false>] [--daily-spend-cap <usd|none>]- MCP tool
update_api_key- Returns
- The key as it now stands, never its secret.
Parameters
key_idRequiredThe key’s id. In the path.
nameThe name. At most 80 characters.
scopesThe scopes. At most 30 items.
originsThe origins. At most 20 items.
allow_nativeThe allow native.
daily_spend_capThe most the key may spend in a UTC day, in USD from 0.01 to 1000 in whole cents; null removes the cap
nullclears it.
curl -X PATCH https://api.widar.com/v1/keys/key_7Kq2Xw9 \
-H "Authorization: Bearer $WIDAR_API_KEY"PATCH /v1/keys/{key_id}
DELETE/v1/keys/{key_id}
Stop a key at once: every call made with it is refused from now on. It cannot be undone; make a new key instead.
- Who may
- Owner, Admin and Developer
- CLI
widar keys revoke <key_id>- MCP tool
revoke_api_key- Returns
- The key’s id, object key and deleted true: it stopped at once.
Parameters
key_idRequiredThe key’s id. In the path.
curl -X DELETE https://api.widar.com/v1/keys/key_7Kq2Xw9 \
-H "Authorization: Bearer $WIDAR_API_KEY"DELETE /v1/keys/{key_id}
GET/v1/key_usage
For each key: its requests in the last 24 hours and the last 7 days, its errors, when it was last used, and until when an old secret still works after a roll.
- Who may
- Owner, Admin and Developer
- CLI
widar keys usage [--key-id <key_id>]- MCP tool
get_api_key_usage- Returns
- One row per key, never a secret.
Parameters
key_idThe key’s id.
curl -X GET https://api.widar.com/v1/key_usage \
-H "Authorization: Bearer $WIDAR_API_KEY"GET /v1/key_usage