Starts background work that ends in drafts for review; nothing is published. Poll GET /tasks/{id} or subscribe to the task.completed webhook.

  • Write or update docs: send description (what's needed).
  • Document a code change: send change with the diff (or changed paths and commits). usedocs reads it against your docs and proposes edits to the articles it affects, new articles it needs, and a changelog entry. This is the same job a merged pull request runs on the GitHub app, so it works from any CI or code host.

Send an Idempotency-Key header so a retried CI job doesn't start the task twice (kept for 24 hours).

bash
git diff origin/main...HEAD | jq -Rs '{change: {kind: "pr", title: "Add CSV export", url: "https://github.com/acme/app/pull/42", diff: .}}' | \
  curl -X POST "https://usedocs.app/v1/tasks" -H "Authorization: Bearer $USEDOCS_API_KEY" \
  -H "Content-Type: application/json" -H "Idempotency-Key: $CI_COMMIT_SHA" --data-binary @-

Authentication

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

Parameters

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

Request body

Required, application/json.

FieldTypeRequiredDescription
descriptionstringWhat should change in the docs. Required without change.
titlestring
changeobject

Responses

StatusDescription
201The task.
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
typestringchange, write_article, document_feature, refresh_article, replace_term, draft_gaps, check_all, audit
titlestring
statusstringOne of: queued, in_progress, completed, failed.
result`objectnull`
error`stringnull`
createdAtstring (date-time)