create_entity
Create an entity with a canonical name, aliases and a schema-declared type.
create_entity(entity_type_id: int, canonical_name: str, aliases: list[str] | None = None) -> CreateEntityResultcreate_entity(request: EntityCreateRequest) -> EntityCreateResponseParameters
entity_type_idintegerrequiredA type id from the active schema. A type that is not declared there is rejected.
canonical_namestringrequiredThe name Brain treats as the entity's own.
aliasesstring[]optionalOther surface forms that should resolve here. Defaults to empty.
Returns
entity_idstringalwaysThe new entity.
The wire request carries two fields the HTTP body does not: a sessionId,
attributing the entity to a session, and an attributesBlob.
Prefer resolve_entity with creation allowed
when you are turning a surface form into an entity — it checks for an existing
match first, where create_entity always writes a new one.
On the wire
Ids are fixed-width UUID bytes rather than strings, attributes is an opaque
attributesBlob, and every request carries a requestId plus an optional
actAs. See Wire client.
Was this page helpful?