Skip to content

Articles

Start a long-form SEO article for one of your projects, poll it, then read it. Starting one costs 1.5 credits from the wallet. Reading is free.

MethodPathNeeds
GET/api/v1/articlesread
GET/api/v1/articles/{id}read
POST/api/v1/articles/generatewrite. 1.5 credits.
GET/api/v1/articles/{id}/statusread

Status lifecycle

  1. generating
  2. processing
  3. completed
  4. cms or draft
The usual path. An article that does not finish ends as failed, and the charge is refunded automatically.
statusMeaning
generatingAccepted, waiting for the writer
processingBeing researched and written
completedWritten. The quality check then moves it to cms or draft.
cmsFinished and passed the quality check. This is the published-ready state; there is no "published".
draftFinished but held for your review in the app (quality check not passed), or moved back to draft by you
needs_editingFinished, flagged for edits
failedDid not finish. The charge is refunded automatically.
archivedArchived in the app

Filter values accepted by ?status=: generating, processing, completed, draft, queued, cms, needs_editing, failed, archived.

GET/api/v1/articles

Your articles across all projects, paginated. Bodies are left out; fetch one article for its content.

Query parameters

NameTypeRequiredDescription
pageintegerOptional1-based page Default 1.
limitintegerOptional1 to 100 Default 20.
statusstringOptionalOne of the statuses above
project_iduuidOptionalOnly this project
searchstringOptionalCase-insensitive match on the title
sortstringOptionalcreated_at, updated_at or title Default created_at.
orderstringOptionalasc or desc Default desc.
Request
curl "https://www.brainpercent.app/api/v1/articles?status=cms&limit=10" \
  -H "Authorization: Bearer $BP_KEY"
200Response
{
  "success": true,
  "data": [
    {
      "id": "ed234978-8cae-4f3c-83d2-ed57d9f5020b",
      "title": "How to dial in a cold brew ratio at home",
      "slug": "how-to-dial-in-a-cold-brew-ratio-at-home",
      "status": "cms",
      "meta_description": "The ratio, grind and steep time that make cold brew taste right.",
      "created_at": "2026-10-28T21:02:33.793579+00:00",
      "updated_at": "2026-10-28T21:15:12.270471+00:00",
      "project_id": "1f8b4518-128d-4b2c-8b81-aa3939dbb7b5"
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 10,
    "total_pages": 1,
    "has_more": false
  },
  "meta": {
    "timestamp": "2026-10-29T15:40:14.123Z"
  }
}
GET/api/v1/articles/:id

One article with its HTML body. Another account's article, or an unknown id, is a 404.

Request
curl https://www.brainpercent.app/api/v1/articles/ed234978-8cae-4f3c-83d2-ed57d9f5020b \
  -H "Authorization: Bearer $BP_KEY"
200Response
{
  "success": true,
  "data": {
    "id": "ed234978-8cae-4f3c-83d2-ed57d9f5020b",
    "project_id": "1f8b4518-128d-4b2c-8b81-aa3939dbb7b5",
    "title": "How to dial in a cold brew ratio at home",
    "slug": "how-to-dial-in-a-cold-brew-ratio-at-home",
    "status": "cms",
    "content": "<h2>Start with 1:8</h2><p>…</p>",
    "meta_description": "The ratio, grind and steep time that make cold brew taste right.",
    "excerpt": "…",
    "keywords": "cold brew ratio, cold brew at home",
    "lang": "en",
    "word_count": 1200,
    "tone": "professional",
    "generation_progress": 100,
    "published_at": null,
    "created_at": "2026-10-28T21:02:33.793579+00:00",
    "updated_at": "2026-10-28T21:15:12.270471+00:00"
  },
  "meta": {
    "timestamp": "2026-10-29T15:40:14.123Z"
  }
}

Fields returned, and only these: id, project_id, title, slug, status, content, meta_description, excerpt, keywords, lang, word_count, tone, generation_progress, published_at, created_at, updated_at. The article is written in the project's language (lang, from the project's business_language).

POST/api/v1/articles/generate

Start an article and return at once with 202. Charges 1.5 credits from the wallet before the job is queued (accounts on an older article allowance are charged one article from it instead). Needs write. Writing takes about 10 to 15 minutes; poll poll_url. A job that fails is refunded.

Request body

NameTypeRequiredDescription
topicstringRequiredThe main keyword the article targets, 3 to 500 characters. The title is written for you.
project_iduuidRequiredYour project. It supplies brand, audience and language.
keywordsstring[]OptionalUp to 20 extra keywords
tonestringOptionalprofessional, casual, academic or conversational Default professional.
word_countintegerOptional300 to 5000 Default 800.
Request
curl -X POST https://www.brainpercent.app/api/v1/articles/generate \
  -H "Authorization: Bearer $BP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "cold brew ratio",
    "project_id": "1f8b4518-128d-4b2c-8b81-aa3939dbb7b5",
    "keywords": ["cold brew at home"],
    "word_count": 1200
  }'
202Response
{
  "success": true,
  "data": {
    "article_id": "ed234978-8cae-4f3c-83d2-ed57d9f5020b",
    "status": "generating",
    "job_id": "01JQ8Z3M4N5P6Q7R8S9T0U1V2W",
    "slug": "cold-brew-ratio",
    "language": "en",
    "credits_deducted": 1.5,
    "charged_to": "wallet",
    "articles_remaining": 12,
    "estimated_time": "10-15 minutes",
    "poll_url": "/api/v1/articles/ed234978-8cae-4f3c-83d2-ed57d9f5020b/status"
  },
  "meta": {
    "timestamp": "2026-10-29T15:40:14.123Z"
  }
}
FieldMeaning
credits_deductedCredits billed: 1.5 from the wallet, or 1 when charged_to is article_balance
charged_towallet, or article_balance for an account on the older article allowance
articles_remainingHow many more articles the same balance covers. For the wallet itself, call GET /user/credits.
poll_urlRelative path. Prefix it with https://www.brainpercent.app.
StatusCodeWhen
400VALIDATION_ERRORMissing project_id, topic under 3 characters, or a topic with no letters or digits
402INSUFFICIENT_CREDITSThe balance cannot cover one article. Nothing was created.
403FORBIDDENThe key lacks write
404NOT_FOUNDproject_id is not one of your projects
500INTERNAL_ERRORThe job could not be queued. The charge is returned.
GET/api/v1/articles/:id/status

Small, cheap poll target. Stop when is_complete or is_failed is true.

Request
curl https://www.brainpercent.app/api/v1/articles/ed234978-8cae-4f3c-83d2-ed57d9f5020b/status \
  -H "Authorization: Bearer $BP_KEY"
200Response
{
  "success": true,
  "data": {
    "article_id": "ed234978-8cae-4f3c-83d2-ed57d9f5020b",
    "status": "cms",
    "title": "How to dial in a cold brew ratio at home",
    "slug": "how-to-dial-in-a-cold-brew-ratio-at-home",
    "progress": 100,
    "is_complete": true,
    "is_failed": false,
    "created_at": "2026-10-28T21:02:33.793579+00:00",
    "updated_at": "2026-10-28T21:15:12.270471+00:00"
  },
  "meta": {
    "timestamp": "2026-10-29T15:40:14.123Z"
  }
}
FieldMeaning
is_completeTrue once the job stopped running and did not fail (completed, cms, draft, needs_editing, archived)
is_failedTrue when status is failed
progress0 to 100 while writing, or null

A poll loop

Your serverBrainpercent
  1. Your server to Brainpercent: POST /api/v1/articles/generateA topic and a project_id. Needs write.
  2. Brainpercent to Your server: 202 with article_id and poll_url1.5 credits are charged. Writing takes about 10 to 15 minutes.
  3. Your server to Brainpercent: GET /api/v1/articles/{id}/statusRepeat until is_complete or is_failed is true.
  4. Brainpercent to Your server: is_complete: trueIf is_failed is true instead, the charge is refunded.
  5. Your server to Brainpercent: GET /api/v1/articles/{id}
  6. Brainpercent to Your server: The article with its HTML bodyReading is free.
ID=ed234978-8cae-4f3c-83d2-ed57d9f5020b
until curl -s https://www.brainpercent.app/api/v1/articles/$ID/status -H "Authorization: Bearer $BP_KEY" \
  | grep -Eq '"is_(complete|failed)":true'; do
  sleep 30
done
402INSUFFICIENT_CREDITS
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "Insufficient article balance: need 1, have 0"
  },
  "meta": {
    "timestamp": "2026-10-29T15:40:14.123Z"
  }
}

Publishing a finished article to your own website happens in the app (or through your site's webhook, see Webhooks and async jobs). There is no article publish route in the API.