All Products
Search
Document Center

Resource Management:InviteAccountToResourceDirectory

Last Updated:Jul 25, 2025

Invites an account to join a resource directory.

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

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
resourcemanager:InviteAccountToResourceDirectorycreate
*Handshake
acs:resourcemanager:*:{#accountId}:handshake/*
*Folder
acs:resourcemanager:*:{#accountId}:folder/{#ResourceDirectoryPath}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TargetEntitystringYes

The ID or logon email address of the account that you want to invite.

someone@example.com
TargetTypestringYes

The type of the invited account. Valid values:

  • Account: indicates the ID of the account.
  • Email: indicates the logon email address of the account.
Email
NotestringNo

The description of the invitation.

The description can be up to 1,024 characters in length.

Welcome
Tagarray<object>No

The tags.

objectNo

The tags.

KeystringNo

The tag key.

k1
ValuestringNo

The tag value.

v1
ParentFolderIdstringNo

The ID of the parent folder.

r-b1****

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

RequestIdstring

The ID of the request.

9B34724D-54B0-4A51-B34D-4512372FE1BE
Handshakeobject

The information about the invitation.

Statusstring

The status of the invitation. Valid values:

  • Pending
  • Accepted
  • Cancelled
  • Declined
  • Expired
Pending
ExpireTimestring

The time when the invitation expires. The time is displayed in UTC.

2018-08-24T09:55:41Z
ResourceDirectoryIdstring

The ID of the resource directory.

rd-abcdef****
CreateTimestring

The time when the invitation was created. The time is displayed in UTC.

2018-08-10T09:55:41Z
Notestring

The description of the invitation.

Welcome
TargetEntitystring

The ID or logon email address of the invited account.

someone@example.com
MasterAccountIdstring

The ID of the management account of the resource directory.

172841235500****
MasterAccountNamestring

The name of the management account of the resource directory.

Alice
ModifyTimestring

The time when the invitation was modified. The time is displayed in UTC.

2018-08-10T09:55:41Z
TargetTypestring

The type of the invited account. Valid values:

  • Account: indicates the ID of the account.
  • Email: indicates the logon email address of the account.
Email
HandshakeIdstring

The ID of the invitation.

h-ycm4rp****

Examples

Sample success responses

JSONformat

{
  "RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE",
  "Handshake": {
    "Status": "Pending",
    "ExpireTime": "2018-08-24T09:55:41Z",
    "ResourceDirectoryId": "rd-abcdef****",
    "CreateTime": "2018-08-10T09:55:41Z",
    "Note": "Welcome\n",
    "TargetEntity": "someone@example.com",
    "MasterAccountId": "172841235500****",
    "MasterAccountName": "Alice",
    "ModifyTime": "2018-08-10T09:55:41Z",
    "TargetType": "Email",
    "HandshakeId": "h-ycm4rp****"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameter.TargetEntityYou must specify TargetEntity.-
400InvalidParameter.TargetEntityThe TargetEntity is invalid.-
400MissingParameter.TargetTypeYou must specify TargetType.-
400InvalidParameter.TargetTypeThe TargetType is invalid.-
400InvalidParameter.Note.LengthThe length of the invitation note exceeds the limit.-
400InvalidParameter.NoteThe Note is invalid.-
400InvalidParameter.ParentFolderIdThe ParentFolderId is invalid.The value of the ParentFolderId parameter is invalid. The value must start with r- followed by 6 characters or start with fd- followed by 10 characters. Valid characters include letters and digits.
400InvalidParameter.AccountIdThe AccountId is invalid.The value of the AccountId parameter is invalid. Specify a 16-digit ID.
404EntityNotExists.ResourceDirectoryThe resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account.The account is not used to enable a resource directory. Use the account to enable a resource directory first.
404EntityNotExists.FolderThe resource directory folder does not exist.The specified folder does not exist. Create such a folder first.
409LimitExceeded.AccountThe maximum number of member accounts in a resource directory exceeds the limit.The number of members in the resource directory exceeds the upper limit.
409LimitExceeded.InvitationRateThe number of invitations sent exceeds the limit.-
409EntityAlreadyExists.HandshakeHandshakes with the same target entity already exist.-
409Invalid.AccountTypeThe specified profile type of account is invalid.The account type is invalid. Use an enterprise account.
409EntityAlreadyExists.ResourceDir.AccountThis resource directory account already exists.The email address that is generated by the system when the member is created already exists. Try again later.
409LimitExceeded.Invitation.InvalidTargetThe maximum number of invalid targets that can be invited by a single account is exceeded.The number of invalid accounts invited by the same account exceeds the upper limit.
409NotSupport.AccountInAnotherResourceDirectoryThe invited account already belongs to another resource directory. To continue, remove the account from the other resource directory.The invited account already belongs to another resource directory. To continue, remove the account from the other resource directory.
409LegalEntityMismatchThe account does not have the same legal entity as the management account.The account does not have the same legal entity as the management account.

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

Change history

Change timeSummary of changesOperation
2023-12-08The Error code has changedView Change Details
2023-10-25The Error code has changedView Change Details
2023-09-04The Error code has changedView Change Details
2023-05-24The Error code has changedView Change Details
2023-04-28The Error code has changed. The request parameters of the API has changedView Change Details