FluxWriter API
Generate and publish SEO content from your own app, script, or product. Simple REST, JSON in and out, with the same quotas as the dashboard. Available on the Pro and Agency plans. On both, API posts are written by Flux Core, with Flux Lite as its backup; choosing a model per post is a dashboard feature.
1. Get an API Key
In the dashboard go to Settings → API Keys → Create Key. Copy it immediately. It's shown only once. Treat it like a password; it acts on your account. Only the account owner can create or revoke keys, and you can hold up to 10 active keys at a time. If your subscription lapses, existing keys stop working until it's active again.
2. Authenticate
Send your key as a Bearer token on every request. Base URL: https://fluxwriter.com (your FluxWriter dashboard domain).
curl https://fluxwriter.com/v1/me \
-H "Authorization: Bearer flux_live_YOUR_KEY"
Rate limit: 120 requests/minute per key. All responses are JSON.
3. Endpoints
GET /v1/me
Your account's plan and limits. Handy as a "is my key working?" check.
{ "plan": "pro", "limits": { "maxSites": 3, "monthlyPosts": 200 } }
// maxSites / monthlyPosts are null when the plan has no limit.
GET /v1/sites
List the sites connected to your account (use the id when generating).
{ "sites": [ { "id": 42, "name": "My Blog", "url": "https://myblog.com",
"platform": "wordpress", "status": "active", "postsCount": 17,
"createdAt": "2026-03-14T09:21:00.000Z",
"writingMode": "facts_only", "storyMode": "off", "storyModes": ["off"] } ] }
// writingMode: "not_set" | "facts_only" | "stories"
// storyModes: null | ["off"] | one or more of "examples", "first_person",
// "unlabeled" (the story styles can be combined)
// storyMode: storyModes' first entry (null when not answered)
Each site also reports writingMode: not_set until the site owner answers the made-up stories question in the dashboard, then facts_only or stories. storyModes is the exact answer: null, ["off"], or one or more of examples, first_person and unlabeled, which can be combined. storyMode is its first entry, as before. The API cannot set it. Until it is answered, posts use real facts only.
POST /v1/generate
Generate one SEO article for a connected site. Synchronous: it returns when the post is ready, which can take up to about two minutes, so set a client timeout of at least 130 seconds. A post that is not ready by about 120 seconds is not saved: the answer is 503 with a Retry-After header (try again later), no monthly post is used, and you can send the same request again. After a 524 from our proxy, or if your client gives up sooner, the post may still have been saved (and, with autoPublish, published), so check GET /v1/posts before you retry, or retry with the same Idempotency-Key. A saved post counts against your monthly quota, exactly like the dashboard.
Body: siteId (required), and optionally topic, focusKeyword, wordCount (450–1500), mode (normal·indirect_promotion·mixed), language (ISO code), autoPublish (boolean).
Model: on Pro and Agency, Flux Core writes the post. If it fails, Flux Lite writes it instead, but only while the request still has time to finish (the 120-second cut-off above). Flux Lite also writes it when Flux Core cannot run, for example when your account already has three posts being written by Flux Core or Flux Max at once. The API never writes with Flux Max, which the dashboard offers: a Flux Max post does not reliably finish within one request. The response's aiModel is a code for the tier that wrote it: flux_core for Flux Core, flux_lite for Flux Lite (and flux_max for Flux Max, which the API does not use). New flux_ codes may be added later, so do not treat an unknown one as an error. fallbackNotice says why when a backup wrote it. The API takes no model choice: an aiModel in the request body is ignored. Choosing a model per post, from the models your plan includes, is a dashboard feature.
Safe retries: send an Idempotency-Key header (up to 255 printable characters without spaces, such as a UUID) with each new post. Sending the same request with the same key again never writes a second post: once the post is saved the answer is 200 with that post and "replayed": true, and no monthly post is used, even when your month is used up. While the first request is still running the answer is 409 request_in_progress. A request that saved nothing frees its key. The same key with a different body is refused with 422 idempotency_key_mismatch.
curl -X POST https://fluxwriter.com/v1/generate \
-H "Authorization: Bearer flux_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "siteId": 42, "focusKeyword": "espresso grind size", "autoPublish": true }'
HTTP/1.1 201 Created
{ "id": 1337, "status": "published", "url": "https://myblog.com/espresso-grind-size",
"title": "Espresso Grind Size: The 2026 Guide", "seoScore": 86, "wordCount": 1520,
"heldForReview": false, "heldReason": null, "heldReasons": [], "published": true,
"publishMessage": "Published to WordPress", "publishCode": null, "researchStatus": "ok",
"aiModel": "flux_core", "fallbackNotice": null,
"writingMode": "facts_only", "storyMode": "off", "storyModes": ["off"] }
// aiModel: a code for the model that wrote it, "flux_core" (Flux Core), or its backup
// "flux_lite" (Flux Lite). "flux_max" is Flux Max, which the API does not use.
// New "flux_" codes may be added later: do not treat an unknown one as an error
// fallbackNotice: null, or one English sentence saying why a backup wrote it
// status: "published" | "draft" | "failed" | "pending"
// draft: autoPublish was false, or the post was held for review
// (heldForReview: true, heldReasons says why), or there was
// no time left to publish (publishMessage says how to)
// heldReasons: [{ "code": "claims_unverified", "message": "…" }] when held, else []
// code: claims_unverified | check_unavailable | heavy_edits | too_close_to_source
// | thin_content | near_duplicate | grounding_low
// | broken_structure | wrong_language | language_unfinished
// | shorter_than_ordered (key on the code;
// the message is fixed English). heldReason is the older one-line form.
// seo_low is old: the SEO score is advice and no longer holds a post,
// but a post an older release held for it still shows that code.
// failed: generated and saved, but publishing to the CMS did not succeed
// pending: the post went live on your site (published: true, url is its
// address), but FluxWriter could not record that: publishCode is
// "post_live_unrecorded", and GET /v1/posts/:id says "pending"
// with the same publishCode.
// Don't publish it or generate it again: that would post it twice.
// Or publishing had not finished when the answer was sent
// (publishCode "publish_in_progress"): it may still complete, so
// check GET /v1/posts/:id before publishing it again
// publishCode: null, "post_live_unrecorded" (status "pending" above), or
// "publish_in_progress" (status "pending": still publishing), or
// "platform_outcome_unknown" (status "failed"): your site did not answer,
// so the post may be live. Check your site before you publish it or
// generate it again; GET /v1/posts/:id carries the same publishCode
// GET /v1/posts and GET /v1/posts/:id can also say "post_publish_interrupted"
// (status "pending"): see GET /v1/posts below
// researchStatus: "ok" | "cached" | "thin" | "unavailable:<reason>"
// ok, cached, thin: the top search results for the keyword were read first
// unavailable: written without them (e.g. unavailable:budget_exhausted)
If a post fails the fact and link check or the quality bar, an auto-publish is held as a draft (heldForReview: true) for you to review, and heldReasons says why by code. Auto-publish via the API does not mint a featured image. Omit autoPublish and add one in the dashboard if you want one. The full response also returns slug, focusKeyword, metaDescription, metaKeywords, excerpt, and the complete HTML content.
The response also echoes the site's writingMode, storyModes and storyMode: the rules the post was written under.
POST /v1/posts/:id/publish
Publish an existing post (e.g. one generated as a draft) to its platform.
curl -X POST https://fluxwriter.com/v1/posts/1337/publish \
-H "Authorization: Bearer flux_live_YOUR_KEY"
{ "ok": true, "url": "https://myblog.com/espresso-grind-size", "message": "Published to WordPress" }
A post held for review is refused with 409 post_held and its heldReasons. Once you have reviewed it, send { "acknowledgeHeld": true } to publish it anyway.
HTTP/1.1 409 Conflict
{ "error": "post_held", "message": "…",
"heldReasons": [ { "code": "claims_unverified", "message": "…" } ] }
curl -X POST https://fluxwriter.com/v1/posts/1337/publish \
-H "Authorization: Bearer flux_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "acknowledgeHeld": true }'
GET /v1/posts
List your posts, most recent first. Optional ?limit= (1–100, default 50). While more posts remain, the answer carries nextCursor: send it back as ?cursor= for the next page. It is null on the last page.
{ "posts": [ { "id": 1337, "siteId": 42, "title": "Espresso Grind Size: The 2026 Guide",
"status": "published", "url": "https://myblog.com/espresso-grind-size", "seoScore": 86,
"focusKeyword": "espresso grind size", "publishCode": null,
"createdAt": "2026-03-14T09:21:00.000Z" } ],
"nextCursor": null }
Each post carries publishCode: null, post_live_unrecorded (live on your site, but FluxWriter could not record it) or platform_outcome_unknown (your site did not answer, so it may be live). With either code, url is the post's address when the site gave one: don't publish or generate the post again before you check your site.
A post whose status is pending is normally still being written or published. If its publishing was cut off part-way, publishCode becomes post_publish_interrupted about 30 minutes later: nobody is working on the post any more, and it may or may not be live. Check your site before you publish or generate it again. Within a few hours the code changes to platform_outcome_unknown, still with status pending, and Mark as Published and It's Not on My Site appear on the post in the dashboard.
While a publish of a pending post is still running, publishCode is publish_in_progress: wait and check again, and don't publish or generate the post again.
GET /v1/posts/:id
Fetch one post including its full HTML content.
4. Quickstart (JavaScript)
const API = "https://fluxwriter.com/v1";
const KEY = process.env.FLUXWRITER_API_KEY;
// One key per post: send the same key again when you retry, and no second post is written
const idempotencyKey = crypto.randomUUID();
const res = await fetch(`${API}/generate`, {
method: "POST",
headers: {
"Authorization": `Bearer ${KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": idempotencyKey,
},
body: JSON.stringify({ siteId: 42, focusKeyword: "cold brew ratio", autoPublish: true }),
signal: AbortSignal.timeout(130_000),
});
// An error page from a proxy (a 524, say) is HTML, not JSON: read the text first
const text = await res.text();
let post;
try {
post = JSON.parse(text);
} catch {
throw new Error(`HTTP ${res.status}: the answer was not JSON`);
}
if (!res.ok) throw new Error(`HTTP ${res.status} ${post.error}: ${post.message}`);
// A 201 means the post was saved. A true published flag confirms it went live even if local recording is pending.
if (post.status === "published") {
// url is null when the site gave no address (a Custom Webhook that answered a bare 2xx)
console.log("Published:", post.url ?? `post ${post.id}`);
} else if (post.published === true) {
console.log("Live on site:", post.url ?? `post ${post.id}`, `(local status ${post.status}).`,
post.publishMessage || "Do not publish this post again.");
} else if (post.heldForReview) {
console.log("Held for review:", post.heldReasons.map((r) => r.code).join(", "));
} else {
// "draft", "failed" or "pending": publishMessage says why, publishCode whether it may be live
console.log(`Not confirmed as published (status ${post.status}):`, post.publishMessage);
}
5. Errors
Errors are JSON: { "error": "...", "message": "..." }. Common statuses:
400,invalid_request: invalid request body, post id or cursor (an invalid body carries anissuesarray);invalid_json: the body is not valid JSON;key_unreadable: a saved AI key that/v1/generatewould use can't be read, so nothing was started or counted; enter the key again in Settings401: missing key (missing_api_key), or invalid or revoked key (invalid_api_key)402,monthly_post_limit_reached: monthly post limit reached403: plan doesn't include the API (upgrade_required), subscription inactive (subscription_inactive), or the account is suspended (account_suspended)404: site/post not found on your account (site_not_found,post_not_found), or no such endpoint (not_found)409,post_held: the post is held for review; publish it withacknowledgeHeld: trueonce you have reviewed it409,post_live_unrecorded(publish only): the post went live on your site (its address is inurl), but FluxWriter could not record that. Don't publish it again: that would post it twice409,platform_outcome_unknown(publish only): your site did not answer, so the post may be live (its address, when known, is inurl). Look on your site before you publish it or generate it again; Mark as Published and It's Not on My Site are on the post in the dashboard409,already_published,publish_in_progress,post_rewrite_runningorpost_not_publishable(publish only): the post is already published, is being published right now, is being rewritten in the dashboard, or its status (instatus) is not one that can be published409,platform_publishing_paused(/v1/generatewithautoPublish: true, and/v1/posts/:id/publish): FluxWriter has paused publishing to the site's platform, whichplatformnames (for exampleshopify). Nothing was generated or published, and no monthly post was used; a post you asked to publish is left as it was. Generate withoutautoPublishto write a draft now, and publish it once the platform is back409,request_in_progress(/v1/generatewith anIdempotency-Key): the first request with this key is still running. Wait the number of seconds in theRetry-Afterheader (alsoretryAfterMsin the body), then send the same request again413,payload_too_large: the request body is over 256 KB422,idempotency_key_mismatch(/v1/generate): thisIdempotency-Keywas already used with a different request body. Use a new key for a new post429,rate_limited: your key sent more than 120 requests in a minute, your account already has 3 posts being generated through the API at once (/v1/generate: wait for one to finish), or the AI provider is busy (/v1/generate). Each of these answers carriesretryAfterMsand aRetry-Afterheader (in seconds): wait that long, then try again500,internal_error: something went wrong on our side; quote thereferencein the answer to support500,post_save_unconfirmed(/v1/generate): the post may or may not have been saved. CheckGET /v1/postsbefore retrying, or retry with the sameIdempotency-Key502,generation_failedorpublish_failed: generation or publishing failed upstream; safe to retry503,try_again_later:/v1/generatecould not finish the post within the request, so nothing was saved and no monthly post was used. This can also be the answer during an AI provider outage, instead of429or502, when the outage leaves no time for the backup model. Areasonin the answer means the post was never started:server_busy(FluxWriter was writing as many posts at once as it can) orserver_restarting(FluxWriter was restarting). Wait the number of seconds in theRetry-Afterheader (alsoretryAfterMsin the body), then send the request again. Thereasoncan also beai_keys_unavailable: your saved AI keys couldn't be checked503,platform_check_unavailable(/v1/generatewithautoPublish: true, and/v1/posts/:id/publish): FluxWriter could not check whether publishing to the site's platform is available, so it did nothing: nothing was generated or published, and no monthly post was used. This answer has noRetry-Afterheader: wait a moment, then send the request again504,generation_timeout(/v1/generate): the AI provider took too long, so nothing was saved and no monthly post was used; safe to retry524, the proxy timed out before/v1/generateanswered: the post may have been saved. CheckGET /v1/postsbefore retrying, or retry with the sameIdempotency-Keyso no second post is written
6. Events (Webhooks)
To react to publishes in your own system, set a webhook under Auto-Share on Publish in Settings. FluxWriter POSTs a JSON payload to your URL whenever a post is published, so you never have to poll. That webhook is sent unsigned, so keep the URL secret or add your own token to it. If you need a verifiable payload, connect the site as a Custom webhook destination instead and set a shared secret: those requests carry X-FluxWriter-Event and an X-FluxWriter-Signature: sha256=… HMAC of the body.