Reusable content blocks and standalone pages with custom field schemas. Site blocks are the building blocks of your site's pages.

Block types:

  • global — Reusable across the site (header, footer, sidebar)

  • page — Standalone page with a URL path

Each block has a schema (field definitions) and data (field values). The schema defines available fields (text, image, array of objects, etc.) and the data contains the actual content.

Supported field types: string, text, richtext, number, boolean, select, multiselect, image, file, url, email, date, datetime, color, object, array, dataSource.

12 endpoints

GET /site-blocks

List site blocks

Returns all site blocks. Supports filtering by type (global or page), status, and tags.

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

Examples

Bash
curl https://api.lynkow.com/v1/site-blocks \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": [
    {
      "id": 1,
      "name": "Header",
      "slug": "header",
      "type": "global",
      "status": "published",
      "locale": "en",
      "createdAt": "2025-01-05T09:00:00.000Z",
      "updatedAt": "2025-03-20T11:00:00.000Z"
    },
    {
      "id": 2,
      "name": "About Page",
      "slug": "about",
      "type": "page",
      "status": "published",
      "path": "/about",
      "locale": "en",
      "createdAt": "2025-01-10T14:00:00.000Z",
      "updatedAt": "2025-04-01T08:30:00.000Z"
    },
    {
      "id": 3,
      "name": "Footer",
      "slug": "footer",
      "type": "global",
      "status": "draft",
      "locale": "en",
      "createdAt": "2025-02-15T10:00:00.000Z",
      "updatedAt": "2025-02-15T10:00:00.000Z"
    }
  ],
  "meta": {
    "total": 3,
    "perPage": 15,
    "currentPage": 1,
    "lastPage": 1
  }
}

POST /site-blocks

Create a site block

Creates a new site block with a name, type, and optional schema. The slug is auto-generated from the name.

Responses

Status

Description

201

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

422

Validation error

Notes: - For page type, set path to define the URL (e.g., /about).

  • Schema can be added later via PUT /site-blocks/{slug}/schema.

Examples

Bash
curl -X POST https://api.lynkow.com/v1/site-blocks \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sidebar",
    "type": "global",
    "schema": [
      {"name": "title", "type": "string", "label": "Title"},
      {"name": "links", "type": "array", "label": "Links", "items": {"type": "object", "fields": [{"name": "label", "type": "string"}, {"name": "url", "type": "url"}]}}
    ]
  }'

Response Example

JSON
{
  "data": {
    "id": 4,
    "name": "Sidebar",
    "slug": "sidebar",
    "type": "global",
    "status": "draft",
    "locale": "en",
    "schema": [
      {
        "name": "title",
        "type": "string",
        "label": "Title"
      },
      {
        "name": "links",
        "type": "array",
        "label": "Links"
      }
    ],
    "data": {},
    "createdAt": "2025-04-06T12:00:00.000Z",
    "updatedAt": "2025-04-06T12:00:00.000Z"
  }
}

GET /site-blocks/:slug

Get a site block

Returns a site block by slug with its resolved data. DataSource fields are automatically populated with live data (reviews, contents, etc.).

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

Notes: - Slug-based routing (not ID-based) — the slug is the permanent identifier.

Examples

Bash
curl https://api.lynkow.com/v1/site-blocks/header \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": {
    "id": 1,
    "name": "Header",
    "slug": "header",
    "type": "global",
    "status": "published",
    "locale": "en",
    "schema": [
      {
        "name": "logo",
        "type": "image",
        "label": "Logo"
      },
      {
        "name": "navLinks",
        "type": "array",
        "label": "Navigation Links"
      }
    ],
    "data": {
      "logo": {
        "url": "https://cdn.lynkow.com/sites/abc123/logo.svg",
        "alt": "Company Logo"
      },
      "navLinks": [
        {
          "label": "Home",
          "url": "/"
        },
        {
          "label": "Blog",
          "url": "/blog"
        },
        {
          "label": "Contact",
          "url": "/contact"
        }
      ]
    },
    "createdAt": "2025-01-05T09:00:00.000Z",
    "updatedAt": "2025-03-20T11:00:00.000Z"
  }
}

DELETE /site-blocks/:slug

Delete a site block

Permanently deletes a site block and all its revisions.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

Examples

Bash
curl -X DELETE https://api.lynkow.com/v1/site-blocks/sidebar \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "message": "Block deleted"
}

PUT /site-blocks/:slug/schema

Update block schema

Replaces the field schema for a site block. Existing data is preserved but fields not in the new schema become orphaned (accessible but not validated).

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

422

Validation error

Notes: - Maximum 250 fields per level, 5 nesting levels.

  • Changing schema does NOT delete existing data.

Examples

Bash
curl -X PUT https://api.lynkow.com/v1/site-blocks/header/schema \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "schema": [
      {"name": "logo", "type": "image", "label": "Logo"},
      {"name": "tagline", "type": "string", "label": "Tagline"},
      {"name": "navLinks", "type": "array", "label": "Navigation Links"}
    ]
  }'

Response Example

JSON
{
  "data": {
    "id": 1,
    "name": "Header",
    "slug": "header",
    "type": "global",
    "status": "published",
    "schema": [
      {
        "name": "logo",
        "type": "image",
        "label": "Logo"
      },
      {
        "name": "tagline",
        "type": "string",
        "label": "Tagline"
      },
      {
        "name": "navLinks",
        "type": "array",
        "label": "Navigation Links"
      }
    ],
    "updatedAt": "2025-04-06T14:00:00.000Z"
  }
}

PUT /site-blocks/:slug/data

Update block data

Updates the field values for a site block. Data is validated against the current schema. Only include fields you want to change.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

422

Validation error

Notes: - Creates a new revision automatically.

  • DataSource fields are read-only — they are resolved at read time.

Examples

Bash
curl -X PUT https://api.lynkow.com/v1/site-blocks/header/data \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "tagline": "Build faster with Lynkow",
      "navLinks": [
        {"label": "Home", "url": "/"},
        {"label": "Blog", "url": "/blog"}
      ]
    }
  }'

Response Example

JSON
{
  "data": {
    "id": 1,
    "name": "Header",
    "slug": "header",
    "type": "global",
    "status": "published",
    "data": {
      "logo": {
        "url": "https://cdn.lynkow.com/sites/abc123/logo.svg",
        "alt": "Company Logo"
      },
      "tagline": "Build faster with Lynkow",
      "navLinks": [
        {
          "label": "Home",
          "url": "/"
        },
        {
          "label": "Blog",
          "url": "/blog"
        }
      ]
    },
    "updatedAt": "2025-04-06T14:30:00.000Z"
  }
}

POST /site-blocks/:slug/publish

Publish a site block

Sets the block status to published, making it visible via the public API.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

422

Validation error

Examples

Bash
curl -X POST https://api.lynkow.com/v1/site-blocks/sidebar/publish \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": {
    "id": 4,
    "name": "Sidebar",
    "slug": "sidebar",
    "type": "global",
    "status": "published",
    "locale": "en",
    "updatedAt": "2025-04-06T15:00:00.000Z"
  }
}

POST /site-blocks/:slug/unpublish

Unpublish a site block

Sets the block status back to draft, hiding it from the public API.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

422

Validation error

Examples

Bash
curl -X POST https://api.lynkow.com/v1/site-blocks/sidebar/unpublish \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": {
    "id": 4,
    "name": "Sidebar",
    "slug": "sidebar",
    "type": "global",
    "status": "draft",
    "locale": "en",
    "updatedAt": "2025-04-06T16:00:00.000Z"
  }
}

GET /site-blocks/:slug/translations

Get block translation status

Returns the translation status across all enabled locales.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

Examples

Bash
curl https://api.lynkow.com/v1/site-blocks/header/translations \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": {
    "en": {
      "status": "complete"
    },
    "fr": {
      "status": "missing"
    },
    "es": {
      "status": "partial"
    }
  }
}

POST /site-blocks/:slug/copy-to-locale

Copy block to another locale

Creates a translated copy with the same schema and data.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

422

Validation error

Examples

Bash
curl -X POST https://api.lynkow.com/v1/site-blocks/header/copy-to-locale \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"locale": "fr"}'

Response Example

JSON
{
  "data": {
    "id": 10,
    "name": "Header",
    "slug": "header",
    "type": "global",
    "status": "draft",
    "locale": "fr",
    "schema": [
      {
        "name": "logo",
        "type": "image",
        "label": "Logo"
      },
      {
        "name": "navLinks",
        "type": "array",
        "label": "Navigation Links"
      }
    ],
    "data": {
      "logo": {
        "url": "https://cdn.lynkow.com/sites/abc123/logo.svg",
        "alt": "Company Logo"
      },
      "navLinks": [
        {
          "label": "Home",
          "url": "/"
        },
        {
          "label": "Blog",
          "url": "/blog"
        }
      ]
    },
    "createdAt": "2025-04-06T15:00:00.000Z",
    "updatedAt": "2025-04-06T15:00:00.000Z"
  }
}

GET /site-blocks/:slug/revisions

List block revisions

Returns the version history for a site block.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

Examples

Bash
curl https://api.lynkow.com/v1/site-blocks/header/revisions \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": [
    {
      "id": 201,
      "siteBlockId": 1,
      "changes": [
        {
          "field": "data.tagline",
          "from": null,
          "to": "Build faster with Lynkow"
        }
      ],
      "createdAt": "2025-04-06T14:30:00.000Z",
      "author": {
        "id": 1,
        "fullName": "Jane Doe"
      }
    },
    {
      "id": 200,
      "siteBlockId": 1,
      "changes": [
        {
          "field": "data.navLinks",
          "from": "3 items",
          "to": "2 items"
        }
      ],
      "createdAt": "2025-03-20T11:00:00.000Z",
      "author": {
        "id": 1,
        "fullName": "Jane Doe"
      }
    }
  ]
}

POST /site-blocks/:slug/revisions/:revisionId/restore

Restore a block revision

Restores a site block to a previous revision state.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

revisionId

path

string

Yes

Revision ID

Responses

Status

Description

200

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

404

Not found

422

Validation error

Examples

Bash
curl -X POST https://api.lynkow.com/v1/site-blocks/header/revisions/200/restore \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": {
    "id": 1,
    "name": "Header",
    "slug": "header",
    "type": "global",
    "status": "published",
    "locale": "en",
    "data": {
      "logo": {
        "url": "https://cdn.lynkow.com/sites/abc123/logo.svg",
        "alt": "Company Logo"
      },
      "navLinks": [
        {
          "label": "Home",
          "url": "/"
        },
        {
          "label": "Blog",
          "url": "/blog"
        },
        {
          "label": "Contact",
          "url": "/contact"
        }
      ]
    },
    "createdAt": "2025-01-05T09:00:00.000Z",
    "updatedAt": "2025-04-06T16:00:00.000Z"
  }
}