Get key identity
Identity behind the key: which workspace it belongs to, what it is permitted to do, and which brands it can reach.
The natural health check for an integration. It is cheap, needs no ids, and confirms both that the key works and that it is scoped the way you expect.
GET /v1/meAuthorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Query parameters
None.
Any parameter you pass returns 400 invalid_request naming the offending key, rather than being
ignored silently.
Request
cURL
curl --request GET \
--url 'https://api.askylabs.com/v1/me' \
--header 'Authorization: Bearer <api-key>'Response
200
{
"data": {
"workspace_id": "68e1802b-676c-4b59-8da2-2b77b940d7fa",
"scopes": [
"read:basic", "read:visibility", "read:citations", "read:prompts",
"read:opportunities", "read:website", "read:content"
],
"brand_access": "all",
"created_by": "c1f0a6e2-8b34-4d97-a015-3e28d7b409fa"
},
"request_id": "req_0b7d5e91c4a2438fa0d6"
}Response fields
| Field | Type | Description |
|---|---|---|
data.workspace_id | uuid | null | The workspace this key is bound to |
data.scopes | string[] | required. What the key may do. Every key is currently read-only |
data.brand_access | object | string | required. { "brands": [uuid] } when restricted, or the string "all" |
data.created_by | uuid | null | Who minted the key. null if that user has since been removed |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A parameter is unknown or malformed. The message names it |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 429 | rate_limited | Over 300 requests per minute. See the Retry-After header |
Notes
brand_access is deliberately either an object or the string "all". A null would have been
ambiguous between “unrestricted” and “nothing”, and this surface never leaves that kind of question
to the reader.
This endpoint still counts against your rate limit and still appears in usage, so polling it as a heartbeat is visible rather than free.
Last updated on