Skip to Content
APIEndpointsGet key identity

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/me

Authorization

HeaderTypeRequired
AuthorizationBearer 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 --request GET \ --url 'https://api.askylabs.com/v1/me' \ --header 'Authorization: Bearer <api-key>'

Response

{ "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

FieldTypeDescription
data.workspace_iduuid | nullThe workspace this key is bound to
data.scopesstring[]required. What the key may do. Every key is currently read-only
data.brand_accessobject | stringrequired. { "brands": [uuid] } when restricted, or the string "all"
data.created_byuuid | nullWho minted the key. null if that user has since been removed
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestA parameter is unknown or malformed. The message names it
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
429rate_limitedOver 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