Skip to main content
Version: v5.7.0

opschain entity create

Included from Basic tier

opschain entity create <parent-path> --code <code> --name <name> [--description <text>]

Creates one entity under a project, environment, asset or entity, at <parent-path>/entities/<code>. The node create rules apply: the code is lowercase letters, numbers and underscores (at most 50, stored stripped and lowercased) and unique among the parent's entities; the name is at most 50 and unique among the parent's unarchived entities; a path a deleted entity still reserves is refused by name. An entity parents entities only, and an environment or asset is never created under one.

You need update rights on the parent's …/entities rule path and on the new entity's own path; without them the parent answers as not found.

opschain entity create shop/environments/prod --code orders_schema --name "Orders schema"
created entity /projects/shop/environments/prod/entities/orders_schema (0193b7aa-…)

The new entity starts with empty properties and settings documents of its own, written afterwards at its node path like any node's (opschain docs resources/properties). -o, --output json|yaml emits the created entity.

Flags​

FlagMeaning
--code <code>Entity code (required).
--name <name>Display name (required).
--description <text>Description (at most 1000 characters).

Exit codes​

CodeMeaning
0Created.
1The server refused — every field refusal is named, e.g. the server refused the request: code: Code has already been taken.
2Usage error — a missing or blank --code / --name, an empty path, no server target.

See also​

  • opschain docs cli/entity-bulk-create — many entities in one write.