inviteAccountToOrganization

Sends an invitation to another account to join your organization as a member account. Organizations sends email on your behalf to the email address that is associated with the other account's owner. The invitation is implemented as a Handshake whose details are in the response.

If you receive an exception that indicates that you exceeded your account limits for the organization or that the operation failed because your organization is still initializing, wait one hour and then try again. If the error persists after an hour, contact Amazon Web Services Support.

If the request includes tags, then the requester must have the organizations:TagResource permission.

This operation can be called only from the organization's management account.

Samples

import aws.sdk.kotlin.services.organizations.model.HandshakeParty
import aws.sdk.kotlin.services.organizations.model.HandshakePartyType

fun main() { 
   //sampleStart 
   // The following example shows the admin of the master account owned by bill example. com inviting the
// account owned by juan example. com to join an organization.
val resp = organizationsClient.inviteAccountToOrganization {
    notes = "This is a request for Juan's account to join Bill's organization"
    target = HandshakeParty {
        type = HandshakePartyType.fromValue("EMAIL")
        id = "juan@example.com"
    }
} 
   //sampleEnd
}