Skip to navigation

Archive a customer unit

Archives the unit. It stays readable and in reports, usage sent to it still lands on it, and its externalId stays reserved. Fails while the unit has active units under it (has_active_children) or an active spend cap (has_active_cap). Archiving an archived unit is status_conflict; a retry with the same Idempotency-Key replays the first archive’s response instead. The root can’t be archived (root_unit_not_archivable). {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

AuthorizationBearer
API Key authentication using Bearer token

Path parameters

customerstringRequired1-255 characters

The customer’s cus_ ID, your externalId, or one of its aliases.

unitstringRequired1-255 characters

The unit’s cu_ ID or your externalId, within that customer. A value starting cu_ is tried as a Paid ID first.

Headers

Paid-BetaenumRequired

This endpoint is in the customer_units=v1 beta. Send this header to use it.

Allowed values:

Response

200
idstring
The unit's ID.
objectenum

The type of object. Always customerUnit.

Allowed values:
createdAtdatetime
When the object was created.
archivedAtdatetime or null

When the unit was archived, or null. An archived unit stays readable and in reports, and its externalId stays reserved.

billableboolean

The unit’s own setting: whether usage on it is billable. The root is always billable.

customerstring

The customer the unit belongs to, by its cus_ ID.

effectiveBillableboolean

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.

externalIdstring

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.

isRootboolean

Whether this is the customer’s root unit, which stands for the whole customer. A customer created with an externalId gets its root automatically.

kindstring or null

Your label for the unit’s level, such as team, environment or user, or null. Paid gives it no meaning.

livemodeboolean

true for an object on a live account, false on a test account.

metadatamap from strings to strings

String key-value pairs of your own. Values saved before the Date Versioned API that aren’t strings, numbers or booleans are left out.

namestring
Shown in the dashboard and reports. Never used to look the unit up.
parentstring or null

The unit this one sits under, in the same customer. Null for the root. By cu_ ID.

updatedAtdatetime
When the object was last changed.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error