Publish an Article
Early access. Tell us what you're building and we'll set you up. Contact us
api.lempile.com/articlesBuilds one X Article in a new draft (title, every block in order, cover), reads the draft back, and publishes it only if X kept exactly those blocks; otherwise nothing is published and the draft stays in the account's Drafts. It takes minutes, so this answers 202 and GET /articles/{key} says where it is. The same key never builds twice. Paced like posts unless dry_run.
Scope: accounts.write.
Authentication
X-API-KEY header·A Lempile API key, made in the dashboard under Access tokens.Headers
Idempotency-Keystringrequired1–200 characters of
A-Z a-z 0-9 . _ : -. The same key with the same request replays the first answer; see Write receipts.≤ 200 chars
Request body
account_idstringrequiredtitlestringrequired≤ 200 charscoverArticleFile›Show fieldsHide fields
namestringrequiredcontent_typestringrequiredOne ofimage/jpegimage/pngimage/webpdata_base64stringrequired
blocksarray of ArticleBlockrequiredImages: 30 at most, 8 MB each, 40 MB in all.
≥ 1 items · ≤ 200 items›Show fieldsHide fields
Option 1object›Show fieldsHide fields
kindanyrequiredAlwaystexthtmlstringrequired≤ 100000 charsplainstring
Option 2object›Show fieldsHide fields
kindanyrequiredAlwaysimagealtstringfileArticleFilerequired›Show fieldsHide fields
namestringrequiredcontent_typestringrequiredOne ofimage/jpegimage/pngimage/webpdata_base64stringrequired
Option 3object›Show fieldsHide fields
kindanyrequiredAlwayscodetextstringrequired≤ 100000 chars
dry_runbooleanBuilds and checks the draft but never publishes.
Responses
202Building.
›
application/json
objectanyAlwaysArticleJobidstringaccount_idstringstatusstringOne ofbuildingpublisheddraftnot_sentunknownurlstringarticle_idstringdraft_urlstringcodestringdetailstring
400Invalid body or Idempotency-Key.
›
application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
401Missing or invalid API key ({error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.
›
{error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
402subscription_required: the workspace has no active trial or subscription.
›
subscription_required: the workspace has no active trial or subscription.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
404errors/resource_not_found: no such account in this workspace, or it isn't an X account.
›
errors/resource_not_found: no such account in this workspace, or it isn't an X account.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
409account_busy: another Article is building on this account.
›
account_busy: another Article is building on this account.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
422not_sent: nothing was published; code and detail say why.
›
not_sent: nothing was published; code and detail say why.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
423errors/x_account_locked: X shows the account its lock page (x.com/account/access). Nothing was done; someone has to pass X's check.
›
errors/x_account_locked: X shows the account its lock page (x.com/account/access). Nothing was done; someone has to pass X's check.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
429errors/too_fast or errors/daily_limit.
›
errors/too_fast or errors/daily_limit.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
503errors/service_unavailable (the account isn't ready, or the browser runner can't be reached), errors/no_client_session, or errors/maintenance with retry_at.
›
errors/service_unavailable (the account isn't ready, or the browser runner can't be reached), errors/no_client_session, or errors/maintenance with retry_at.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
Was this page helpful?