curl -X GET "https://api.danubeai.com/v1/claude-code/org-context" \
-H "danube-api-key: YOUR_API_KEY"
curl -X GET "https://api.danubeai.com/v1/claude-code/org-context?org_id=8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10" \
-H "danube-api-key: YOUR_API_KEY"
{
"user_id": "3f2b1c8e-9a7d-4e6f-b5c4-2d1e0f9a8b7c",
"org_id": "8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10",
"org_name": "Acme Robotics",
"org_slug": "acme-robotics",
"role": "admin"
}
Claude Code
Get Org Context
Resolve which organization the caller operates under, and their role in it
GET
/
v1
/
claude-code
/
org-context
curl -X GET "https://api.danubeai.com/v1/claude-code/org-context" \
-H "danube-api-key: YOUR_API_KEY"
curl -X GET "https://api.danubeai.com/v1/claude-code/org-context?org_id=8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10" \
-H "danube-api-key: YOUR_API_KEY"
{
"user_id": "3f2b1c8e-9a7d-4e6f-b5c4-2d1e0f9a8b7c",
"org_id": "8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10",
"org_name": "Acme Robotics",
"org_slug": "acme-robotics",
"role": "admin"
}
Overview
Returns the organization context for the caller: the profile ID, the organization, and the caller’s role in it. The Danube MCP server uses it to attribute requests to an organization. Clients can use it to learn which organization a key is bound to before generating a team.mcp.json (see Get MCP JSON).
Auth: Accepts either JWT or API key (danube-api-key header).
Resolution order:
- An explicit organization selector, the
org_idquery parameter or thedanube-org-idheader (the query parameter wins when both are sent). The caller must be a member. A non-member gets404, not403, so organization IDs are not leaked. - Otherwise, for an API key caller, the organization the key is bound to. Keys without a bound organization fall back to the owner’s personal organization.
- Otherwise, for a JWT caller, the personal organization.
Query Parameters
string
Organization UUID to resolve. Requires membership.
Headers
string
Same as
org_id. Ignored when the query parameter is present.Response
string
The caller’s profile ID
string
The resolved organization UUID
string
Organization display name.
null if the organization row could not be loaded.string
Organization URL slug.
null if the organization row could not be loaded.string
The caller’s role in the organization:
owner, admin, member or viewer. null if the key’s owner is not a member of the key’s bound organization.Errors
| Code | Meaning |
|---|---|
| 401 | No credentials, or no profile exists for the caller |
| 404 | The selected organization does not exist or the caller is not a member, or no organization could be resolved |
Example
curl -X GET "https://api.danubeai.com/v1/claude-code/org-context" \
-H "danube-api-key: YOUR_API_KEY"
curl -X GET "https://api.danubeai.com/v1/claude-code/org-context?org_id=8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10" \
-H "danube-api-key: YOUR_API_KEY"
{
"user_id": "3f2b1c8e-9a7d-4e6f-b5c4-2d1e0f9a8b7c",
"org_id": "8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10",
"org_name": "Acme Robotics",
"org_slug": "acme-robotics",
"role": "admin"
}
