Create an entity from YAML
POST /Platform/entities/{entity_type}
Create an entity from YAML.
Creating a lines-based entity from markdown/prose does NOT need a
hand-built lines array: a lines-typed field accepts a single
string (e.g. one literal block scalar) and splits it into one line
per newline on load.
If yaml_content already includes an id, it is preserved.
Otherwise a fresh nanoid is generated. All other fields are stored
as-is via a shallow store (same semantics as put).
Note: some entity types cannot be created from raw YAML and will be
rejected here — those with a provision-backed creation side effect
(e.g. purchasing an external resource or validating a domain). Those
types are created via the allocate operation, which runs
cls.allocate(**params) server-side.
YAML formatting: yaml_content is parsed with a strict YAML loader,
so prose-heavy fields are easy to mis-quote. Any scalar that contains
a colon, a leading #/-/?/*/&, or that wraps across
lines must be quoted — a common failure is an unquoted multi-line
value whose continuation line ends in : (YAML reads it as a new
mapping key and rejects the document). Single-quoting the whole value
(doubling any inner single quotes) is always safe, and validate
catches syntax errors before this write. scaffold produces a
correctly-serialized starting template.
Entity-valued fields use typed YAML mappings:
{entity_type: Agent, id: "..."}. Bare ID strings are not valid
substitutes because they lose the concrete entity type required during
validation.
Path parameters
entity_type: str. Entity class name to create.
Body parameters
yaml_content: str. Full entity YAML (anidfield, if present, is kept).branch: optional str. Hilus branch to create on (defaultmain).commit_message: optional str. Optional commit label shown inhistory.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, what you set up (an agent, a document, a number) is shared, and a record of what you do (a conversation, a scheduled job) is yours. 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 anything other people's work depends on shared.
Returns
EntityPutResponse
entity_id: optional str or null. Id of the stored entity (the minted slug for slug-backed types).slug: optional str or null. Public slug, for slug-backed types.commit_id: optional str or null. The new commit.canonical_yaml: optional str or null. The YAML as stored, when returned.access: optional EntityAccess or null. Access after the write.ignored_changes: optional List[dict]. Requested fields that were not stored (create): path, reason.
Example request
curl -X POST "https://api.hilus.ai/Platform/entities/{entity_type}" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'