Tayl Tayl Public API

Conventions

Requests, scopes, personal keys, errors, rate limits, retries, pagination, incremental sync, IDs, bulk requests and course write concurrency.

Part of Tayl's API docs: requests go to https://tayl.pro with Authorization: Bearer <key>, and Errors explains every error code.

Requests

Send every request over HTTPS with Authorization: Bearer tayl_live_… and Accept: application/json. Send JSON bodies with Content-Type: application/json, as valid JSON without comments or duplicate keys, and booleans as JSON true or false.

Requests are checked strictly rather than quietly coerced:

Routes use PATCH for updates, which merge: fields you leave out keep their values. Course drafts and their chapters, pages and outline also take PUT, which replaces them.

Scopes

Each operation needs one scope, shown beside it as Scope. A key holds the scopes an organisation admin chose for it:

A 403 insufficient_scope names the scope that's missing. An organisation admin can add it to an organisation key in Tayl; for a personal key, its person creates a new key that includes it.

Personal keys

A personal key acts as its person. Whatever scopes it holds, it reaches only what they can in Tayl:

Every change records the person, the key and whether it came through the API or an AI assistant.

Errors

Errors share one envelope:

{
  "errors": [
    {
      "code": "insufficient_scope",
      "message": "Token lacks the required scope: tasks:read",
      "documentation_url": "https://tayl.pro/api/v1/docs/errors#insufficient_scope"
    }
  ],
  "request_id": "019cf5b0-7c00-7000-8000-000000000099"
}

Branch on the HTTP status and code, never on message. Validation errors add field and a JSON Pointer in pointer, and an external-ID conflict adds existing_id when the key can see that record. Each error's documentation_url links its entry in Errors, which says what the code means and how to fix it. Bulk results carry their own errors the same way.

request_id also comes back in the X-Request-Id header. Record it with a failed call, without the key or any sensitive body, and include it with the time of the call when asking Tayl for support. An unexpected 500 can come from outside the API with a different JSON body, so parse errors defensively.

While an organisation's account needs attention, because its plan does or Tayl has put it on hold, every request except GET /api/v1/api-keys/current returns 402 organisation_restricted until it's resolved in Tayl; the self-check's restriction gives the reason. Don't retry it automatically.

Rate limits and retries

Each key has its own limit of requests per second, and requests without a key are limited to 30 a minute from one IP address. A 429 carries Retry-After in seconds, with X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Wait at least Retry-After, then retry with jitter.

Retry network failures and 5xx responses on reads with bounded exponential backoff. A timeout or 5xx on a write doesn't prove it failed: before retrying a create or update, look for the resource by its Tayl UUID or your external_id, or the retry may duplicate it or repeat a side effect. Don't retry a 4xx unchanged; fix the key, scope, ID or body first. Put a limit on attempts and report a failure once it's reached.

Pagination

Lists take one-based page and per_page parameters: 25 by default, 100 at most. Responses carry a meta object with the current page and totals, and an RFC 8288 Link header with first, prev, next and last URLs where they apply:

Link: <https://tayl.pro/api/v1/tasks?page=2&per_page=100>; rel="next", <https://tayl.pro/api/v1/tasks?page=8&per_page=100>; rel="last"

Follow the rel="next" URL until there isn't one rather than building page numbers yourself, and check it's HTTPS and the same origin before sending the key to it. Records can move while you page through a list, so expect duplicates.

Incremental sync

Lists of tasks, completions, certificates, users, groups, assignments and content offer a since filter: an inclusive ISO 8601 timestamp of changes to include. To sync:

  1. Note the time just before you start reading.
  2. Read every page, upserting each record by its id. Records at the boundary can repeat, so processing must be idempotent.
  3. Only once every page has succeeded, use the time you noted as the next since.

since isn't a snapshot, and each list's description says which changes count. Business dates such as completed_after and issued_after aren't safe cursors, because an old completion can be recorded today. Lists don't report every deletion or removed relationship, so run a full reconciliation regularly; webhooks reduce delay but don't replace it.

IDs and external IDs

Tayl's UUIDs are opaque strings: don't parse them or infer an order from them. People, groups, group categories and assignments can also carry your own external_id, unique within the organisation. Use an immutable ID from your source system, not an email address or name, and address records by it with the /by-external-id/… operations, URL-encoding it in the path. Another record already using an external_id returns 409 duplicate_external_id, with its UUID in existing_id when the key can see it. Archiving or deleting a record releases its external_id.

Bulk requests

Bulk user and group-membership requests take up to 500 entries and process each one independently. The overall status summarises the result:

Check every entry's result, even on 200 and 201, and retry only failed entries whose error is temporary. Replaying a whole batch can repeat what already succeeded.

Concurrency on course writes

Every course draft write needs the etag from your last read as the If-Match header, or returns 428 precondition_required. If the course changed since, including in the course builder, it returns 412 version_changed: read it again and reapply your changes. One etag covers the whole course, and each write returns the new one, so send the latest each time.