Create an entity through its provisioning path
POST /Platform/entities/{entity_type}/allocate
Create an entity through its provisioning path. Covers any required external allocation, purchase, registration, validation, or configuration; use this route instead of generic entity creation for such types.
Single round-trip: allocation IS creation for these entity types.
Call describe for the entity type (or allocate-schema) first:
its allocation block lists the accepted parameters with their JSON
schemas, and any purchase, recurring-cost, confirmation or
irreversibility warning. For TelnyxPhoneNumber this operation buys a
real number; editing an already-provisioned number's routing does not
allocate or release one.
The whole of params is checked against the type's contract before
anything is bought or written, so a refusal for a missing, unknown or
malformed parameter never follows a side effect. A type that buys
something lands on the branch its contract declares (lands_on,
main for phone numbers) whatever branch you pass; the response's
branch says where it landed.
Path parameters
entity_type: str. Entity class name to allocate.
Body parameters
params: optional dict. The type's allocation parameters, as a JSON object.branch: optional str. Branch the new entity is stored on (defaultmain), unless the type declares its own landing branch.sharing: optional "organization" or "private". Who can see and change the new record.organization: everyone in your organization.private: only you, until you share it. Left out, the record is shared, as what you set up is. A private record works in the background (answering a call, a chat, a scheduled job) only through entry points that you alone control, so keep a number, an address or a public link that other people's work depends on shared.
Returns
AllocateEntityResponse
entity_type: optional str or null. Entity class name.entity_id: optional str or null. Id of the new entity.commit_id: optional str or null. Its first commit.yaml_content: optional str or null. The new entity as YAML.access: optional EntityAccess or null. Access of the new entity.branch: optional str or null. The branch the entity was stored on.warnings: optional List[str]. Things that went wrong after the entity was created; show them to the user.
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/{entity_type}/allocate" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'