GET/articles/{article}

Retrieve an article

Read one article, including its content. This is the only operation that returns a body.

The same two gates apply as on the list. An article stamped with an audience answers 404 to a credential that does not hold that audience, and a future dated article answers 404 until it goes live, including to the newsletter's own team, so that a preview link cannot be shared early.

For an article written in Commune, content is the email rendered to HTML with personalization placeholders resolved against an empty context, so a merge tag never leaks as raw text. For an imported article it is the body as it arrived from the provider.

?expand=content adds content_markdown, the same body as Markdown. Ask for it when a model is going to read the article, and ask for ?fields=content_markdown with it to leave the HTML behind entirely.

4 parameters
articlestringrequired

The article's id (a UUID) or its short_id, an eight character base62 string that is unique across Commune. The slug is not accepted here because it is unique only within a newsletter.

expandstringoptional

Comma-separated list of relationship paths to inline in the response. Unexpanded relationships are returned as a reference object carrying only id and object. Each operation documents the paths it accepts, and an unknown path answers 400. Nested paths use a dot, for example article.newsletter.

fieldsstringoptional

Comma-separated allow-list of top level properties to return on each object, so a client can trim a response it does not need in full. id and object are always returned. An unknown property name answers 400. Properties omitted by an operation, such as content on any article list, cannot be brought back with fields.

Commune-Versionstringoptional

The contract version this request is written against. Every version published so far is a release date (YYYY-MM-DD), which is why the examples look like one, but the value is an opaque identifier: match it against the versions this API publishes rather than parsing it, because a future one may not be only a date. An unknown value answers 400 with invalid_version.

Omitting the header pins the request to the version that was current when the API key was issued, so an integration keeps working when a newer version ships.

6 status codes
200The article, with content.
authorsarray<Ref>optional

The byline, in order. Each entry is a Ref unless authors is named in ?expand=. Empty when no Commune account is credited.

created_atstringrequired

When the row was created in Commune.

external_urlstringoptional

The article's canonical URL on the newsletter's own provider, for an imported article. Null for one written in Commune.

idstringrequired

Stable identifier.

image_urlstringoptional

Cover image. When the creator set none, Commune stamps the first image in the body at send time, so this is usually populated for a sent article.

is_importedbooleanrequired

true when the article came in from the newsletter's provider, false when it was written and sent in Commune.

newsletterobjectrequired

The newsletter this article belongs to. A Ref unless newsletter is named in ?expand=.

objectstringrequired

Always article.

posted_atstringoptional

When the article went out. An article dated in the future is not returned by any read operation until that moment passes, so this is never ahead of now in a response.

preview_textstringoptional

The short line email clients show after the subject, and what Commune uses as the excerpt on a card.

scheduled_forstringoptional

When a queued article may go out. Set while status is scheduled and null otherwise.

This is not posted_at and the difference matters: a queued article has no publication date yet, which is why it stays invisible on every reader surface until it really goes out. Commune dispatches in passes, so this is the moment from which the article may go rather than the moment it will.

short_idstringrequired

Eight character base62 identifier, unique across Commune. Safe in a URL and accepted anywhere {article} is.

slugstringrequired

URL segment under the newsletter, unique within it but not across Commune. The permalink is /n/{handle}/a/{slug}. Falls back to the short_id for an untitled article.

statsobjectoptional

Engagement counts for an article, computed at read time. These are Commune side counts, not provider side email metrics: opens, clicks and deliveries are not here.

statusstringrequired

Where an article is in its life. A credential holding only read permissions ever sees sent and nothing else. An imported article is always sent, since Commune sees it after the provider delivered it.

Allowed:draftscheduledsendingsentfailedarchived
threadnulloptional

The chat thread this article opened, where its discussion lives. null when the newsletter does not open a thread per article. A Ref unless thread is named in ?expand=.

titlestringoptional

Subject line of the article. Null for an untitled draft.

updated_atstringoptional

When the article was last edited.

contentstringrequired

The body as HTML. For an article written in Commune this is the email rendered for the web, with personalization placeholders resolved against an empty context so no raw merge tag is ever served. For an imported article it is what the provider published.

Treat it as untrusted markup from a third party and render it in a sandboxed context.

content_markdownstringoptional

The same body as Markdown, present only when content is named in ?expand=. It is what a model should read: the HTML is mostly markup it will not use, and one article body can fill a context window on its own.

It is a conversion of the body rather than of the HTML above. For an article written in Commune it comes from the document the author wrote, so a code block keeps its language and a table that declares a header becomes a Markdown table. For an imported article it comes from the provider's HTML. Either way the words, the links, the images, the lists, the code and the quotes survive, and everything presentational does not.

null means Commune holds no body it can convert faithfully. That happens when the only body it stored is a rendered email, whose words cannot be told apart from its layout. An empty string means the article has no body, which is different.

No merge tag ever appears here, resolved or not.

400The request was malformed, and the same request will fail the same way until it is changed. param names the parameter or header at fault when there is exactly one, and allowed_values lists what it accepts when that is a finite set. The code is bad_request for every case below except the last. A query parameter: one the operation does not have, a value outside its set, range or format (an unparseable cursor, an unknown expand path or fields name, an identifier that is not a UUID), or a required one left out, such as q on a search or newsletter when the credential reaches more than one., The request body: not JSON, not the shape the operation reads, a property it does not write, or a value of the wrong type, length or format. param is absent here, since the body is not a parameter, and the message names the property., The Idempotency-Key header, on an operation that changes something: missing, or a value this API will not store., An unrecognised Commune-Version, which answers with its own code, invalid_version, because it is never fixed by changing the body.
errorobjectrequired
401No credential was presented, or it is malformed, unknown, revoked or expired, or it is an access token minted for a different audience. Every one of these answers identically, down to the wording and the headers, so a refusal never confirms that a string was once real.
errorobjectrequired
404No such resource, or the key is not allowed to know that it exists. Commune answers 404 rather than 403 where distinguishing the two would leak the existence of private content.
errorobjectrequired
429Too many requests. Back off and retry after the interval named by the Retry-After response header. One of the budgets in RateLimit-Policy ran out, and the RateLimit-* headers on this response say which and when it resets.
errorobjectrequired
500Something failed inside Commune. The request may be retried.
errorobjectrequired

Error handling

A 400 is returned: The request was malformed, and the same request will fail the same way until it is changed. param names the parameter or header at fault when there is exactly one, and allowed_values lists what it accepts when that is a finite set. The code is bad_request for every case below except the last.

  • A query parameter: one the operation does not have, a value outside its set, range or format (an unparseable cursor, an unknown expand path or fields name, an identifier that is not a UUID), or a required one left out, such as q on a search or newsletter when the credential reaches more than one.
  • The request body: not JSON, not the shape the operation reads, a property it does not write, or a value of the wrong type, length or format. param is absent here, since the body is not a parameter, and the message names the property.
  • The Idempotency-Key header, on an operation that changes something: missing, or a value this API will not store.
  • An unrecognised Commune-Version, which answers with its own code, invalid_version, because it is never fixed by changing the body. A 401 is returned: No credential was presented, or it is malformed, unknown, revoked or expired, or it is an access token minted for a different audience.

Every one of these answers identically, down to the wording and the headers, so a refusal never confirms that a string was once real. A 404 is returned: No such resource, or the key is not allowed to know that it exists. Commune answers 404 rather than 403 where distinguishing the two would leak the existence of private content. A 429 is returned: Too many requests. Back off and retry after the interval named by the Retry-After response header.

One of the budgets in RateLimit-Policy ran out, and the RateLimit-* headers on this response say which and when it resets. A 500 is returned: Something failed inside Commune. The request may be retried.