Menu
AWS Organizations API Reference
API Reference (API Version 2016-11-28)

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.

Important

You can invite AWS accounts only from the same seller as the master account. For example, if your organization's master account was created by Amazon Internet Services Pvt. Ltd (AISPL), an AWS seller in India, then you can only invite other AISPL accounts to your organization. You can't combine accounts from AISPL and AWS, or any other AWS seller. For more information, see Consolidated Billing in India.

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

Important

If you get an exception that indicates that you exceeded your account limits for the organization or that you can"t add an account because your organization is still initializing, please contact AWS Customer Support.

Request Syntax

{
   "Notes": "string",
   "Target": { 
      "Id": "string",
      "Type": "string"
   }
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Notes

Additional information that you want to include in the generated email to the recipient account owner.

Type: String

Length Constraints: Maximum length of 1024.

Required: No

Target

The identifier (ID) of the AWS account that you want to invite to join your organization. This is a JSON object that contains the following elements:

{ "Type": "ACCOUNT", "Id": "< account id number >" }

If you use the AWS CLI, you can submit this as a single string, similar to the following example:

--target Id=123456789012,Type=ACCOUNT

If you specify "Type": "ACCOUNT", then you must provide the AWS account ID number as the Id. If you specify "Type": "EMAIL", then you must specify the email address that is associated with the account.

--target Id=bill@example.com,Type=EMAIL

Type: HandshakeParty object

Required: Yes

Response Syntax

{
   "Handshake": { 
      "Action": "string",
      "Arn": "string",
      "ExpirationTimestamp": number,
      "Id": "string",
      "Parties": [ 
         { 
            "Id": "string",
            "Type": "string"
         }
      ],
      "RequestedTimestamp": number,
      "Resources": [ 
         { 
            "Resources": [ 
               "HandshakeResource"
            ],
            "Type": "string",
            "Value": "string"
         }
      ],
      "State": "string"
   }
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Handshake

A structure that contains details about the handshake that is created to support this invitation request.

Type: Handshake object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide.

HTTP Status Code: 400

AWSOrganizationsNotInUseException

Your account is not a member of an organization. To make this request, you must use the credentials of an account that belongs to an organization.

HTTP Status Code: 400

ConcurrentModificationException

The target of the operation is currently being modified by a different request. Try again later.

HTTP Status Code: 400

DuplicateHandshakeException

A handshake with the same action and target already exists. For example, if you invited an account to join your organization, the invited account might already have a pending invitation from this organization. If you intend to resend an invitation to an account, ensure that existing handshakes that might be considered duplicates are canceled or declined.

HTTP Status Code: 400

FinalizingOrganizationException

AWS Organizations could not finalize the creation of your organization. Try again later. If this persists, contact AWS customer support.

HTTP Status Code: 400

HandshakeConstraintViolationException

The requested operation would violate the constraint identified in the reason code.

Note

Some of the reasons in the following list might not be applicable to this specific API or operation:

  • ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on the number of accounts in an organization. Note: deleted and closed accounts still count toward your limit.

    Important

    If you get an exception that indicates that you exceeded your account limits for the organization or that you can"t add an account because your organization is still initializing, please contact AWS Customer Support.

  • HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of handshakes you can send in one day.

  • ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because the invited account is already a member of an organization.

  • ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid because the organization has already enabled all features.

  • INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You cannot issue new invitations to join an organization while it is in the process of enabling all features. You can resume inviting accounts after you finalize the process when all accounts have agreed to the change.

  • PAYMENT_INSTRUMENT_REQUIRED: You cannot complete the operation with an account that does not have a payment instrument, such as a credit card, associated with it.

  • ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because the account is from a different marketplace than the accounts in the organization. For example, accounts with India addresses must be associated with the AISPL marketplace. All accounts in an organization must be from the same marketplace.

  • ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to change the membership of an account too quickly after its previous change.

HTTP Status Code: 400

InvalidInputException

The requested operation failed because you provided invalid values for one or more of the request parameters. This exception includes a reason that contains additional information about the violated limit:

Note

Some of the reasons in the following list might not be applicable to this specific API or operation:

  • INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, organization, or email) as a party.

  • INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid ARN for the organization.

  • INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID.

  • INVALID_ENUM: You specified a value that is not valid for that parameter.

  • INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid characters.

  • INVALID_LIST_MEMBER: You provided a list to a parameter that contains at least one invalid value.

  • MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer than allowed.

  • MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger value than allowed.

  • MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter than allowed.

  • MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller value than allowed.

  • IMMUTABLE_POLICY: You specified a policy that is managed by AWS and cannot be modified.

  • INVALID_PATTERN: You provided a value that doesn't match the required pattern.

  • INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't match the required pattern.

  • INPUT_REQUIRED: You must include a value for all required parameters.

  • INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter from the response to a previous call of the operation.

  • MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter for the operation.

  • MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only between entities in the same root.

HTTP Status Code: 400

ServiceException

AWS Organizations can't complete your request because of an internal service error. Try again later.

HTTP Status Code: 400

TooManyRequestsException

You've sent too many requests in too short a period of time. The limit helps protect against denial-of-service attacks. Try again later.

HTTP Status Code: 400

Example

The following example shows the master account owned by bill@example.com inviting the account owned by juan@example.com to join an organization:

Sample Request

POST / HTTP/1.1
Host: organizations.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 53
X-Amz-Target: AWSOrganizationsV20161128.InviteAccountToOrganization
X-Amz-Date: 20161213T191417Z
User-Agent: aws-cli/1.11.13 Python/2.7.8 Linux/3.2.45-0.6.wd.865.49.315.metal1.x86_64 botocore/1.4.70
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 
  Credential=AKIAIOSFODNN7EXAMPLE/20161130/us-east-1/organizations/aws4_request, 
  SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, 
  Signature=EXAMPLESIGabcdef1234567890abcdef1234567890abcdef123456EXAMPLESIG

{ "Notes": "This is a request for Juan's account to join Bill's organization", "Target": {"Type": "EMAIL", "Id": "juan@example.com"} }

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: EXAMPLE8-90ab-cdef-fedc-ba987EXAMPLE
Content-Type: application/x-amz-json-1.1
Content-Length: 644
Date: Tue, 13 Dec 2016 19:14:20 GMT

{
  "Handshake": {
    "Action": "INVITE",
    "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111",
    "ExpirationTimestamp": 1482952459.257,
    "Id": "h-examplehandshakeid111",
    "Parties": [
      {
        "Id": "o-exampleorgid",
        "Type": "ORGANIZATION"
      },
      {
        "Id": "juan@example.com",
        "Type": "EMAIL"
      }
    ],
    "RequestedTimestamp": 1481656459.257,
    "Resources": [
      {
        "Resources": [
          {
            "Type": "MASTER_EMAIL",
            "Value": "bill@amazon.com"
          },
          {
            "Type": "MASTER_NAME",
            "Value": "Org Master Account"
          },
          {
            "Type": "ORGANIZATION_FEATURE_SET",
            "Value": "FULL"
          }
        ],
        "Type": "ORGANIZATION",
        "Value": "o-exampleorgid"
      },
      {
        "Type": "EMAIL",
        "Value": "juan@example.com"
      }
    ],
    "State": "OPEN"
  }
}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: