Docs: Operator API
Operator API
Let a script or an AI assistant read your Tilspire site and propose changes that a person approves.
The Operator API lets a script or an AI assistant work with your site: read its content, configuration and database structure, and propose changes for a person to approve. It arrived in 1.11.0, and it's off until you turn it on.
What it can and can't do #
- Read pages, blog posts, menus, media, templates, the site's status and its settings (never a secret), and the database tables Tilspire's read policy allows — some of them only as a count.
- Create, update and delete: propose a new item, an edit or a deletion. A proposal is a draft: nothing reaches your site until a person approves it in the Review queue, and approving saves it through the same code the admin panel uses. Since 1.21.0 approving a deletion moves the item to the site's recycle bin, as the person who approved it. It is kept for the number of days set there (30 by default), and a person can restore it from the bin; a restore is itself a proposal a person approves. A credential can never delete for good, empty the bin or change the keep period.
- Since 1.15.0 it can propose pages, Blog posts, menus, redirects, images, settings, theme options and design, translations, forum moderation (hide, show, lock, pin or move) and ticket replies, each under its own gates and grants. Tickets have their own switch, and a ticket is read without the client's name, email or tracking ID.
- Since 1.16.0 it can also propose Layouts — a new one with its groups and fields, a change to one, or deleting one — and changes to an existing field. A page draft may name a Layout that is still waiting, so an agent can propose both in one sitting; the page can be approved once the Layout is. A field that already holds content can only become plain text, and a Layout or field still in use can’t be deleted this way.
- Since 1.18.0 it can also read page links, roles, available updates and AI usage, and propose comment moderation, comment threads and comment settings, field groups, and deleting one language's translation of a page. With Feedback's Tracker switched on, it can read and propose tracker items too. None of these can be self-approved.
- Since 1.18.0
GET userslists staff accounts, for a credential grantedmanage_users. It returns{total, items}, lowest id first, at most 500, and never includes an email address, a password hash or a second factor. It belongs to no job, so it is granted on the Grants tab only. - Since 1.19.0 it can read Blog categories, and propose a new one, an edit or a deletion. A post draft can also set a post's category. None of these can be self-approved.
- Since 1.19.0
GET medialists files in the order of theiridand pages with a numeric cursor, and can be narrowed byfilter.folder,filter.tagorfilter.q(a word in the name or alt text). An integration that listed media before must start its listing again.GET media-foldersandGET media-tagslist the folders and tags with their counts. An image you approve goes into a month folder, as an upload in the panel does. - Since 1.19.0
POST cache/clearempties the page cache at once. It is the one write that skips the Review queue, because it changes no content and loses nothing. It needs the credential to hold the Settings job and its account to be allowed to manage settings. - Since 1.19.0 a settings draft respects the per-page Settings permissions: the account behind the credential must be allowed to write each key the draft changes, and the person who approves it is asked again.
- Since 1.19.2 it can also propose the Pages settings, the Helpdesk settings and the Tracker's settings, and a Tracker's structure: types, statuses, fields, categories, milestones and moves. Anything a draft leaves out of those lists is kept; it never deletes structure. It can also propose restoring a Tracker item or a hidden comment, or a recount. A comment settings draft can now set how long spam waits before it is deleted. None of these can be self-approved. New reads:
GET drafts/retention,GET pages/options,GET pages/defaults,GET posts/defaults,GET tickets/settingsandGET tracker-settings. - Since 1.20.0 it can also read member notifications as counts only (
GET notifications), one staff account with its ban and the roles it holds for places (GET users/{id}), the report queue (GET reports), the counts on one item's reactions (GET reactions; who reacted is never read),GET forum-moderators/{id},GET forum-topic-details/{id}andGET forum-nodes/{id}/options. It can propose one role's staff badge, the Analytics ignore list, forum tags, a forum's own options, a topic's type, solution or tags, closing its poll, and the new Notifications, reactions, home page and Forums settings. A credential never raises a notification, follows, reacts, writes role settings or a member's own choices, or adds or removes a passkey, and deciding a report stays a person's job. - Since 1.21.0 it can also propose, each as a draft a person approves:
- a poll on a forum topic (start one, set when it closes, or remove it); the poll's forum moderator approves it, a start is applied only when the topic's author approves it, and it is never self-approved;
- a decision on a report: keep, remove or dismiss, on a reported forum post or comment, or on a member's profile picture, banner or about text. The approval has the same effect as the report centre's own buttons;
- a ban or a restriction on a member, and account switches. A ban or restriction proposal must carry a reason; one without is refused and nothing is stored;
- the community rule book, member badges and their order, and approving or rejecting a held forum post;
- webhook endpoints, social accounts, moving an item back out of the recycle bin, and converting a page to a post or a post to a page (the original goes to the bin and the old address redirects to the new one; Undo is a person's act in the editor).
- Since 1.21.0 it can also read:
GET webhooks(endpoints, a webhook's deliveries and the event list),GET autopost(social accounts and what was queued for them),GET community-ruleswith its acceptance counts,GET member-restrictionsfor one account,GET recycle-binandGET conversions.GET updatesnow names the release channel it read, andGET settingscarries the new switches and, to an account that may set it, the site's default dashboard. A ticket read answershas_account(true or false) and never which account. - Direct messages have no Operator API reads and no writes: a credential cannot read a message, a block, a member's message choice or who writes to whom, and machine content never reaches a member's inbox. Only the three settings (on or off, who may start a conversation by default, and how long messages are kept) and the role limits can be read, and the settings can be proposed as a draft.
- It can never issue credentials or grant itself anything, and it never publishes on its own unless a person turns on self-approval for that credential (below). Since 1.21.0 it also cannot change the release channel, turn webhooks or social posting on, empty the bin or set the default dashboard.
Turning it on #
- As an administrator, open System ▸ Operator API and, under Gates, turn the API on and switch on what you want to offer: Create, Read, Update and Delete for each resource, side by side. While it's off,
/apiisn't claimed at all. - Turn on two-factor sign-in for your account if you haven't: issuing a credential requires it.
- Under Credentials, issue one. Name it, choose when it expires — 90 days by default, a year at most — and, if you like, limit it to the addresses it may connect from. Copy it straight away: it's shown only once.
- Choose what that credential may do. Since 1.16.0 each credential lists jobs — such as Write and edit pages, Shape Layouts and fields, Translate pages and menus or Read the site status — and one switch gives it everything that job needs. A job offers only what your own account may use, and modules can add jobs of their own. Since 1.21.0 one job is new, Write the community rules. Everything else new (webhooks, social posting, bans, restrictions, the recycle bin and polls) is granted on its own on the Grants tab, because widening an existing job is your call. A credential that held a job in full is not given the job's new part; the panel shows the job as partly granted until a person switches it on. For a single grant, the Grants tab still shows the full Create, Read, Update and Delete table; users, roles and the activity log are only ever granted there.
The panel #
The Operator API page has four tabs: Summary, Credentials, Grants and Gates. Since 1.21.0 Gates has a Self-approve column beside Create, Update and Delete for every resource that can be self-approved (see below), and redirects are two lines there: links on this site and links to other sites. A rule's target decides its line: another host, any scheme, a link starting with // and a link containing a backslash all count as other sites. A change of target needs the lines of both its old and its new target, and a refused proposal names the missing line. Both lines start off for a new install. On update every live redirects grant and every switched-on redirects switch was copied to the second line, so nobody lost reach. Credentials is a table with the columns Credential, Status, Expires, Last used and Addresses. Select a row to open its detail drawer, which offers Rename, Addresses, Extend, Roll and Revoke.
The call log #
Since 1.18.0 the API keeps a log with one row for every request whose bearer names a real credential, refused requests included. Rows are kept for 30 days (90 until 1.19.0). The log never records the ids in the path, the query string, the body or the token. The Summary tab shows "API calls in 30 days".
Proving it's you #
Changes on this page ask for your password and a code from your authenticator app. Issuing, rolling or extending a credential asks every time. For everything else — grants, gates, names, addresses, revoking — one proof covers the next 15 minutes. The page shows until when, and End now closes the window early.
Looking after a credential #
- Extend adds 30, 90, 180 or 365 days to a live credential's expiry, never past a year from today. The page offers only the lengths that fit and shows the new date before you confirm.
- Roll replaces a credential with a new secret, keeping its name, its addresses and its grants. The old secret stops working at once, and any proposals it still has waiting are withdrawn — the page tells you how many first. Use it when a secret may have leaked. An expired credential can be rolled; a revoked one can't.
- A credential marked Account changed belongs to an account whose password or two-factor sign-in has changed since it was issued, so it no longer works. Roll it to carry on, or revoke it.
How a credential is limited #
- It acts as the account that issued it, and never does more than that account could. If the account is disabled, moved to another role, or turns two-factor sign-in off, the credential stops working.
- It expires, and it can be revoked at any time.
- Each credential has its own grants, and each resource has a switch for the whole site, so you can withdraw something from every credential at once.
- A draft on an item someone else is editing is refused with
locked(HTTP 409).GET pages/{id}andGET posts/{id}carrylocked,locked_byandlocked_at; the rank of whoever holds the lock is never shown. - It may make 600 requests every 10 minutes.
Connecting #
Send the credential in the X-Api-Token header, never in a URL:
curl -H "X-Api-Token: $TSPO_TOKEN" https://example.com/api/v1/
Since 1.18.0 GET settings also returns section_<id>_path, _title and _former for each section. _former is read-only: no draft may write it.
That first request lists what the credential may use right now. The full contract is an OpenAPI document at /api/v1/openapi, and AI assistants that speak the Model Context Protocol connect to /api/v1/mcp. The Connect card on the Operator API page shows both addresses for your site, with a ready-made command for Claude Code.
Reviewing proposals #
Proposals wait in the Review queue. Anyone allowed to edit that content sees what would change, field by field, can preview a page, post or menu on the real site, and approves or rejects it, with a note if they like, or up to 50 at once. If the page changes after a proposal was written, the proposal can't be approved, so it never overwrites newer work. HTML in a proposal is always filtered, as it is for an editor without raw-HTML rights.
Once a proposal is decided, its content is kept for 90 days by default and then reduced to a short record of who decided what and when. Whoever may change site settings can choose 30, 90, 180 or 365 days under Keep decided drafts for in the Review queue; a shorter period asks first and says how many proposals it will empty. A credential cannot change it.
Self-approval #
Off by default. The account that owns a credential can let it publish its own new and edited pages, Blog posts and new images without the Review queue, for 1 hour, 8 hours, 24 hours or 7 days, never longer. It needs a tight list of addresses the credential connects from, and your password and code every time.
Since 1.21.0 self-approval is chosen for each resource. On Gates the top role sets a Self-approve lever for every resource that can be self-approved, in the same batch and with the same password and code as the other switches. It is a ceiling: a credential with a self-approval grant can self-approve a kind only while that resource's lever is on, and the lever is read every time the grant is used. Turning a lever off ends its use in every running grant at once and changes no grant; a draft that is waiting when its lever goes off is put back to pending for a person. Turning it on again revives it only within the grant's remaining time and kinds. The grant dialog offers only kinds whose lever is on. On update the levers for pages, posts and new images were switched on, which keeps exactly what every grant could do before. Every other lever starts off.
- Deletions, settings, menus, Layouts and fields, comment moderation, tickets, the Tracker, bans, restrictions, report decisions, polls and single records always wait for a person. A draft that switches a post's forum topic on waits for a person too. Forum moderation does too, apart from one switch the top role can turn on for each kind on the Operator API page: it lets a credential hide a topic or reply at once when it proposes, at most 10 an hour. A person still decides it afterwards, and rejecting it shows the item again.
- At most 60 items an hour are self-approved; beyond that they wait in the queue.
- Everything self-approved is listed in the Review queue's Self-approved view, where a person can undo it, and the activity log names the credential.
- It ends early when the owner turns it off, the credential is revoked, its addresses change or it is granted more, and when the owner's account is disabled or moved to another role.
Limits worth knowing #
- An image is sent as base64
contentwith aname: jpg, png or webp only, at most 5 MB decoded and 25 megapixels. A request that proposes an image may be at most 8 MB; every other request at most 1 MB. Only a deletion is proposed by file name. - A page title holds up to 255 characters.
- A credential may have 50 proposals waiting at a time.
- A webhook proposed through the API gets one answer,
endpoint_unreachable, whether the address resolves nowhere, leads into a private network or uses plain http, so a credential cannot use a proposal to map your network. The panel's own form still says which. An approved new endpoint is created switched off with no secret; a person sets a secret and switches it on. See Webhooks. - A ban or restriction proposal must carry a reason.
- One account may hold at most 20 live credentials.
- Closing an account has no API verb: it stays a person's act.
- A credential's expiry is counted on the server's own clock, not UTC, so its end can move by an hour at a daylight-saving change. Give an expiry an hour of margin.