Config code API
2 operations. Back to the API overview. Examples use synthetic data.
Applies configuration files the caller reviewed as a plan
POST /admin/v1/config/apply
Applies configuration files the caller reviewed as a plan: the plan is computed again and must have the same plan_sha256; every change needs the same permission as the console edit of its kind; all changes are written in one transaction with the stated reason, audited fail-closed (one admin audit record and the stdout record before commit), each a new version in the configuration history. A further permission depends on the resource (for configuration, the write permission of its kind: config:write, or senders:write for senders).
Needs the permission: config:history.
Request body
| Field | Type | Presence | Description |
|---|---|---|---|
entities | array of object (ConfigcodeEntity) | optional | - |
entities.[]document | any | optional | - |
entities.[]id | string | optional | - |
entities.[]kind | string | optional | - |
kinds | array of string | optional | Kinds limits the plan (and pruning) to these kinds; every desired entity must be of one of them. Empty: every kind. |
plan_sha256 | string | optional | - |
prune | boolean | optional | Prune deletes live entities of the managed, writable kinds that the files do not hold. Read-only kinds are never deleted. |
reason | string | optional | - |
{
"entities": [
{
"document": {},
"id": "example-id",
"kind": "example"
}
],
"kinds": [
"example"
],
"plan_sha256": "example",
"prune": true,
"reason": "Example text"
}Response 200
| Field | Type | Presence | Description |
|---|---|---|---|
config_version | any | optional | - |
plan | object (ConfigcodePlan) | optional | Plan is the result of comparing desired entities with the live configuration. |
plan.changes | array of object (ConfigcodeChange) | optional | - |
plan.config_version | integer | optional | - |
plan.plan_sha256 | string | optional | - |
plan.summary | map of integer | optional | - |
plan.unmanaged | integer | optional | Unmanaged counts live entities in scope that the files do not hold and that are kept (no prune, or a read-only kind). |
plan.validation_error | string | optional | ValidationError is the configuration validation's verdict on the result (empty: valid). An apply runs the same validation again. |
status | string | optional | - |
{
"config_version": {},
"plan": {
"changes": [
{
"action": "example",
"document_sha256": "example",
"from_version": 1,
"id": "example-id",
"kind": "example",
"note": "example",
"paths": [
"example"
],
"permission": "example",
"permitted": true
}
],
"config_version": 1,
"plan_sha256": "example",
"summary": {
"example": 1
},
"unmanaged": 1,
"validation_error": "Example text"
},
"status": "ok"
}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request POST \
--header "Authorization: Bearer $ID_TOKEN" \
--header "Content-Type: application/json" \
--data '{"entities":[{"document":{},"id":"example-id","kind":"example"}],"kinds":["example"],"plan_sha256":"example","prune":true,"reason":"Example text"}' \
"https://YOUR-CONSOLE-HOST/admin/v1/config/apply"Previews applying configuration files
POST /admin/v1/config/plan
Previews applying configuration files: what would be created, updated or deleted, the paths that differ, the permission each change needs, and the configuration validation's verdict. Nothing is written. Operator and above (config:history).
Needs the permission: config:history.
Request body
| Field | Type | Presence | Description |
|---|---|---|---|
entities | array of object (ConfigcodeEntity) | optional | - |
entities.[]document | any | optional | - |
entities.[]id | string | optional | - |
entities.[]kind | string | optional | - |
kinds | array of string | optional | Kinds limits the plan (and pruning) to these kinds; every desired entity must be of one of them. Empty: every kind. |
prune | boolean | optional | Prune deletes live entities of the managed, writable kinds that the files do not hold. Read-only kinds are never deleted. |
{
"entities": [
{
"document": {},
"id": "example-id",
"kind": "example"
}
],
"kinds": [
"example"
],
"prune": true
}Response 200
| Field | Type | Presence | Description |
|---|---|---|---|
changes | array of object (ConfigcodeChange) | optional | - |
changes.[]action | string | optional | - |
changes.[]document_sha256 | string | optional | DocumentSHA256 is the digest of the desired canonical document. |
changes.[]from_version | integer | optional | FromVersion is the live version the change replaces (0: none). |
changes.[]id | string | optional | - |
changes.[]kind | string | optional | - |
changes.[]note | string | optional | - |
changes.[]paths | array of string | optional | Paths are the JSON paths that differ (at most MaxPaths). |
changes.[]permission | string | optional | Permission is what writing the entity requires; Permitted reports whether the caller holds it. |
changes.[]permitted | boolean | optional | - |
config_version | integer | optional | - |
plan_sha256 | string | optional | - |
summary | map of integer | optional | - |
unmanaged | integer | optional | Unmanaged counts live entities in scope that the files do not hold and that are kept (no prune, or a read-only kind). |
validation_error | string | optional | ValidationError is the configuration validation's verdict on the result (empty: valid). An apply runs the same validation again. |
{
"changes": [
{
"action": "example",
"document_sha256": "example",
"from_version": 1,
"id": "example-id",
"kind": "example",
"note": "example",
"paths": [
"example"
],
"permission": "example",
"permitted": true
}
],
"config_version": 1,
"plan_sha256": "example",
"summary": {
"example": 1
},
"unmanaged": 1,
"validation_error": "Example text"
}Other responses
401Authentication required403Not permitted404Not Found503Unavailable (nothing was changed)
curl --request POST \
--header "Authorization: Bearer $ID_TOKEN" \
--header "Content-Type: application/json" \
--data '{"entities":[{"document":{},"id":"example-id","kind":"example"}],"kinds":["example"],"prune":true}' \
"https://YOUR-CONSOLE-HOST/admin/v1/config/plan"Something unclear or missing? Ask Help in the Velacent Bridge console; answers link to the right screen. How support works.