Dashboard
Create an organization API key
POST/v1/api_keys
The key is returned once, in key; only its hash and a
12-character prefix are stored.
Choose the key's scopes in scopes. Without scopes the key gets
applications:read, applications:write, users:read,
users:write and events:read. keys:write lets a key create and
revoke keys, so a key gets it only when you list it in scopes.
You can give only scopes you have yourself. Dashboard owners and
admins have all six; an organization API key has the scopes it was
created with. Asking for a scope you lack, the default set
included, answers 403 missing_scope. A secret key gets
403 secret_key_not_allowed.
Başlıklar
X-Fox-TenantstringRequired when authenticating with a dashboard session token instead of a tenant API key.
Örnek:
ten_8f2c91a7
Gövde application/json
namestringzorunluscopesstring[]Scopes of the new key. Duplicates are ignored; the response lists them in a fixed order. Omit for the default set, which never includes
keys:write.Değerler:
applications:readapplications:writeusers:readusers:writeevents:readkeys:writeVarsayılan:["applications:read","applications:write","users:read","users:write","events:read"]
Yanıtlar
201CreatedTenantApiKeyWithSecret
Created. The secret
keyis returned only once.idstringÖrnek:
key_8f2c91a7namestringprefixstringFirst 12 characters, to tell keys apart in the dashboard.
Örnek:
fk_live_8f2cscopesstring[]Değerler:
applications:readapplications:writeusers:readusers:writeevents:readkeys:writecreated_atstring (date-time)last_used_atstringboş olabilirUpdated at most once a minute.
revoked_atstringboş olabilirkeystringThe full key. Shown only in this response; only its hash is stored.
Örnek:
fk_live_8f2c91a7b3d04e5f
400Bad RequestError
invalid_name(1-60 characters),invalid_scope(an unknown scope, or an emptyscopeslist) orinvalid_body.errorobjectzorunlu5 alan
codestringzorunluStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Örnek:
region_unavailablemessagestringzorunluPlain English, for developers
regionstringboş olabilirRegion that produced the error, if any
Değerler:
EUTRretryablebooleanzorunludetailsobject
401UnauthorizedError
Missing or invalid key or token. The Management API answers
missing_api_key(no Bearer token) orinvalid_api_key(unknown or revoked secret key or organization API key).errorobjectzorunlu5 alan
codestringzorunluStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Örnek:
region_unavailablemessagestringzorunluPlain English, for developers
regionstringboş olabilirRegion that produced the error, if any
Değerler:
EUTRretryablebooleanzorunludetailsobject
403ForbiddenError
missing_scope(the role or scopes of the key, or the dashboard role, lack the scope),secret_key_not_allowed(a secret key called an endpoint for the whole organization) ornot_a_member(X-Fox-Tenant names a tenant the caller does not belong to).errorobjectzorunlu5 alan
codestringzorunluStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Örnek:
region_unavailablemessagestringzorunluPlain English, for developers
regionstringboş olabilirRegion that produced the error, if any
Değerler:
EUTRretryablebooleanzorunludetailsobject