PATCH /projects/{project_id}/keys/browser/{key_id}
Change a browser key
Origins, daily cap or name; same id, same key. Scopes do not change: create another key. Console session; a live key is created, changed, revoked or copied only by the admin and member roles (403 reserve_admin). 404 not_found when Geo is not served to this account.
Console session only (signed-in console).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
project_id | path | string · required | |
key_id | path | string · required | Browser key id. |
Request body
application/json · schema BrowserKeyUpdate
| Field | Type | Description |
|---|---|---|
origins | array<string> | Sites allowed to use the key: example.com, *.example.com (subdomains), https://example.com:8443, localhost:3000. https only, except localhost. |
daily_cap | integer | Billed units per UTC day. |
name | string | Name. |
Responses
| Status | Description | Body |
|---|---|---|
200 | browser_key | BrowserKey |
409 | browser_key_revoked | Error |
401 | unauthorized (session missing, expired or revoked) | Error |
403 | reserve_admin | Error |
404 | not_found, project_not_found, browser_key_not_found | Error |
422 | browser_key_invalid, browser_key_origin_invalid, browser_key_origin_insecure, browser_key_origins_required, browser_key_origins_too_many, browser_key_scopes_invalid, browser_key_daily_cap_invalid, browser_key_name_invalid, browser_key_environment (field names the field) | Error |
Examples
curl
curl -X PATCH "$GALON_API_BASE/projects/<project_id>/keys/browser/<key_id>" \
-H "Authorization: Bearer $GALON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"origins": ["string"], "daily_cap": 1, "name": "string"}'