Skip to main content

Organizations

These functions manage organizations in ThunderID. They are used by higher-level platform SDKs and can be called directly in custom integrations.

getAllOrganizations(config)

Retrieve all organizations accessible to the authenticated user, with optional filtering and pagination.

import { getAllOrganizations } from '@thunderid/javascript'

const result = await getAllOrganizations({
baseUrl: 'https://localhost:8090',
limit: 10,
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

result.organizations.forEach(org => console.log(org.name))

Parameters

ParameterTypeRequiredDescription
config.baseUrlstringThunderID base URL
config.filterstringSCIM-style filter expression (e.g., 'name co "acme"')
config.limitnumberMaximum number of organizations to return
config.recursivebooleanInclude descendant organizations recursively
config.fetcherfunctionCustom fetch function override
config.headersRecord<string, string>Additional request headers

Response: AllOrganizationsApiResponse

PropertyTypeDescription
organizationsOrganization[]List of organizations
hasMorebooleanWhether more results are available
nextCursorstringCursor for the next page
totalCountnumberTotal number of matching organizations

getMeOrganizations(config)

Retrieve the organizations associated with the currently authenticated user.

import { getMeOrganizations } from '@thunderid/javascript'

const orgs = await getMeOrganizations({
baseUrl: 'https://localhost:8090',
limit: 20,
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Parameters

ParameterTypeRequiredDescription
config.baseUrlstringThunderID base URL
config.afterstringCursor for forward pagination
config.beforestringCursor for backward pagination
config.authorizedAppNamestringFilter by authorized application name
config.filterstringFilter expression
config.limitnumberMaximum results
config.recursivebooleanInclude descendant organizations
config.fetcherfunctionCustom fetch function override
config.headersRecord<string, string>Additional request headers

Response: Organization[]


getOrganization(config)

Retrieve details for a specific organization by ID.

import { getOrganization } from '@thunderid/javascript'

const org = await getOrganization({
baseUrl: 'https://localhost:8090',
organizationId: '<org-id>',
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

console.log(org.name, org.orgHandle)

Parameters

ParameterTypeRequiredDescription
config.baseUrlstringThunderID base URL
config.organizationIdstringUUID of the organization
config.fetcherfunctionCustom fetch function override
config.headersRecord<string, string>Additional request headers

Response: OrganizationDetails

PropertyTypeDescription
idstringOrganization UUID
namestringOrganization display name
orgHandlestringURL-safe organization handle
parentobjectParent organization reference
permissionsstring[]Permissions the requester has on this organization
attributesobject[]Custom organization attributes

createOrganization(payload, config)

Create a new organization.

import { createOrganization } from '@thunderid/javascript'

const org = await createOrganization({
baseUrl: 'https://localhost:8090',
payload: {
name: 'ACME Corp',
orgHandle: 'acme-corp',
description: 'ACME Corporation',
parentId: '<parent-org-id>',
type: 'TENANT',
},
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Parameters

ParameterTypeRequiredDescription
config.baseUrlstringThunderID base URL
config.payloadCreateOrganizationPayloadOrganization creation payload
config.payload.namestringOrganization display name
config.payload.orgHandlestringURL-safe handle. Auto-derived from name if omitted
config.payload.descriptionstringOrganization description
config.payload.parentIdstringParent organization UUID
config.payload.typestringOrganization type (e.g., 'TENANT')
config.fetcherfunctionCustom fetch function override

Response: Organization


updateOrganization(config)

Update an organization's attributes using PATCH operations.

import { updateOrganization, createPatchOperations } from '@thunderid/javascript'

const updated = await updateOrganization({
baseUrl: 'https://localhost:8090',
organizationId: '<org-id>',
operations: createPatchOperations({ description: 'Updated description' }),
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Parameters

ParameterTypeRequiredDescription
config.baseUrlstringThunderID base URL
config.organizationIdstringUUID of the organization to update
config.operationsPatchOperation[]Array of PATCH operations
config.fetcherfunctionCustom fetch function override

Response: OrganizationDetails

createPatchOperations(payload)

Helper that converts a plain object into a PatchOperation[] array, using 'REPLACE' for each key.

import { createPatchOperations } from '@thunderid/javascript'

const ops = createPatchOperations({
name: 'New Name',
description: 'New description',
})
// [
// { operation: 'REPLACE', path: 'name', value: 'New Name' },
// { operation: 'REPLACE', path: 'description', value: 'New description' },
// ]

Returns: PatchOperation[]

OperationValue
'REPLACE'Replace the attribute value
'ADD'Add a new value to the attribute
'REMOVE'Remove the attribute

Types

Organization

PropertyTypeDescription
idstringOrganization UUID
namestringDisplay name
orgHandlestringURL-safe organization handle
refstringOrganization resource reference URL
statusstringOrganization status
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.Privacy PolicyCookie Policy