GET /projects/{project_id}/keys/browser
List the browser keys of a project
Browser keys (never their fingerprint), the scopes they can carry and the limits. 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 |
Responses
| Status | Description | Body |
|---|---|---|
200 | browser_keys, scopes, limits | BrowserKeyList |
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 GET "$GALON_API_BASE/projects/<project_id>/keys/browser" \
-H "Authorization: Bearer $GALON_API_KEY"POST /projects/{project_id}/keys/browser
Create a browser key
One screen: the sites (origins) allowed to use the key, the Geo scopes, an optional daily cap in billed units (default 10,000: one per request, one per matrix pair, one per address to geocode) and a name. The key is public by nature: it only works from the declared origins, within the daily cap; a request that would exceed it is refused whole. 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 |
Request body
application/json · schema BrowserKeyCreate
| Field | Type | Description |
|---|---|---|
origins | array<string> · required | Sites allowed to use the key: example.com, *.example.com (subdomains), https://example.com:8443, localhost:3000. https only, except localhost. |
scopes | array<"geo:geocode" | "geo:route" | "geo:maps"> · required | geo:geocode, geo:route, geo:maps. |
daily_cap | integer | Billed units per UTC day (default 10,000). |
name | string | Name. |
environment | "test" | "live" | The project environment (default test). |
Responses
| Status | Description | Body |
|---|---|---|
201 | The key (api_key) and its settings | BrowserKey |
409 | browser_key_limit_reached (10 active keys per project) | 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 POST "$GALON_API_BASE/projects/<project_id>/keys/browser" \
-H "Authorization: Bearer $GALON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scopes": ["geo:geocode"], "origins": ["string"]}'