Create a customer unit under a parent
Creates a unit by naming its parent alone; the customer is whoever the parent belongs to, so a caller that only knows its own ids never needs the customer routes. parentExternalId is looked up across the organization, ignoring letter case, among unit ids, customer external ids and aliases: a unit becomes the parent; a customer (by external id or alias) stands for the top of its tree, so the new unit goes under the root unit, or becomes the root when the customer has none. The parent is only ever named by your id, never by a Paid id, so a customer with no external id takes its units through the customer's unit routes. The answer carries the unit's externalId and its customer's ids, not Paid's unit id. externalId follows the same rules as on the customer-scoped create: required, immutable, unique within the organization ignoring letter case. 409 PARENT_NOT_FOUND when nothing matches, PARENT_NOT_ACTIVE for a deleted or draft parent, PARENT_AMBIGUOUS when legacy rows let the id name more than one customer (use that customer's unit routes), PARENT_CHANGED when the reference pointed elsewhere by the time the create ran (send it again), and otherwise the customer-scoped create's 409s (CUSTOMER_UNIT_EXISTS, EXTERNAL_ID_IN_USE, DEPTH_EXCEEDED, SEAT_BILLING, and ROOT_UNIT_ALWAYS_BILLABLE for billable: false on a unit that would become the root). 403 FEATURE_NOT_ENABLED for billable: false when non-billable units are not enabled for your organization.
Request
- Base URL: https://api.agentpaid.io/api/v2
- URL: https://api.agentpaid.io/api/v2/customer-units/
- Auth: HTTP bearer
Request body
Response
201
Changes
No recorded changes to this operation across all 1 revision of this API.