Organizations
The organizations the authenticated user belongs to.
Answers for the person an OAuth access token or personal access token was issued to, not for the organization. Organization API keys identify no user and are refused.
List the organizations the authenticated user is a member of, with the user's own role in each. The organization the token was issued for is marked current. Returns the organizations the OAuth organization selection screen offers, plus the token's own organization: current memberships only, never another member's. Membership is read on every request, so leaving an organization or a role change shows on the next call.
Requires an OAuth access token or a personal access token. An organization API key identifies no user and is refused with 403 and code user_credential_required.
An organization API key, sent as Authorization: Bearer <key>. A key carries one scope for the whole API: a read key reaches the GET endpoints, a write key reaches all of them. A crnts_pat_ personal access token is accepted as a Bearer while its owner remains an eligible administrator in its active organization. Each operation requires the corresponding scope stored on that token.
Successful response
Authentication failed
The credential authenticated but is not permitted to use this endpoint. Five refusals share the status: a read API key on an endpoint that writes, an OAuth token that was not granted the scope the endpoint needs (insufficient_scope), an OAuth token that was granted it but whose holder no longer has a role permitting it (insufficient_role), an OAuth token on an endpoint that accepts an API key and nothing else (api_key_required), and an API key on an endpoint that answers for a user (user_credential_required). Discriminate on code rather than on the message, which is free-form. The first refusal predates the codes and sets none. Only insufficient_scope carries the challenge header, because it is the only one a client can act on by re-authorizing.
GET /v1/me/organizations HTTP/1.1
Host: api.currents.dev
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"status": "OK",
"data": [
{
"orgId": "text",
"name": "text",
"role": "admin",
"current": true
}
]
}Last updated
Was this helpful?