All Products
Search
Document Center

Identity as a Service:GetOrganizationalUnitIdByExternalId

Last Updated:Jul 31, 2025

Obtains the ID of an organizational unit based on the external ID

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/{instanceId}/{applicationId}/organizationalUnits/_/actions/getOrganizationalUnitIdByExternalId HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
AuthorizationstringYes

The authentication information. Format: Bearer ${access_token}. Example: Bearer ATxxxx.

Bearer AT8csE2seYxxxxxij
instanceIdstringYes

The instance ID.

idaas_ue2jvisn35ea5lmthk267xxxxx
applicationIdstringYes

The application ID.

app_mkv7rgt4d7i4u7zqtzev2mxxxx
bodyobjectNo

The request body.

organizationalUnitExternalIdstringYes

The external ID of the organizational unit. The external ID can be used to map external data to the data of the organizational unit in Employee Identity and Access Management (EIAM) of Identity as a Service (IDaaS). By default, the external ID is the organizational unit ID.

Note: For organizational units with the same source type and source ID, each organizational unit has a unique external ID.

ou_wovwffm62xifdziem7an7xxxxx
organizationalUnitSourceTypestringYes

The source type of the organizational unit. Valid values:

  • build_in: The organizational unit was created in IDaaS.
  • ding_talk: The organizational unit was imported from DingTalk.
  • ad: The organizational unit was imported from Microsoft Active Directory (AD).
  • ldap: The organizational unit was imported from a Lightweight Directory Access Protocol (LDAP) service.
build_in
organizationalUnitSourceIdstringYes

The source ID of the organizational unit.

If the organizational unit was created in IDaaS, its source ID is the ID of the IDaaS instance. If the organizational unit was imported, its source ID is the enterprise ID in the source. For example, if the organizational unit was imported from DingTalk, its source ID is the corpId value of the enterprise in DingTalk.

idaas_ue2jvisn35ea5lmthk267xxxxx

Response parameters

ParameterTypeDescriptionExample
object

OrganizationalUnitIdObject

organizationalUnitIdstring

The ID of the organizational unit.

ou_wovwffm62xifdziem7an7xxxxx

Examples

Sample success responses

JSONformat

{
  "organizationalUnitId": "ou_wovwffm62xifdziem7an7xxxxx"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-24The internal configuration of the API is changed, but the call is not affectedView Change Details