Query an Organization

Retrieve an organization's profile, plan, and limits by ID or slug with the organization query.


Use the organization query to fetch a single organization’s profile — its name, owner, plan, access level, and usage limits. Organizations are Organization objects in the API, and each one maps to a workspace group under a single billing account.

The query resolves an organization by ID or slug, but only one the authenticated user is a member of. It is the read counterpart to Create an Organization.

Request

All requests go to https://api.blue.app/graphql with your personal access token headers. See Authentication for how to obtain a token.

query GetOrganization {
  organization(id: "company_123") {
    id
    name
    slug
  }
}
curl https://api.blue.app/graphql \
  -H "Content-Type: application/json" \
  -H "blue-token-id: YOUR_TOKEN_ID" \
  -H "blue-token-secret: YOUR_TOKEN_SECRET" \
  -H "blue-org-id: YOUR_ORG_ID" \
  -d '{"query": "query GetOrganization { organization(id: \"company_123\") { id name slug } }"}'

The id argument accepts either the organization’s ID or its slug, so organization(id: "acme-corp") and organization(id: "clm4n8qwx000008l0g4oxdqn7") resolve the same organization. Header names are case-insensitive.

Parameters

ArgumentTypeRequiredDescription
idStringNoThe organization ID or slug to look up. Resolves only organizations the authenticated user belongs to. When omitted, the query returns an organization the user is a member of (typically the one in your blue-org-id context).
Lookups are scoped to your memberships

The query never reveals organizations you don’t belong to. An ID or slug for an org you aren’t a member of resolves the same as a non-existent one — it raises COMPANY_NOT_FOUND.

Response

{
  "data": {
    "organization": {
      "id": "clm4n8qwx000008l0g4oxdqn7",
      "name": "Acme Corporation",
      "slug": "acme-corp",
      "description": "Operations and delivery teams at Acme.",
      "plan": "pro",
      "tier": "scale",
      "accessLevel": "ADMIN",
      "image": {
        "medium": "https://blue.app/files/companies/clm4n8qwx/medium.png"
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-03-20T14:45:00.000Z"
    }
  }
}

Returns

The query returns a single Organization object. The most useful selectable fields:

FieldTypeDescription
idID!The organization’s unique identifier.
uidString!Short human-readable identifier.
nameString!Display name of the organization.
slugString!URL-friendly identifier, unique per organization.
descriptionStringOptional organization description.
imageImageOrganization logo, with thumbnail/small/medium/large/original URLs.
ownerUserThe organization’s owner. Select fullName, email, etc.
accessLevelUserAccessLevel!Your access level within this organization (see below).
planStringCurrent plan, e.g. "free", "pro", "enterprise".
tierStringCurrent tier label, when set.
workspaceAliasStringThe org’s term for “workspace” when customized.
limitsCompanyLimitsUsage limits and consumption (records, users, storage, etc.).
isBannedBooleanWhether the organization is banned.
createdAtDateTime!ISO 8601 timestamp of creation.
updatedAtDateTime!ISO 8601 timestamp of last update.

UserAccessLevel is one of OWNER, ADMIN, MEMBER, CLIENT, COMMENT_ONLY, or VIEW_ONLY.

Don't use the deprecated relation fields

Organization.customFields and Organization.projects are deprecated. Query custom fields and workspaces through the top-level customFields and projects queries instead — they support filtering and pagination.

Full example

Fetch the full profile including the owner and current usage against limits:

query GetOrganizationDetails {
  organization(id: "acme-corp") {
    id
    uid
    name
    slug
    description
    plan
    tier
    accessLevel
    workspaceAlias
    owner {
      id
      fullName
      email
    }
    image {
      medium
      large
    }
    limits {
      users {
        used
        limit
      }
      storage {
        used
        limit
      }
    }
    createdAt
    updatedAt
  }
}

Errors

CodeWhen
COMPANY_NOT_FOUNDNo organization matches the given ID or slug among the organizations the authenticated user belongs to.

A request made as a banned organization (a banned company in your blue-org-id context) is rejected at the auth layer with COMPANY_BANNED before the query runs — this is not raised by passing a banned org’s ID to organization. See Error Codes for the full list.