Singleton content entries identified by slug (not ID). Use single types for one-off pages like "About", "Privacy Policy", or "Terms of Service" where only one instance exists per locale.

Single types use the same rich text editor as regular contents but are addressed by slug instead of numeric ID.

5 endpoints

GET /single-types

List single types

Returns all defined single types for your site.

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/single-types \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": [
    {
      "slug": "about",
      "name": "About Page",
      "locale": "en",
      "createdAt": "2025-01-10T09:00:00.000Z",
      "updatedAt": "2025-03-20T14:00:00.000Z"
    },
    {
      "slug": "privacy-policy",
      "name": "Privacy Policy",
      "locale": "en",
      "createdAt": "2025-01-12T10:00:00.000Z",
      "updatedAt": "2025-02-15T11:00:00.000Z"
    }
  ],
  "meta": {
    "total": 3,
    "perPage": 15,
    "currentPage": 1,
    "lastPage": 1
  }
}

POST /single-types

Create a single type

Creates a new single type. The slug must be unique and is used as the permanent identifier (it cannot be changed after creation).

Request Body

Content-Type: application/json

Field

Type

Required

Description

slug

string

Yes

Required. URL-friendly identifier, unique per site and locale. 1-100 characters

name

string

Yes

Required. Display name. 1-255 characters

description

string

No

Description text

data

object

Yes

Required. Resource data object

schema

object

No

Field schema definition

Responses

Status

Description

201

Successful response

401

Unauthorized — invalid or missing API token

403

Forbidden — insufficient permissions

422

Validation error

Examples

Bash
curl -X POST https://api.lynkow.com/v1/single-types \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Terms of Service",
    "slug": "terms-of-service",
    "bodyMarkdown": "# Terms of Service\n\nLast updated: April 2025."
  }'

Response Example

JSON
{
  "data": {
    "slug": "terms-of-service",
    "name": "Terms of Service",
    "bodyHtml": "<h1>Terms of Service</h1><p>Last updated: April 2025.</p>",
    "locale": "en",
    "createdAt": "2025-04-06T12:00:00.000Z",
    "updatedAt": "2025-04-06T12:00:00.000Z"
  }
}

GET /single-types/:slug

Get a single type

Returns a single type by its slug, including the full body content.

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/single-types/about \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": {
    "slug": "about",
    "name": "About Page",
    "bodyHtml": "<h1>About Us</h1><p>We build tools for the modern web.</p>",
    "locale": "en",
    "meta": {
      "metaTitle": "About Us | My Website",
      "metaDescription": "Learn about our company and mission."
    },
    "createdAt": "2025-01-10T09:00:00.000Z",
    "updatedAt": "2025-03-20T14:00:00.000Z"
  }
}

PUT /single-types/:slug

Update a single type

Updates the content of a single type. The slug cannot be changed.

Parameters

Name

In

Type

Required

Description

slug

path

string

Yes

URL-friendly identifier, unique per site and locale

Request Body

Content-Type: application/json

Field

Type

Required

Description

slug

string

No

URL-friendly identifier, unique per site and locale. 1-100 characters

name

string

No

Display name. 1-255 characters

description

string

No

Description text

data

object

No

Resource data object

schema

object

No

Field schema definition

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 PUT https://api.lynkow.com/v1/single-types/about \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "About Us",
    "bodyMarkdown": "# About Us\n\nUpdated company description."
  }'

Response Example

JSON
{
  "data": {
    "slug": "about",
    "name": "About Us",
    "bodyHtml": "<h1>About Us</h1><p>Updated company description.</p>",
    "locale": "en",
    "createdAt": "2025-01-10T09:00:00.000Z",
    "updatedAt": "2025-04-06T14:00:00.000Z"
  }
}

DELETE /single-types/:slug

Delete a single type

Permanently deletes a single type.

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/single-types/terms-of-service \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "message": "Single type deleted"
}