UmweltDocs
Reference/Commands/entity.archive
entity.archivecommandsince 0.1

Marks an entity as archived.

Request
umwelt call story.umw entity.archive '{
  "projectId": "ball",
  "entityId": "guard"
}'
Request
const result = await client.entityArchive({ projectId: 'ball', entityId: 'guard' });
Request
var result = engine.EntityArchive(new EntityId { ProjectId = "ball", EntityIdValue = "guard" });
Response
{
  "id": "guard",
  "projectId": "ball",
  "name": "The guard",
  "aliases": [],
  "typeId": "person",
  "archived": true,
  "createdAt": { "tick": 0 },
  "externalRef": { "id": "npc-12", "system": "game" },
  "fields": {}
}

Payload

FieldTypeDescription
projectIdrequiredstringThe project to write to.
entityIdrequiredstringThe entity, by its engine id.

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

Archiving changes nothing else. The entity keeps its records, stays listed and readable, and can still be referenced. What archived means is your application’s decision.

Errors

VALIDATION_FAILEDThe payload is malformed.
NOT_FOUNDThe project or entity does not exist.
HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.

Every code is listed in Errors.

See also

Was this page helpful?