Site-wide reusable key-value pairs. Variables are ideal for storing information that appears across multiple pages: company name, phone number, address, social links, opening hours, etc.

Variable types:

  • text — Simple key-value string

  • calendar — Event calendar with dates, labels, and colors

7 endpoints

GET /variables

List variables

Returns all variables 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/variables \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

JSON
{
  "data": [
    {
      "id": 1,
      "key": "company_name",
      "value": "Acme Corp",
      "type": "text",
      "locale": "en",
      "createdAt": "2025-01-05T09:00:00.000Z",
      "updatedAt": "2025-01-05T09:00:00.000Z"
    },
    {
      "id": 2,
      "key": "phone_number",
      "value": "+1 (555) 123-4567",
      "type": "text",
      "locale": "en",
      "createdAt": "2025-01-05T09:05:00.000Z",
      "updatedAt": "2025-02-10T14:00:00.000Z"
    },
    {
      "id": 3,
      "key": "opening_hours",
      "value": "Mon-Fri 9:00-18:00",
      "type": "text",
      "locale": "en",
      "createdAt": "2025-01-06T10:00:00.000Z",
      "updatedAt": "2025-01-06T10:00:00.000Z"
    }
  ],
  "meta": {
    "total": 3,
    "perPage": 15,
    "currentPage": 1,
    "lastPage": 1
  }
}

POST /variables

Create a variable

Creates a new variable. The key must be unique per site and locale, and is used to reference the variable in templates.

Request Body

Content-Type: application/json

Field

Type

Required

Description

type

"text" | "calendar"

No

Resource type. One of: text, calendar

key

string

Yes

Required. 1-100 characters

label

string

Yes

Required. 1-255 characters

value

string

Yes

Required. Amount value. 1-100000 characters

description

string

No

Description text. Max 500 characters

locale

string

No

BCP 47 locale code (e.g. "en", "fr")

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/variables \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "support_email",
    "value": "[email protected]",
    "type": "text"
  }'

Response Example

JSON
{
  "data": {
    "id": 4,
    "key": "support_email",
    "value": "[email protected]",
    "type": "text",
    "locale": "en",
    "createdAt": "2025-04-06T12:00:00.000Z",
    "updatedAt": "2025-04-06T12:00:00.000Z"
  }
}

GET /variables/:id

Get a variable

Returns a single variable with its value.

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

Unique identifier

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

Response Example

JSON
{
  "data": {
    "id": 1,
    "key": "company_name",
    "value": "Acme Corp",
    "type": "text",
    "locale": "en",
    "createdAt": "2025-01-05T09:00:00.000Z",
    "updatedAt": "2025-01-05T09:00:00.000Z"
  }
}

PUT /variables/:id

Update a variable

Updates a variable's value. The key cannot be changed.

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

Unique identifier

Request Body

Content-Type: application/json

Field

Type

Required

Description

key

string

No

1-100 characters

label

string

No

1-255 characters

value

string

No

Amount value. 1-100000 characters

description

string | null

No

Description text

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/variables/1 \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value": "Acme Corporation"}'

Response Example

JSON
{
  "data": {
    "id": 1,
    "key": "company_name",
    "value": "Acme Corporation",
    "type": "text",
    "locale": "en",
    "createdAt": "2025-01-05T09:00:00.000Z",
    "updatedAt": "2025-04-06T16:00:00.000Z"
  }
}

DELETE /variables/:id

Delete a variable

Permanently deletes a variable.

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

Unique identifier

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

Response Example

JSON
{
  "message": "Variable deleted"
}

GET /variables/:id/translations

Get variable translation status

Returns the translation status for this variable across all enabled locales.

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

Unique identifier

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/variables/1/translations \
  -H "Authorization: Bearer $API_TOKEN"

Response Example

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

POST /variables/:id/copy-to-locale

Copy variable to another locale

Creates a translated copy of this variable in the target locale.

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

Unique identifier

Request Body

Content-Type: application/json

Field

Type

Required

Description

targetLocale

string

Yes

Required

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/variables/1/copy-to-locale \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"locale": "fr"}'

Response Example

JSON
{
  "data": {
    "id": 50,
    "key": "company_name",
    "value": "Acme Corp",
    "type": "text",
    "locale": "fr",
    "createdAt": "2025-04-06T15:00:00.000Z",
    "updatedAt": "2025-04-06T15:00:00.000Z"
  }
}