All Products
Search
Document Center

Resource Management:AcceptHandshake

Last Updated:Sep 10, 2026

Accepts an invitation by the invited Alibaba Cloud account.

Operation description

After the invited Alibaba Cloud account successfully joins the resource directory, it becomes a member of the resource directory. The resource directory uses the name of the invited Alibaba Cloud account as the member name and account name of the member by default.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

resourcemanager:AcceptHandshake

update

*Handshake

acs:resourcemanager::{#accountId}:handshake/{#HandshakeId}

None None

Request parameters

Parameter

Type

Required

Description

Example

HandshakeId

string

Yes

The handshake ID.

You can invoke ListHandshakesForAccount to obtain the handshake ID.

This operation must be invoked by the invited Alibaba Cloud account or an authorized Resource Access Management (RAM) user of the invited account. The management account of the inviter cannot accept the invitation on behalf of the invited account. This operation requires authorization from the invited account.

h-Ih8IuPfvV0t0****

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

5828C836-3286-49A6-9006-15231BB19342

Handshake

object

The handshake information.

Status

string

The status of the handshake. Valid values:

  • Pending: Waiting for confirmation.

  • Accepted: Accepted.

  • Cancelled: Canceled.

  • Declined: Rejected.

  • Expired: Expired.

Accepted

ExpireTime

string

The expiration time of the handshake (UTC).

2021-01-20T02:15:40Z

ResourceDirectoryId

string

The resource directory ID.

rd-3G****

CreateTime

string

The creation time of the handshake (UTC).

2021-01-06T02:15:40Z

Note

string

The remarks.

Welcome to join us

TargetEntity

string

The Alibaba Cloud account ID or logon mailbox of the invited account.

177242285274****

MasterAccountId

string

The ID of the management account of the resource directory.

151266687691****

MasterAccountName

string

The name of the management account of the resource directory.

CompanyA

ModifyTime

string

The modification time of the handshake (UTC).

2021-01-06T02:16:40Z

TargetType

string

The type of the invited Alibaba Cloud account. Valid values:

  • Account: Alibaba Cloud account ID.

  • Email: logon email address of the Alibaba Cloud account.

Account

HandshakeId

string

The handshake ID.

h-Ih8IuPfvV0t0****

Examples

Success response

JSON format

{
  "RequestId": "5828C836-3286-49A6-9006-15231BB19342",
  "Handshake": {
    "Status": "Accepted",
    "ExpireTime": "2021-01-20T02:15:40Z",
    "ResourceDirectoryId": "rd-3G****",
    "CreateTime": "2021-01-06T02:15:40Z",
    "Note": "Welcome\n",
    "TargetEntity": "177242285274****",
    "MasterAccountId": "151266687691****",
    "MasterAccountName": "CompanyA",
    "ModifyTime": "2021-01-06T02:16:40Z",
    "TargetType": "Account",
    "HandshakeId": "h-Ih8IuPfvV0t0****"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 MissingParameter.HandshakeId You must specify HandshakeId.
400 InvalidParameter.HandshakeId The HandshakeId is invalid. The value of the HandshakeId parameter is invalid. The value must start with h- followed by 16 letters or digits.
404 EntityNotExists.Handshake The specified handshake does not exist.
404 SpecifiedResourceDirectoryNotExists The specified resource directory does not exist. You must specify a valid resource directory. The specified resource directory does not exist. Specify a valid resource directory.
409 HandshakeStatusMismatch The invitation is invalid. The invitation is invalid.
409 NotSupport.AccountInAnotherResourceDirectory Your account is a management account for another resource directory or a member of another resource directory.
409 Invalid.AccountType The specified profile type of account is invalid. The account type is invalid. Use an enterprise account.
409 NotSupport.Account.RealNameType Your account is not a real-name of enterprise type, so you cannot accept the invitation. You cannot accept the invitation because your account does not pass enterprise real-name verification.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.