Organization API example

1 minute read

When you need to obtain your organization’s UUID from its domain name, use the Organization API example below. It shows how to call the /v1/organizations endpoint and parse the JSON response so you can automate tenant setup, permission checks, and any downstream API calls that require your organizationId.

Example use case to retrieve an organization ID

Use this endpoint to retrieve your organization’s UUID (organizationId) using its domain name. This endpoint supports partial name matching and returns a list of matching organizations.

Request
curl -G -L 'https://api.cloudbees.io/v1/organizations?name=<domain_name>&userId=<user_id>' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <personal_access_token>'
When using a personal access token (PAT) for authentication, you must include the userId parameter in the request URL.
Response
{ "organizations": [ { "id": "<organization_id>", "displayName": "your organization", "domainName": "<domain_name>" } ] }