Skip to main content
POST
cURL
Creates the account with your accountId if it doesn’t exist, else updates it:
  • name sets its label. null clears it; omit it to keep it.
  • addCustomerIds adds customers, removeCustomerIds takes them out, at most 100 IDs each. A customer in both lists is 400 invalid_request. Adding a customer already in the account, or removing one that isn’t in it, changes nothing.
  • A customer in another account is refused with 409 customer_in_other_account, with that account in accountId, unless move is true, which moves it.
  • An unknown customer in addCustomerIds returns 404 customer_not_found, with its ID in customerId.
The request is all or nothing: a refusal changes nothing, and doesn’t create the account. Removing the last customer leaves the account, empty. The response is the account, with customerIds sorted. Accounts are display only: no customer’s plans, balance or invoices change. Needs the Customers permission at Write.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
accountId
string
required

Your ID for the account, such as your company or team ID. Created if new.

Required string length: 1 - 255
name
string | null

A label for the account, such as the company's name. Null clears it; omit to keep it.

Required string length: 1 - 255
addCustomerIds
string[]

Customers to add, at most 100. One already in this account is left as it is.

Maximum array length: 100

Your ID for the customer, such as your user ID.

Required string length: 1 - 255
removeCustomerIds
string[]

Customers to take out, at most 100. One not in this account is left as it is.

Maximum array length: 100

Your ID for the customer, such as your user ID.

Required string length: 1 - 255
move
boolean

Move customers in addCustomerIds out of another account. Without it, a customer in another account is refused with customer_in_other_account.

Response

The account, created or updated

accountId
string
required
name
string | null
required
customerIds
string[]
required

The customers in the account, sorted. Empty once the last one leaves: the account is kept.

createdAt
string<date-time>
required
updatedAt
string<date-time>
required