Current Organization API Mastrao
Retrieve the organization attached to an API key.
Retrieve the organization that owns the API key. Use this endpoint when an integration needs to identify the key's workspace.
Endpoint
GET /api/v1/meAuthentication
Create an organization API key from the organization settings page:
/orgs/{orgSlug}/settings/api-keysSend the key with x-api-key:
x-api-key: YOUR_API_KEYBearer authentication is also accepted:
Authorization: Bearer YOUR_API_KEYThe credential must include the organization:read scope.
Response
| Field | Type | Description |
|---|---|---|
organization.id | string | Organization id |
organization.name | string | Organization display name |
organization.slug | string | null | Organization slug used in app URLs |
Examples
cURL
curl -H "x-api-key: YOUR_API_KEY" \
https://app.mastrao.com/api/v1/meJavaScript
const response = await fetch("https://app.mastrao.com/api/v1/me", {
headers: {
"x-api-key": "YOUR_API_KEY",
},
});
if (!response.ok) {
throw new Error(`Current organization API failed: ${response.status}`);
}
const data = await response.json();Errors
| Status | Description |
|---|---|
401 | Missing, invalid, or inactive key |
403 | Missing organization:read scope |
429 | Rate limit reached; see the retry-after header |
503 | Credential verification unavailable |
404 | The key's organization no longer exists |
500 | Internal server error |