API call description
For example, DingTalk Organization A has two Enterprise Accounts, Enterprise Account A1 and Enterprise Account A2. Enterprise Account A1 is the creator of another organization named DingTalk Organization B (which can be viewed in the OA admin console of the current test organization under Security and Permissions > Super Admin list). Call this API to change the creator of DingTalk Organization B from Enterprise Account A1 to Enterprise Account A2.Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/contact/orgAccounts/mainAdministrators/change |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Required permissions | permission-Contact.OrgAccountSecurity.ReadWrite-Read and write permissions for Contacts Enterprise Account security data |
Request header
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it by calling the Get the access token of an internal app API. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| sourceUserId | String | Yes | The user ID of the source Enterprise Account. Obtain it in one of the following four ways: - Obtain the user ID by mobile phone number - Create an SSO Enterprise Account - Create a DingTalk self-built Enterprise Account - Invite Enterprise Accounts from other organizations to join |
| targetUserId | String | Yes | The user ID of the target dedicated account. Obtain it in one of the following four ways: - Obtain the user ID by mobile phone number - Create an SSO Enterprise Account - Create a DingTalk self-built Enterprise Account - Invite Enterprise Accounts from other organizations to join |
| effectCorpId | String | Yes | The organization ID of the organization to be transferred. For details, see Basic concepts - CorpId. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| result | Boolean | The result of the transfer operation. |
Response body example
Error codes
If an error occurs when calling this API, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | not.main.administrator | Not the Super Admin (creator) | Not the Super Admin (creator) |
| 400 | exclusive.account.limit | Only dedicated accounts belonging to this organization can be operated on | Only dedicated accounts belonging to this organization can be operated on |
| 400 | profile.not.exist | Account does not exist | Account does not exist |
| 400 | employee.not.exist | Employee does not exist | Employee does not exist |
| 400 | invalid.param | Invalid parameter | sourceUserId, targetUserId, and effectCorpId cannot be empty, and effectCorpId must be the ID of an existing organization |
| 500 | system.busy | The system is busy. Try again later. | The system is busy. Try again later. |