API/Current Organization API Mastrao

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/me

Authentication

Create an organization API key from the organization settings page:

/orgs/{orgSlug}/settings/api-keys

Send the key with x-api-key:

x-api-key: YOUR_API_KEY

Bearer authentication is also accepted:

Authorization: Bearer YOUR_API_KEY

The credential must include the organization:read scope.

Response

FieldTypeDescription
organization.idstringOrganization id
organization.namestringOrganization display name
organization.slugstring | nullOrganization slug used in app URLs

Examples

cURL

curl -H "x-api-key: YOUR_API_KEY" \
  https://app.mastrao.com/api/v1/me

JavaScript

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

StatusDescription
401Missing, invalid, or inactive key
403Missing organization:read scope
429Rate limit reached; see the retry-after header
503Credential verification unavailable
404The key's organization no longer exists
500Internal server error
List Organization Members API Mastrao