UmweltDocs
Reference/Commands/entity.update
entity.updatecommandsince 0.1

Changes an entity’s name, aliases, fields or external reference.

Request
umwelt call story.umw entity.update '{
  "projectId": "ball",
  "entityId": "bob",
  "aliases": ["the masked guest"]
}'
Request
const result = await client.entityUpdate({ projectId: 'ball', entityId: 'bob', aliases: ['the masked guest'] });
Request
var result = engine.EntityUpdate(new UpdateEntityInput
{
    ProjectId = "ball",
    EntityId = "bob",
    Aliases = new() { "the masked guest" },
});
Response
{
  "id": "bob",
  "projectId": "ball",
  "name": "Bob",
  "aliases": ["the masked guest"],
  "typeId": "person",
  "archived": false,
  "createdAt": { "tick": 0 },
  "fields": {}
}

Payload

FieldTypeDescription
projectIdrequiredstringThe project to write to.
entityIdrequiredstringThe entity, by its engine id.
aliasesstring[]The new list of aliases. It replaces the old one.
externalRefExternalRefA new external reference.
fieldsobjectThe new field values, validated against the entity’s type.
namestringA new name.

Result

FieldTypeDescription
idalwaysstringThe entity’s id, given or generated.
projectIdalwaysstringThe project it belongs to.
typeIdalwaysstringIts entity type, which decides whether it can hold knowledge.
namealwaysstringIts name.
aliasesstring[]Other names it goes by.
fieldsobjectValues for the fields its type declares.
externalRefExternalRefThe id another system gives it: { system, id }.
createdAtalwaysPositionThe position it exists from. Defaults to { "tick": 0 }.
archivedalwaysbooleanSet by entity.archive. It changes nothing else.

Rules

Only what is present changes. Its project, type and archived flag cannot be changed.

Names over time are records. This changes the entity itself. To have a name change at a point in the story, write umwelt:name or umwelt:alias Facts and read them with entity.at.

Errors

VALIDATION_FAILEDThe payload is malformed, or a field does not fit the type.
NOT_FOUNDThe project or entity does not exist.
CONFLICTThe external reference already belongs to another entity.
HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.

Every code is listed in Errors.

See also

Was this page helpful?