organizations.find()

Retrieve a single Organization by ID.

Definition

client.organizations.find(
organizationId: string
):Promise<Organization,Error>

Parameters

NameTypeDescription
organizationIdstring|OrganizationAn organization ID

Returns

An error will be thrown if any of the arguments are invalid.

If the organization is not found, an error will be thrown with err.code equal to client.errors.NotFoundError.code.

Otherwise, once the returned Promise is resolved, you will have access to the Organization.

Examples

try {
const organization = await client.organizations.find(
'some-organization-id'
);
console.log(
'found organization',
organization.displayName
);
} catch (err) {
if (err.code === client.errors.NotFoundError.code) {
console.log('Organization not found');
} else {
console.log('Error');
}
}