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

Body parameters

Returns

EntityPutResponse

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 '{}'