Subaccounts
List subaccounts
Newest first. Filter by externalRef.
Required scope: subaccounts:read.
query Parameters
limitcursorThe nextCursor of the previous page, with the same filters.
externalRefOnly the subaccount with this ref.
List subaccounts › Responses
objecthasMorenextCursorCreate a subaccount
A subaccount is a child organization with its own agents, pipelines, cases, numbers and keys, isolated from your other subaccounts. Act on it with the Lelemon-Subaccount header on any route. fromTemplates fills it with draft agents and pipelines: agent ids come from GET /v2/agent-templates, pipeline ids from GET /v2/pipelines.
Required scope: subaccounts:write.
Headers
Idempotency-KeyMakes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.
Create a subaccount › Request Body
externalRefYour own id for it. Unique among your subaccounts.
nameCreate a subaccount › Responses
objectidexternalRefnamecreatedAtupdatedAtOnly on create: what fromTemplates made.
Retrieve a subaccount
Returns one subaccount by id. Use it to refresh a single record you already know; to find records, use the list route. Only a platform key can read its subaccounts. Read only. 404 not_found when the id does not exist or belongs to another organization. You can repeat it safely: it has no side effects.
Required scope: subaccounts:read.
path Parameters
id^sub_[0-9A-Za-z]{22}… · requiredThe id of the subaccount (sub_…).
Retrieve a subaccount › Responses
objectidexternalRefnamecreatedAtupdatedAtOnly on create: what fromTemplates made.
Update a subaccount
Changes the name or the external reference of a subaccount. Send only the fields you want to change. It does not touch the subaccount keys or the resources it holds. Applying the same body twice leaves the same result.
Required scope: subaccounts:write.
path Parameters
id^sub_[0-9A-Za-z]{22}… · requiredThe id of the subaccount (sub_…).
Update a subaccount › Request Body optional
nameexternalRefUpdate a subaccount › Responses
objectidexternalRefnamecreatedAtupdatedAtOnly on create: what fromTemplates made.
Give a subaccount its own key
For direct access: a key that only sees this subaccount. Its scopes cannot go beyond yours, and the key is shown once. This route ignores Idempotency-Key so the secret is never stored.
Required scope: subaccounts:write.
path Parameters
id^sub_[0-9A-Za-z]{22}… · requiredThe id of the subaccount (sub_…).
Give a subaccount its own key › Request Body
namescopesScopes for the key. They cannot go beyond the ones your own key has, and never include subaccounts:* scopes.
authorNameAccepted with cases:send, and required with conversations:send. Not allowed otherwise.
allowedActionOriginsSites the key may create HTTP actions for. Only with actions:write. Up to 10, each one inside the sites of your own key. Omit it to give the key the same sites as yours.
expiresInDaysGive a subaccount its own key › Responses
objectidnameprefixscopesallowedActionOriginsThe sites this key may create HTTP actions for. Empty without actions:write.
createdAtexpiresAtsecretThe API key itself. It is shown once and never again.