Tailor Companion API (1.0.0)

Download OpenAPI specification:

License: MIT

Token-authenticated REST API exposed by the Renick.TailorCompanion October CMS plugin. Lets a native client browse, sync and edit Tailor content offline-first. All responses use a { "data": ..., "meta": ... } envelope; errors use { "error": { "code", "message" } }.

Auth

Issue an access token from credentials

Manual pairing path. Verifies a backend user's login and password and returns a bearer token. Hard-throttled (5/min). The primary pairing path is a QR code generated in the backend.

Request Body schema: application/json
required
login
required
string
password
required
string <password>
device_name
string <= 120 characters

Responses

Request samples

Content type
application/json
{
  • "login": "string",
  • "password": "pa$$word",
  • "device_name": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List OctoberCMS sites

The sites the client can switch between. Send the chosen site as an X-Tailor-Site: <id> header on all content endpoints; without it the primary site is used. Single-site installs report one site with multisite: false.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Auth check and server metadata

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Start a backend session

Mints a single-use, short-lived URL that logs the token's user into the OctoberCMS backend. The app opens the returned URL in a web view (a top-level navigation cannot carry the Bearer header, so identity is bridged via a one-time nonce). The redeeming route is not part of this API contract.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Deployed build marker

Dependency-free deploy check. Reports the build constant compiled into the running plugin code, so it confirms which code is actually live — independent of DB migrations and PHP OPcache — even when the optional static-pages subsystem is misconfigured. A 404 means the deployed code predates this endpoint; an old build means files updated but OPcache / PHP-FPM still serve stale bytecode.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Schema

All blueprints, normalized

Every entry blueprint and global aggregated into the wire structure the client renders forms from. ETag equals the global schema_version; send it back as If-None-Match to get 304.

Authorizations:
bearerAuth
header Parameters
If-None-Match
string

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Entries

Cursor-paginated entries of a blueprint

Authorizations:
bearerAuth
path Parameters
uuid
required
string <uuid>

Blueprint uuid (from /schema).

query Parameters
cursor
integer
Default: 0

Last seen entry id; page returns entries with a greater id.

per_page
integer <= 200
Default: 50

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

A single entry

Authorizations:
bearerAuth
path Parameters
uuid
required
string <uuid>

Blueprint uuid (from /schema).

id
required
integer

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Live search over a recordfinder field's target model

A recordfinder field associates entries with a regular (non-Tailor) model that the app never syncs. This endpoint searches that model so the app can offer a picker. The model class is resolved server-side from the field definition — the client only names the blueprint and field. Results use the field's nameFrom column as the title.

Authorizations:
bearerAuth
path Parameters
uuid
required
string <uuid>

Blueprint uuid (from /schema).

field
required
string

The recordfinder field's name.

query Parameters
q
string

Search term matched against the display column.

cursor
integer
Default: 0

Last seen record id; page returns records with a greater id.

per_page
integer <= 100
Default: 25

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

The single record of a global blueprint

Globals have exactly one record — there is no list. Relation and repeater fields on globals are read-only via the API.

Authorizations:
bearerAuth
path Parameters
uuid
required
string <uuid>

Blueprint uuid (from /schema).

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Sync

Incremental change journal

Coalesced create/update/delete records since a cursor. Omit since to signal the client has no cursor yet (full pull required). A since older than pruned history returns 410.

Authorizations:
bearerAuth
query Parameters
since
integer

Cursor from a previous response's latest_cursor.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Apply a batch of write operations

Operations are applied in order; each yields an independent result (ok / conflict / error). Blueprint validation always runs. Unknown or read-only fields are returned as warnings, never dropped silently. Max 100 ops per batch.

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
Array of objects (BatchOp) <= 100 items

Responses

Request samples

Content type
application/json
{
  • "ops": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    }
}

Files

Upload an attachment

Multipart upload. Returns a file descriptor whose id is then referenced in a fileupload field of a subsequent batch op. Max 50 MB; only safe media/document extensions are accepted.

Authorizations:
bearerAuth
Request Body schema: multipart/form-data
required
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "data": {}
}

Download an attachment

Authorizations:
bearerAuth
path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

System

Tail of the application error log

Returns the last N lines of the OctoberCMS application log for a console view in the app. Read as a bounded reverse-tail, so a large log stays fast. Gated by the logs_enabled backend setting.

Authorizations:
bearerAuth
query Parameters
lines
integer [ 1 .. 10000 ]
Default: 1000

How many trailing lines to return (clamped to 10000).

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Pages

Static pages (optional RainLab.Pages integration). All endpoints answer 404 feature_unavailable when the integration is missing or disabled; clients discover availability via features.static_pages on /ping.

Static page layouts, normalized

Every static-page layout aggregated into a form definition using the same wire field format as /schema, so clients render page editors with no extra field UI. ETag equals pages_schema_version; send it back as If-None-Match to get 304.

Authorizations:
bearerAuth
header Parameters
If-None-Match
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    }
}

Static page hierarchy

The nested page tree with per-page metadata and a content_hash (sha256 of the raw file). Clients diff hashes to pull only changed pages — there is no journal for static pages.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    }
}

One static page (full, editable)

Authorizations:
bearerAuth
path Parameters
fileName
required
string^[A-Za-z0-9\-_.]+$

Static page base file name without extension (from /pages/tree).

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an existing static page

Applies field changes to an existing page (v1 does not create, delete, move or rename pages). Send only changed fields. base_hash is the content_hash the edit was based on — a mismatch returns 409 with the current server page. url and layout are read-only; read-only/unknown fields come back as warnings with their rejected value.

Authorizations:
bearerAuth
path Parameters
fileName
required
string^[A-Za-z0-9\-_.]+$

Static page base file name without extension (from /pages/tree).

Request Body schema: application/json
required
base_hash
string or null

content_hash the edit was based on; omit to force-apply.

object

Changed field values keyed by field name.

object

Replacement lossless extras; omit to leave untouched.

Responses

Request samples

Content type
application/json
{
  • "base_hash": "string",
  • "fields": { },
  • "viewbag_extra": { }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    }
}

Static menus (read-only)

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

One static menu with its item tree (read-only)

Authorizations:
bearerAuth
path Parameters
code
required
string

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}