Creates a draft. Publish it with POST /articles/{id}/publish.

bash
curl -X POST "https://usedocs.app/v1/articles" \
  -H "Authorization: Bearer $USEDOCS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Export invoices to CSV","contentMarkdown":"Open **Invoices**, then **Export**."}'

Authentication

Bearer token (content:write): A workspace API key: ud_live_…

Parameters

NameInTypeRequiredDescription
bot_idquerystringOnly for a key that covers several bots (see GET /bots). Or send the Usedocs-Bot header.

Request body

Required, application/json.

FieldTypeRequiredDescription
titlestringYes
contentMarkdownstringYesThe article in Markdown.
slugstring
descriptionstringOne sentence for search results and the article's lead.
collectionId`stringnull`
visibilitystringOne of: public, authenticated.
localestringLanguage code, e.g. en. Create only.
positionintegerOrder within its collection in the sidebar (0 first).

Responses

StatusDescription
201The new draft.
400The request is missing something or has a bad value.
401No API key, or the key is revoked.
402The workspace is paused; reads still work.
403A read key on a write, or a key for another bot.
404Not found.
429Rate limited: 120 requests a minute per key, 30 tasks an hour. See Retry-After.

Response fields

FieldTypeDescription
idstring
titlestring
slugstring
statusstringOne of: draft, in_review, published, archived.
description`stringnull`
collectionId`stringnull`
localestring
visibilitystringOne of: public, authenticated.
url`stringnull`
contentMarkdownstringWith format=markdown (default).
contentHtmlstringWith format=html.
publishedAt`stringnull`
createdAtstring (date-time)
updatedAtstring (date-time)