API/Current Organization API

Current Organization API

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

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://nowstack.melvynx.dev/api/v1/me

JavaScript

const response = await fetch("https://nowstack.melvynx.dev/api/v1/me", {
  headers: {
    "x-api-key": process.env.NOWSTACK_API_KEY!,
  },
});

if (!response.ok) {
  throw new Error(`Current organization API failed: ${response.status}`);
}

const data = await response.json();

Errors

StatusDescription
401Missing, invalid, expired, or limited key
404The key's organization no longer exists
500Internal server error