api_key_organization_forbidden
Developer and IT administrator messages for api_key_organization_forbidden.
Since API version 1.0.
| Field | Value |
|---|---|
| Type | permission |
| Status | 403 |
| Surfaces | api |
| Retryable | No |
What it means
Section titled “What it means”The request was made with an API key limited to one organization, and the route either names another organization or does not name one at all. An organization key may call routes with {org} in the path and the list routes that filter by an organization query parameter, with its own organization in that place. Routes that reach a resource by its ID alone (a connection, directory, user, passkey, M2M client, webhook endpoint or import switch) are refused for organization keys, because the ID does not prove which organization the resource belongs to.
Likely causes
Section titled “Likely causes”- The path or the
organizationquery parameter names a different organization than the key’s. - The route is an ID-only route such as
GET /orv1/ connections/ {conn} PATCH /v1/users/{user}. - A list route was called without
organization=<the key's organization>. - The route reads
organizationfrom the query but does not filter by it, so the parameter does not count.
How to fix it
Section titled “How to fix it”For developers
Section titled “For developers”- For lists, add
organization=<org_id>with the key’s own organization, for exampleGET /.v1/ connections? organization=org_. . . - For ID-only routes, use an environment-wide secret key on your server; keep organization keys for work that names its organization.
- See organization-scoped API keys for the full list of allowed routes.
For IT administrators
Section titled “For IT administrators”- Ask the app’s team to use a key that covers this organization.
Example
Section titled “Example”HTTP status 403 when an organization key reads a connection by ID:
{ "error": { "type": "permission", "code": "api_key_organization_forbidden", "message": "The key is limited to one organization and this request is outside it", "doc_url": "https://docs.ohauthcat.com/errors/api_key_organization_forbidden", "request_id": "req_01J9Z3K5V7W8X9Y0Z1A2B3C4D5" }}Developer message
Section titled “Developer message”The key is limited to one organization and this request is outside it
IT administrator message
Section titled “IT administrator message”This key can’t access that organization
Translated IT administrator messages
Section titled “Translated IT administrator messages”The hosted portal shows these machine translations, which native speakers have not reviewed yet. Placeholders and identity provider console labels stay in English.
de: Dieser Schlüssel hat keinen Zugriff auf diese Organisationes: Esta clave no puede acceder a esa organizaciónfr: Cette clé ne peut pas accéder à cette organisationja: このキーではその組織にアクセスできませんpt-BR: Esta chave não pode acessar essa organização
Security invariants: 57.