Update a customer unit
Changes only the fields sent; externalId can’t be changed, and an archived unit can’t be changed. Changing parent moves the unit with everything under it, and fails for the root or a move under the unit’s own subtree; the unit’s spend in the running period moves with it toward its new ancestors’ spending limits. A change to billable applies to usage received afterwards, the root is always billable, and billable: false needs non-billable units enabled on your account. metadata replaces the whole map, so send every key to keep; it is refused for a unit whose saved metadata holds values other than strings, which a replace would lose. An update that changes nothing returns the unit as it is. {customer} takes the customer’s cus_ ID, your externalId, or one of its aliases. {unit} takes the unit’s cu_ ID or your unit externalId, resolved within that customer; a value starting cu_ is tried as a Paid ID first.
Authentication
Path parameters
The customer’s cus_ ID, your externalId, or one of its aliases.
The unit’s cu_ ID or your externalId, within that customer. A value starting cu_ is tried as a Paid ID first.
Headers
This endpoint is in the customer_units=v1 beta. Send this header to use it.
Request
Whether usage on the unit is billable. false makes the unit, and everything under it, non-billable, and needs non-billable units enabled on your account. The root is always billable, and a change applies to usage received afterwards.
Your label for the unit’s level, such as team, environment or user, or null. Paid gives it no meaning. Null clears it.
Replaces the unit’s whole metadata map; keys left out are removed. Refused for a unit whose saved metadata holds values other than strings.
Moves the unit, with everything under it, under this active unit of the same customer: its cu_ ID or your externalId. The root can’t move, and a unit can’t move under itself or a unit below it.
Response
The type of object. Always customerUnit.
When the unit was archived, or null. An archived unit stays readable and in reports, and its externalId stays reserved.
The unit’s own setting: whether usage on it is billable. The root is always billable.
The customer the unit belongs to, by its cus_ ID.
Whether usage on the unit is billed: false when the unit or any unit above it has billable: false. Usage on a unit that isn’t billable is recorded and reported, but costs nothing.
Your ID for the unit, unique across your account ignoring letter case, among unit IDs, customer external IDs and aliases. Only the root may share its customer’s externalId. Can’t change.
Whether this is the customer’s root unit, which stands for the whole customer. A customer created with an externalId gets its root automatically.
Your label for the unit’s level, such as team, environment or user, or null. Paid gives it no meaning.
true for an object on a live account, false on a test account.
String key-value pairs of your own. Values saved before the Date Versioned API that aren’t strings, numbers or booleans are left out.
The unit this one sits under, in the same customer. Null for the root. By cu_ ID.