AI drafting and autopost

What the AI actions do, how they are limited, and the one place where AI output can go live.

5 min read

Draft only

Every AI action saves its result as a new draft revision of an entry, marked with the source ai. Nothing is published, scheduled or approved by an AI call. A person opens the draft, reads the diff and decides.

The model has no tools of its own. It cannot call your API, browse, or write on its own. ATLAS validates what it returns, and rejects an answer that has the wrong shape, uses blocks or media the entry does not have, contains an unsafe link or uses a word on your forbidden list. A rejected answer saves nothing.

There is one exception, which an admin has to switch on: autopost with auto publish (see Autopost below). Every manual action stays draft only.

Actions on an entry

These calls need a signed in dashboard session and the X-Brand-Id header. Any member who may edit the entry can run them, and a content type with a higher min_role still blocks lower roles.

POST/v1/manage/ai/entries/{entry}/write

Writes or rewrites a page. The body has a brief (3 to 4000 characters) and a mode: draft, rewrite or continue.

request.jsonjson
{
  "brief": "A short intro to our repair service for small shops.",
  "mode": "draft"
}

The answer is 201 with data.run (the AI run), data.revision (the new draft) and data.diff (a word diff against the previous version).

POST/v1/manage/ai/entries/{entry}/write/stream

The same body and permissions, answered as server sent events. You get event: delta chunks with {text} (the raw JSON the model produces), then event: done with {data: {run, revision, diff}} once the draft is saved, or event: error with {status, message}. Read it with fetch and a stream reader: EventSource cannot send a POST.

POST/v1/manage/ai/entries/{entry}/translate

Creates a translation of the entry as a draft. The body has the target locale (one of the brand's other languages) and an optional path. The answer also carries the new entry.

POST/v1/manage/ai/entries/{entry}/seo

Suggests an SEO title and description as a draft revision. No body.

POST/v1/manage/ai/entries/{entry}/alt-text

Looks at the entry's images and returns alt text suggestions on the AI run (201, data.run). Nothing reaches the media library yet.

POST/v1/manage/ai/runs/{run}/accept

An editor accepts the suggestions of a completed alt text run, and only then is the alt text stored on the media assets. It needs permission to create media.

Brand voice and quota

GET/v1/manage/ai/profile

Any member can read the AI profile. An admin saves it with PUT /v1/manage/ai/profile. The writer uses it on every call.

FieldMeaning
toneHow the brand sounds, up to 255 characters.
audienceWho you write for, up to 1000 characters.
forbidden_wordsUp to 100 words the AI must not use.
glossaryUp to 100 terms to keep consistent.
sample_postsUp to 5 samples of your style, 6000 characters each.
monthly_token_quotaTokens this brand may use per month. It is capped by a ceiling the installation sets.
GET/v1/manage/ai/usage

Returns this month's used_tokens, quota, remaining, cost and runs. Before each call ATLAS holds an estimate against the quota and settles it afterwards, so two calls at once cannot overspend it. When nothing is left, the call is refused with 429.

GET /v1/manage/ai/runs lists AI runs (admins only, 50 a page, filter by feature and status). Each run records the feature, model, tokens, cost, status and diff.

What the errors mean

StatusMeaningWhat to do
503AI is not set up on this installation.Ask the operator to configure a provider.
502The provider did not answer, refused, or timed out. Nothing was changed.Try again in a moment.
429The monthly quota is used.Wait for next month or ask an admin to raise the quota.
422The answer failed validation and was not saved.Change the brief and try again.

The streaming endpoint sends the same codes in its event: error.

Providers

ATLAS asks Gemini first. If that provider fails or has no key, it tries OpenRouter next. A provider without a key is skipped. You do not choose the model per request, and you cannot bring your own key in the dashboard: the operator of the installation configures the providers. Keys are never returned or logged.

Autopost

Autopost writes new posts for you on a schedule. An admin turns it on per brand.

GET/v1/manage/ai/autopost/settings

Any member can read the settings. An admin saves them with PUT /v1/manage/ai/autopost/settings.

settings.jsonjson
{
  "enabled": true,
  "auto_publish": false,
  "content_type_key": "post",
  "term_id": null,
  "locale": "en",
  "posts_per_day": 2,
  "hours": ["09:00", "15:00"],
  "topic_source": "both",
  "topics": ["How to choose a laptop for your shop"],
  "trends_geo": "ID",
  "trends_keywords": ["laptop"],
  "cover_image": true,
  "author_id": 12
}
  • content_type_key can only be post today.
  • posts_per_day is 1 to 24. hours are 1 to 24 slots as HH:MM in the brand's timezone.
  • topic_source is manual, trends or both. A manual or mixed list needs at least one topic (up to 500). With trends, ATLAS draws on stored trending topics for trends_geo, optionally filtered by trends_keywords (up to 20).
  • cover_image paints one cover image and sets it as the post's social image. If the image fails, the article is still saved.
  • author_id must be an active member of the brand.

Each due slot writes one new post. An article is planned and then written section by section, so a run takes minutes and costs tens of thousands of tokens from your quota. A post that is too short is refused. A failed slot is retried after ten minutes.

By default the post is saved as a draft and a review request is opened for your publishers. They approve it like any other review.

GET /v1/manage/ai/autopost/runs lists recent slots with topic, status (pending, success, failed), a short reason and the entry_id.

POST/v1/manage/ai/autopost/run-now

Admins can queue one slot right now (10 a minute). It answers 202 with {"data": {"queued": true}}. Autopost switched off is a 422.

The installation also runs the command atlas:ai-autopost every minute, which picks up due slots for every enabled brand.

Auto publish

The one exception

auto_publish is off by default and only an admin can turn it on. When it is on, autopost publishes the post it just wrote through the normal publish path, as a system actor with the author you chose, and writes an audit row (autopost.published). The review step is skipped. Leave it off unless you are happy to put unreviewed AI text on your site.

Changes to the autopost settings are audited as autopost.settings_updated.

Backfill

POST/v1/manage/ai/backfill/run-now

Fills missing SEO titles, descriptions and image alt text on your published entries, as drafts only. It is admin only (3 a minute) and needs the brand setting ai_backfill switched on, otherwise it answers 409 backfill_disabled. limit is optional (1 to 50, default 10).

The answer is {data: {entries, totals, stopped, next_cursor}}. A run stops when the quota is nearly used, at the limit, after about 25 seconds, or after three provider failures. Pass next_cursor back as after to continue. An entry that already has a newer draft is skipped. Alt text stays a suggestion until an editor accepts it.

For roles and reviews, see roles and permissions. For agents that call ATLAS from outside, see MCP and agent access.

Was this page helpful?

Suggest a change