entity.createcommandsince 0.1
Creates an entity of a declared type: a character, a group, a place, an object.
Request
umwelt call story.umw entity.create '{
"projectId": "ball",
"id": "ana",
"typeId": "person",
"name": "Ana"
}'Request
const result = await client.entityCreate({ projectId: 'ball', id: 'ana', typeId: 'person', name: 'Ana' });Request
var result = engine.EntityCreate(new CreateEntityInput
{
ProjectId = "ball",
Id = "ana",
TypeId = "person",
Name = "Ana",
});Response
{
"id": "ana",
"projectId": "ball",
"name": "Ana",
"aliases": [],
"typeId": "person",
"archived": false,
"createdAt": { "tick": 0 },
"fields": {}
}Payload
| Field | Type | Description |
|---|---|---|
projectIdrequired | string | The project to write to. |
id | string | Its id. Generated when absent. |
typeIdrequired | string | Its entity type. |
namerequired | string | Its name. |
aliases | string[]default [] | Other names it goes by. |
createdAt | Positiondefault {"tick":0} | The position it exists from. |
externalRef | ExternalRef | The id another system gives it: { system, id }, unique per project. |
fields | objectdefault {} | Values for the fields its type declares, validated against them. |
Result
| Field | Type | Description |
|---|---|---|
idalways | string | The entity’s id, given or generated. |
projectIdalways | string | The project it belongs to. |
typeIdalways | string | Its entity type, which decides whether it can hold knowledge. |
namealways | string | Its name. |
aliases | string[] | Other names it goes by. |
fields | object | Values for the fields its type declares. |
externalRef | ExternalRef | The id another system gives it: { system, id }. |
createdAtalways | Position | The position it exists from. Defaults to { "tick": 0 }. |
archivedalways | boolean | Set by entity.archive. It changes nothing else. |
Rules
The type decides what it can hold. An entity of an agent or group type can hold knowledge; one of an other type can only be talked about.
Errors
VALIDATION_FAILEDThe payload is malformed, or a field does not fit its type.NOT_FOUNDThe project or the entity type does not exist.CONFLICTAn entity with that id exists, or the external reference already belongs to another entity.HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.Every code is listed in Errors.
See also
entityType.createdeclare a typeentity.ensureBatchmany, by your own idsentity.updatechange itEntitiesthe concept
Was this page helpful?