Nimbu Developer Docs
ReferenceBlogs

Apply a planned blog schema change

POST
/blogs/{blog_slug}/apply

Declarative schema workflow, shared by channels, blogs, product and customer customizations and checkout profiles:

  1. GET .../schema exports the current schema (target attributes plus ordinary fields).
  2. POST .../plan diffs a desired document against the target and returns the ops, drift, warnings and a fingerprint. Nothing is written.
  3. POST .../apply with the same document plus that fingerprint writes the change. It fails with 409 when the target changed since the plan (a fresh plan is returned), with 422 when the plan has blocked ops or warnings, and with 422 when it has destructive ops and confirm_destructive is not true.

Fields absent from the document are kept and reported as drift unless prune: true removes them (destructive). Planning or applying a channel, blog or checkout profile slug that does not exist yet creates it on apply.

See the channel endpoints for full request and response examples.

Authorization

AuthorizationBearer <token>

Personal access token tied to a user account. Requires the X-Nimbu-Site header to scope requests.

In: header

X-Nimbu-Site<token>

Identifier of the site context when authenticating with a personal access token.

In: header

Path Parameters

blog_slug*string

Blog slug

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/blogs/string/apply" \  -H "Content-Type: application/json" \  -d '{    "fields": [      {        "name": "string"      }    ]  }'
{
  "target": "string",
  "fingerprint": "string",
  "applied": true,
  "ops": [
    {
      "kind": "create_target",
      "risk": "safe",
      "field": "string",
      "attr": "string",
      "option": "string",
      "type": "string",
      "from": null,
      "to": null,
      "entries": 0,
      "entries_with_value": 0,
      "reason": "string"
    }
  ]
}
{
  "message": "string",
  "plan": {
    "target": "string",
    "fingerprint": "string",
    "exists": true,
    "ops": [
      {
        "kind": "create_target",
        "risk": "safe",
        "field": "string",
        "attr": "string",
        "option": "string",
        "type": "string",
        "from": null,
        "to": null,
        "entries": 0,
        "entries_with_value": 0,
        "reason": "string"
      }
    ],
    "drift": [
      {
        "field": "string",
        "type": "string",
        "option": "string",
        "note": "string"
      }
    ],
    "warnings": [
      "string"
    ],
    "info": [
      "string"
    ]
  }
}
{
  "message": "string",
  "plan": {
    "target": "string",
    "fingerprint": "string",
    "exists": true,
    "ops": [
      {
        "kind": "create_target",
        "risk": "safe",
        "field": "string",
        "attr": "string",
        "option": "string",
        "type": "string",
        "from": null,
        "to": null,
        "entries": 0,
        "entries_with_value": 0,
        "reason": "string"
      }
    ],
    "drift": [
      {
        "field": "string",
        "type": "string",
        "option": "string",
        "note": "string"
      }
    ],
    "warnings": [
      "string"
    ],
    "info": [
      "string"
    ]
  }
}