Apply
POST /{o}/{p}/apply
Apply declarations (terraform-style)
Apply schema + data declarations against the project. Supports dry-run (plan-only) and force (allow breaking changes). Returns 207 when some items fail.
Auth: Bearer token required ยท Permission: apply:write
Path parameters
| Name | Type | Description |
|---|
o | string | |
p | string | |
Query parameters
| Name | Type | Description |
|---|
source | string | Filter to one registered import source |
Request body (application/json)
| Field | Type | Description |
|---|
items | object | object | object | object | object | object | object | object | object[] | Schema + data declarations (use --file for multi-doc YAML or directories) (required) |
force | boolean | Allow breaking schema changes |
deletions | object[] | Schema-level kinds to delete after the apply |
dryRun | boolean | Plan-only โ no writes |
prune | boolean | Delete synced entities under source that the items do not name (plus their relationships) |
syncSource | string | |
observedAt | string(date-time) | |
expectedRevision | integer | Apply only if this is the current catalog revision; omit for last-writer-wins |
Responses
| Status | Description | Schema |
|---|
200 | OK | ApplyResult |
207 | Status 207 | ApplyResult |
401 | Unauthorized | Error |
403 | Forbidden | Error |
409 | Conflict | ApplyConflict |
422 | Unprocessable Entity | ApplyInvalid |
Schemas
ApplyConflict
| Field | Type | Description |
|---|
error | string | (required) |
code | string | |
expectedRevision | integer | Present on a CATALOG_REVISION_MISMATCH 409: the precondition the caller sent |
currentRevision | integer | Present on a CATALOG_REVISION_MISMATCH 409: the revision the project is actually at |
ApplyInvalid
| Field | Type | Description |
|---|
error | string | (required) |
code | string | |
violations | object[] | Present on a CATALOG_INVALID 422: every rule that fired, not the first, so fixing a catalog costs one round trip rather than one per mistake. |
destructiveHunks | object[] | Present on a DESTRUCTIVE_CHANGES_REQUIRE_FORCE 422: what the apply would have destroyed. |
ApplyResult
| Field | Type | Description |
|---|
succeeded | object[] | (required) |
failed | object[] | (required) |
skipped | object[] | (required) |
diff | object | Populated only when the request set dryRun:true. EntityType deletion cascades are NOT expanded โ deleted reflects only the requested deletions. |
stampedCount | integer | (required) |
prunedCount | integer | |
revision | integer | The project's catalog revision after this apply โ newly minted when the catalog changed, the unchanged head when it did not (D8) or when dryRun was set. Read this to learn the next expectedRevision. (required) |
CellSelector
| Field | Type | Description |
|---|
match | CellSelectorTerm[] | (required) |
CellSelectorEqualsTerm
| Field | Type | Description |
|---|
property | string | (required) |
equals | string | (required) |
CellSelectorInTerm
| Field | Type | Description |
|---|
property | string | (required) |
in | string[] | (required) |
CellSelectorTerm
Error
| Field | Type | Description |
|---|
error | string | (required) |
code | string | |
ModuleSourceRule
| Field | Type | Description |
|---|
unit | module | (required) |
address | string | (required) |
mergeAcrossSources | true | Declares that this rule's identity is deliberately the same across sources, so the same object in two sources is ONE entity. Required when the identity reads no {{ match.* }} capture, because such an identity cannot vary by source. |
match | string | (required) |
identity | string | (required) |
part | string | |
properties | object | |
state | string | |
ResourceSourceRule
| Field | Type | Description |
|---|
unit | resource | (required) |
type | string | (required) |
mergeAcrossSources | true | Declares that this rule's identity is deliberately the same across sources, so the same object in two sources is ONE entity. Required when the identity reads no {{ match.* }} capture, because such an identity cannot vary by source. |
match | string | (required) |
identity | string | (required) |
part | string | |
properties | object | |
state | string | |
StackSourceRule
| Field | Type | Description |
|---|
unit | stack | (required) |
match | string | (required) |
identity | string | (required) |
part | string | |
properties | object | |
state | string | |