Skip to main content

Create or replace a directory sync source

Create or replace a directory sync source. PUT /api/openapi/v1/directory-sync/sources/{sourceId}, scope admin.v1.directory-sync-config.manage.

  • Scope: admin.v1.directory-sync-config.manage
  • Permission: Manage directory sync configuration (directory-sync-config)
  • Permission type: Manage
  • Endpoint: PUT/api/openapi/v1/directory-sync/sources/{sourceId}

Authentication and request headers

Call with an application API key. This endpoint checks only the scope above; read, manage and execute permissions do not imply one another.
NameLocationTypeRequiredDescriptionExample
AuthorizationheaderstringYesApplication API key, passed as a Bearer token.Bearer qwk_***
X-Request-IdheaderstringNoOptional request tracing identifier; generated by the server if omitted.req-20260831-001

Request parameters

NameLocationTypeRequiredDescriptionExample
sourceIdpathstring · uuidRequiredSource ID"<uuid>"
Idempotency-KeyheaderstringRequiredIdempotency key used to prevent duplicate submissions"<string>"
config_revisionbodyinteger · int64NoConfiguration revision1
credentialsbodyOpenapifacadeDirectorySourceCredentialsNoCredentials{"agent_id":"<string>","app_id":"<string>","app_secret":"<string>","bind_dn":"<string>","bind_password":"<string>","client_id":"<string>","client_secret":"<string>","corp_id":"<string>","secret":"<string>","tenant_id":"<string>"}
default_seatbodybooleanRequiredRequest seats for new users by defaultfalse
deletion_alert_emailbodystringNoAlert email"<string>"
deletion_alert_enabledbodybooleanRequiredDeletion alertfalse
deletion_alert_thresholdbodyinteger · int64RequiredDeletion alert threshold0
deletion_policybodystringRequiredOffboarding"delete_user"
initial_scim_tokenbodystringNoInitial SCIM token"<string>"
namebodystringRequiredSource name"<string>"
schedulebodystringRequiredSync frequency"manual"
schedule_anchor_atbodystring · date-timeNoSync time (Beijing time)"2026-08-27T10:00:00Z"
settingsbodyOpenapifacadeDirectorySourceSettingsRequiredSource configuration{"connection":{"client_name":"<string>","tls_enabled":false,"url":"<string>"},"department_mapping":{"external_id":"<string>","name":"<string>","order":"<string>","parent_external_id":"<string>","status":"<string>"},"mapping":{"account":"<string>","department_external_id":"<string>","email":"<string>","employee_no":"<string>","external_id":"<string>","name":"<string>","phone":"<string>","status":"<string>"},"scope":{"base_dn":"<string>","mode":"all","org_unit_external_ids":["<string>"],"org_unit_filter":"<string>","user_filter":"<string>"}}
source_typebodystringRequiredSource type"dingtalk"

Request example

cURL

Responses

200 OK
NameTypeRequiredDescriptionExample
config_revisioninteger · int64YesConfiguration revision0
connection_statusstringYesConnection"<string>"
created_atstring · date-timeYesCreated at"2026-08-27T10:00:00Z"
created_by_emailstringNoCreator email"<string>"
created_by_namestringNoCreated by"<string>"
credential_configuredbooleanYesWhether credentials are configuredfalse
default_seatbooleanYesRequest seats for new users by defaultfalse
deletion_alert_emailstringNoAlert email"<string>"
deletion_alert_enabledbooleanYesDeletion alertfalse
deletion_alert_thresholdinteger · int64YesDeletion alert threshold0
deletion_policystringYesOffboarding"<string>"
external_id_fieldstringYesSource field for the external user ID"<string>"
external_id_field_lockedbooleanYesWhether the external user ID mapping is lockedfalse
idstring · uuidYesSource ID"<uuid>"
last_activity_atstring · date-timeNoLast activity time"2026-08-27T10:00:00Z"
last_connected_atstring · date-timeNoLast connection time"2026-08-27T10:00:00Z"
last_connection_error_codestringNoLast connection error code"<string>"
modified_atstring · date-timeYesUpdated at"2026-08-27T10:00:00Z"
namestringYesSource name"<string>"
next_run_atstring · date-timeNoNext sync time"2026-08-27T10:00:00Z"
schedulestringYesSync frequency"<string>"
schedule_anchor_atstring · date-timeNoSync time (Beijing time)"2026-08-27T10:00:00Z"
settingsOpenapifacadeDirectorySourceSettingsYesSource configuration{"connection":{"client_name":"<string>","tls_enabled":false,"url":"<string>"},"department_mapping":{"external_id":"<string>","name":"<string>","order":"<string>","parent_external_id":"<string>","status":"<string>"},"mapping":{"account":"<string>","department_external_id":"<string>","email":"<string>","employee_no":"<string>","external_id":"<string>","name":"<string>","phone":"<string>","status":"<string>"},"scope":{"base_dn":"<string>","mode":"all","org_unit_external_ids":["<string>"],"org_unit_filter":"<string>","user_filter":"<string>"}}
settings.connectionOpenapifacadeDirectorySourceConnectionYesConnection settings{"client_name":"<string>","tls_enabled":false,"url":"<string>"}
settings.connection.client_namestringNoSCIM Client"<string>"
settings.connection.tls_enabledbooleanNoEnable TLSfalse
settings.connection.urlstringNoServer URL"<string>"
settings.department_mappingOpenapifacadeDirectorySourceDepartmentMappingYesDepartment mappings{"external_id":"<string>","name":"<string>","order":"<string>","parent_external_id":"<string>","status":"<string>"}
settings.department_mapping.external_idstringYesExternal department ID (source field)"<string>"
settings.department_mapping.namestringYesDepartment name (source field)"<string>"
settings.department_mapping.orderstringNoSort order (source field)"<string>"
settings.department_mapping.parent_external_idstringNoExternal parent department ID (source field)"<string>"
settings.department_mapping.statusstringNoStatus (source field)"<string>"
settings.mappingOpenapifacadeDirectorySourceFieldMappingYesMember mappings{"account":"<string>","department_external_id":"<string>","email":"<string>","employee_no":"<string>","external_id":"<string>","name":"<string>","phone":"<string>","status":"<string>"}
settings.mapping.accountstringNoAccount (source field)"<string>"
settings.mapping.department_external_idstringNoExternal department ID for the user's department (source field)"<string>"
settings.mapping.emailstringNoEmail (source field)"<string>"
settings.mapping.employee_nostringNoEmployee ID (source field)"<string>"
settings.mapping.external_idstringYesExternal user ID (source field)"<string>"
settings.mapping.namestringYesUser name (source field)"<string>"
settings.mapping.phonestringNoPhone number (source field)"<string>"
settings.mapping.statusstringNoStatus (source field)"<string>"
settings.scopeOpenapifacadeDirectorySourceScopeYesSync scope{"base_dn":"<string>","mode":"all","org_unit_external_ids":["<string>"],"org_unit_filter":"<string>","user_filter":"<string>"}
settings.scope.base_dnstringNoBase DN"<string>"
settings.scope.modestringYesSync scope type"all"
settings.scope.org_unit_external_idsarray | nullNoScope departments (external department IDs)["<string>"]
settings.scope.org_unit_filterstringNoDepartment filter"<string>"
settings.scope.user_filterstringNoUser filter"<string>"
source_typestringYesSource type"<string>"
statusstringYesStatus"<string>"
updated_by_emailstringNoUpdater email"<string>"
updated_by_namestringNoUpdated by"<string>"
Response example
default Flat business error
NameTypeRequiredDescriptionExample
codestringNoStable business error code"<string>"
detailstringYesHuman-readable error description"<string>"
detailsOpenapiErrorDetailsNoError details{"field":"<string>","reason":"<string>","suggestion":"<string>"}
details.fieldstringNoRequest field that failed validation"<string>"
details.reasonstringNoStable validation failure reason"<string>"
details.suggestionstringNoSuggested normalized value"<string>"
errorstringYesStable HTTP error type"<string>"
Response example