Concepts
The Overview introduces the terms this page uses, and the API Reference lists every field.
Keys and service accounts
A service account is an account in your Helix org for software rather than a person. A key (hxk_…) belongs to
one service account, and you send it on every call as Authorization: Bearer hxk_….
- Who makes them. An admin in your org creates the service account in Helix Studio under Settings → Developer, gives it a role in the spaces it should reach, and creates its key. Helix shows the key once. Store it as a secret, never in code, URLs or logs.
- What a key reaches. The org comes from the key, so you never send it. The service account reaches only the spaces it was given, with the role it has in each.
- Changing keys. A service account can have two active keys at once, so you can change keys without a gap: create the new key, switch your system to it, then revoke the old one.
- Expiry. The admin may give a key an expiry date when they create it. After that date the key gets
401, and it no longer counts toward the two.GET /medoesn't show the expiry, so ask your admin and note it where you store the key. - When access ends. Helix checks the key on every call, so a revoked key gets
401from its next call. A space the account loses access to answers404from the next call too.
Disabling a service account
An admin can disable a service account in Helix Studio. Disabling is permanent: it can't be undone. From that moment:
- every key of the account gets
401; - its webhook endpoint is switched off, and events not yet delivered are dropped;
- articles it has running are stopped. They end
canceledand send no webhook.
To give your system access again, the admin creates a new service account and key, and you ask the Helix team to register a webhook endpoint for the new account (see Webhooks). The new account starts empty:
- It can't read the old account's articles, because an account reads only the articles it created. People in Helix Studio can still open them.
externalIdis unique only within one account, so the new account can reuse IDs the old one used.
Spaces and roles
A space is a section of your org, such as a website, a client or a desk. Spaces form a tree: access to a space includes every space below it. Each article lives in one space. The space decides which writers and article types the article can use, and who can open it.
An account has a role in each space it can reach: Viewer, Writer, Editor or Admin. Creating or stopping an article
needs the Writer role or higher in that space. writer.canCreateArticles on a space tells you whether your account may
create articles there.
- 404 and 403.
404means your account can't see the thing, or it doesn't exist; the API doesn't say which.403means your account can see the space, but its role there doesn't allow the call. - IDs are stable. A space keeps its ID when it is renamed or moved, so you can store space IDs, for example to map
your own clients or sites to spaces. A deleted space answers
404, as does one your account can no longer see. - Listing spaces.
GET /spaceslists every space your account can see, in tree order. AddparentIdto get only the spaces directly under one, orancestorIdto get every space below one at any depth. Send one or neither, not both. Each space has itsname,parentId,path(the names from the org down to it) andchildCount. - Writers and article types (writing voices and kinds of article) come from the space and the spaces above it. One
from a space above has
inherited: true, and itsspaceIdmay be a space your account can't open. The lists show the space's own first, then each space above it, nearest first, and by name within each. Only people in Helix Studio can set them up. - Writer switched off. If Writer, the Studio app, is switched off for your org,
GET /spacesanswers an empty list and the writer and article-type lists answer404.
Written and edited articles
POST /writer/articles creates either kind. The article starts at once and runs unattended.
Written ("kind": "written"): Helix writes the article from your brief.
briefis everything Helix's writing agent is told. There are no separate fields for length, audience or keywords: put them in the brief, in plain words. Its maximum length, like every size limit, is in Limits.writerIdandarticleTypeIdare required, and must be ones the space lists (GET /writer/config/writersandGET /writer/config/article-types). A space with no writers can't take written articles: the create answers400 VALIDATION_FAILED.titleis optional. Helix writes the article's own title. Until it does, yours shows. Afterwards Helix keeps both, astitleandsuppliedTitle.
Edited ("kind": "edited"): Helix checks and edits the article you send as content.
formatishtml,markdownorauto.htmlincludes HTML pasted from Google Docs or Word. Send plain text asmarkdownorauto.titleis the article's own title. If you leave it out, Helix takes the title from the content. If the content has none, the create answers400.writerIdandarticleTypeIdare optional. Without them the article uses Helix's built-in Edited type and keeps its own voice.autoFixdecides what happens to the problems Helix finds. Either way it finds the same ones.true(the default) applies the safe fixes, records each one, and leaves the rest open.falsechanges no words and leaves every suggestion open, for a person to handle in Helix.- Every edited article is a new article in Helix. Helix never merges in changes made to the text somewhere else.
- Helix imports the content while it answers the create. If it can't, it refuses the create at once with
400 VALIDATION_FAILEDand adetails.reason:empty,unparseable,too_large(over the size limit) ortoo_long(too much article text). Both limits are in Limits.
Titles and briefs, both kinds.
- A title must be on one line. A line break or a control character in it is a
400. - A brief or title with no visible text (only spaces or zero-width characters) is a
400. - On a written article, Helix stores your title trimmed, with each run of spaces as one space.
suppliedTitleshows it as stored;input.titleshows what you sent.
externalId
externalId is your own ID for an article, required on every create. It names one attempt, not one order: use your
order ID plus a counter, such as 4821-write-1, then 4821-write-2 if you run it again.
- It is 1 to 255 characters, each matching
[A-Za-z0-9._:-]. It can't be.or.., or look like a UUID (UUIDs are reserved for Helix's own IDs). - Wherever a path takes
{ref}, you can pass Helix's articleidor yourexternalId. A UUID is read as Helix's ID. - It must be unique among your service account's articles. Reusing one answers
409 ALREADY_EXISTS, with the existing article's ID indetails.articleId. Another service account, even in your org, can use the sameexternalId.
Retrying a create
The uniqueness rule makes a create safe to retry. Send the same request again when the create:
- timed out, or the connection dropped before you got an answer;
- answered
429(wait for the seconds inRetry-Afterfirst); - answered
500or503.
You either create the article or get a 409 naming it. If you get the 409, read the article and check its input. That
confirms it is the article you meant, and not one whose ID you reused by mistake. Don't retry any other 4xx unchanged:
fix the request first.
Two rare cases:
- If two creates with the same
externalIdarrive at the same moment, one creates the article and the other may answer503instead of409. Sent again, it answers409with the ID. - If your account has since lost access to that article's space, the
409still names the article, but reading it answers404.
Once an article has been deleted in Helix, you can use its externalId again.
The article lifecycle
Helix works on an article in runs. A run is one stretch of unattended work, from start until the article ends or stops. A new article gets one run. A person who continues the article in Helix Studio starts another.
An article's status tells you where it is:
status | Meaning |
|---|---|
pending | Created; its first run hasn't started yet |
running | Helix is working on it |
completed | Finished |
failed | Ended with an error. error.code says why and error.message can be shown to people |
canceled | Stopped, by you or by a person in Helix |
While an article is running, stage says what Helix is doing. Otherwise stage is null. The stages each kind goes
through, in order:
| Kind | Stages |
|---|---|
| Written | researching, planning, writing, polishing |
| Edited | researching (this covers checking the import too), then editing |
Use stage for display only, and don't build logic on it: Helix may add stages, and a stage can repeat. Expect an
article to take several minutes or more.
Taken-over articles. A person can take an article over in Helix Studio and work on it there. While it waits for
them it reads running, though Helix isn't working on it, and it stays running until they finish. That can take days.
Don't treat a long running as stuck. Stopping such an article answers 409.
Endings. What each ending means for your system:
| Ending | What it means | What to do |
|---|---|---|
failed, error.code USAGE_LIMIT_REACHED | Your org has used its allowance | Contact the Helix team. Don't retry: a new attempt fails the same way |
failed, error.code RESEARCH_FAILED, WRITING_FAILED or INTERNAL_ERROR | Research, writing (or editing), or Helix itself failed | Retry as a new attempt: create it again with a new externalId, such as 4821-write-2. You can revise the brief first |
canceled | You, a person in Helix, or a disabled service account stopped it | Create a new attempt only if you still want the article |
| deleted | A person deleted it in Helix | It answers 404 from then on. If it hadn't ended, you get writer.article.canceled first |
error.message is a sentence you can show to people. Treat an error.code you don't recognize as you would
INTERNAL_ERROR.
An ending can change. A person can pick up a failed or canceled article in Helix and continue it. Its status then goes
back to running and ends again, and you get a webhook for each change. A person's edits to a completed article don't
change its status, but updatedAt moves.
Following an article. Use webhooks, and treat the article itself as the source of truth:
when in doubt, read it with GET /writer/articles/{ref}. Poll only as a fallback (see
Polling).
Stopping an article. POST /writer/articles/{ref}/stop ends its run at once and answers 200 with the article, now
canceled. Sending the stop again gives the same answer, so a stop whose answer you lost is safe to repeat. It answers
409 CONFLICT in three cases:
- the article has already completed or failed, so there is nothing to stop;
- a person has taken the article over in Helix and it is waiting for them, so no run is going;
- a person in Helix started it again while you were stopping it. Read it, then stop it again if you still want to.
Stopping needs the Writer role or higher in the article's current space (403 otherwise). A person in Helix can stop your
article too; it then reads canceled.
Deleted articles. An article deleted in Helix answers 404 from then on and is left out of every list.
Polling
Webhooks are the way to follow articles. If you poll instead, or as a backup:
- Read only articles that haven't ended, one at a time, with
GET /writer/articles/{ref}. Stop reading an article once itsstatusiscompleted,failedorcanceled. - Every read counts toward your service account's limit of about 300 reads a minute, shared with all your other reads (see Limits). Reading each unended article once a minute keeps you under it while you have fewer than about 250 of them.
- A taken-over article can stay
runningfor days (see The article lifecycle); read those less often.
Listing articles
GET /writer/articles lists the articles your account created, newest first, in spaces it can still see. Filter with
externalId, spaceId (that space only, not the ones below it), kind, status, createdSince and createdUntil.
A spaceId your account can't see gives an empty list, not a 404.
createdSince includes its time and createdUntil excludes it, so back-to-back windows never count an article twice.
Both work to the second: Helix drops fractions of a second.
New articles arrive at the top of the list, so while they arrive, offset paging can show an article twice. To page through everything you have created (a backfill):
- Fix the end: set
createdUntilto the time you start, and keep it for every page. - Page with
offsetuntilhasMoreisfalse. - De-duplicate by
id, since an article deleted meanwhile can still shift a page.
To pick up new articles after that, list with createdSince set to the createdAt of the newest article you have, and
de-duplicate by id again, since createdSince includes its own time.
The list has no filter for recent changes (there is no updatedSince). To catch up on changes, read the articles you
track; see Catching up after downtime.
Review facts
When an article completes, review tells you what Helix's checks found. It gives facts, not a verdict: you decide what
needs a person.
An issue is a problem Helix's checks flagged in the article, such as a fact they couldn't confirm or a broken writing rule. It stays open until someone fixes or dismisses it, in Helix Studio's Issues tab.
openIssuesis how many issues are open now. It matches the count on the Issues tab, and it drops as people resolve issues there.checksCompletedisfalsewhen the checks didn't finish. ThenopenIssues: 0does not mean the article is clean.
review is null until the article first completes.
Reading an article
GET /writer/articles/{ref} returns the latest version of the article.
htmlis the body, without the title. While the article isrunningit may be partial.titleis never empty: the article's own title, else the one you supplied, else the first sentence of your brief.urlopens the article in Helix Studio, for people who need to see or work on it there.sourceslists the pages the article draws on.- List items leave out
htmlandsources; read the article for them. - You can read only articles your account created, and only while it can still see their space.
What an edit keeps
Helix imports an edited article into its editor and exports it back as HTML. Not everything in your HTML survives that
round trip. import.changes on the article lists everything the import dropped or changed, as { kind, what, count }.
kind is dropped_element, dropped_attribute, dropped_url or changed. what is a label for people, such as
"attributes on <h2>", not a stable key.
import.changes is already filled in on the create's 202 answer, because Helix imports the content before it answers
the create.
Helix tests the import with HTML from two sources: Froala, a widely used web text editor, and Google Docs. HTML from other editors behaves the same way where it uses the same tags and styles.
Kept
- Text formatting: bold, italic, underline, strikethrough, subscript, superscript and line breaks. These are kept whether
they're written as tags (
<b>,<em>,<sub>) or as inline styles, as Google Docs writes them (font-weight,font-style,text-decoration,vertical-align). - Headings, lists, horizontal rules, and tables' text and cells.
- Links, with their
target,rel,classanddata-*attributes. - Inline tags such as
<mark>and<span>, with theirclass,idanddata-*attributes, so your comment marks survive. - Images, with
src,altandclass. A Froala image caption becomes the image's caption.
Changed, or not kept yet
- An image inside a paragraph is moved after the paragraph's text, because Helix puts images on their own line. Image width styles are dropped.
- Videos and other embeds (
<iframe>,<video>, Embedly) are removed. An Embedly block keeps its link. id,classanddata-*attributes on paragraphs, headings, lists and tables are dropped, and so are images inside table cells.- Every other inline style (color, font, font size, alignment, spacing) is dropped and listed in
import.changes. - A table's header grouping (
<thead>) is dropped, though its header cells stay. Paragraphs, headings and lists inside a quote become one quote with line breaks. Both are listed inimport.changes.
Helix always removes <script>, <style>, <noscript> and <template> elements and event-handler attributes, and
import.changes doesn't list them. Every other change the import makes is listed there.
Conventions
These apply to every endpoint.
- Responses. A success is
{ "success": true, "data": … }. An error is{ "success": false, "error": { "code", "message", "details"? } }. Readcode;messageis for people and may change. See Errors. - Lists.
dataholds{ "items", "total", "pagination": { "limit", "offset", "hasMore" } }. Passlimit(50 by default, at most 100) andoffset. Each article in a list carries its whole brief, so keeplimitmodest for articles. - Field names are camelCase.
- Times are ISO 8601. Times you send must include a zone (
Zor an offset).createdAt,updatedAtand the list's time filters work to the second; other times may carry milliseconds. - Bodies. Send JSON with
Content-Type: application/json. A body that isn't JSON, or a missing or differentContent-Type, answers400 INVALID_BODY. - Unknown fields. Helix answers
400to a body with a field it doesn't know. It ignores query parameters it doesn't know. - Unknown paths and methods. An unknown path answers
404, and so does a known path called with the wrong method. - IDs are opaque. Store them as text, up to 128 characters, and never parse them: different records use different forms.
x-request-id. Every response has this header. Quote it when you report a problem (see Reporting a problem).- New fields and values. Helix adds them without notice and doesn't remove existing ones. Ignore fields you don't
recognize, and treat a
status,stage,kindor errorcodeyou don't recognize as something new, not as an error. - HTTPS only. A plain-HTTP request answers
400 INVALID_PARAMSwith the message "Use https." - From your server only. Call the API from your own server, never from a browser. The API sends no CORS headers, so browsers block the calls, and a key in a web page can be read by anyone who opens it.
Reporting a problem
Email the Helix team at [email protected]. Include:
- the environment: production or development;
- the
x-request-idof the response, if you have one; - the article's
idandexternalId; - for a webhook, its
webhook-id; - the time it happened, in UTC;
- the name of your service account.
Never send your key or your webhook signing secret.