Create a Docs page (as a draft)

posthttps://api.expiryedge.com/v1/createKnowledgeDoc
editor or admin60/minIdempotency-Key
Request
curl -X POST 'https://api.expiryedge.com/v1/createKnowledgeDoc' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "title": "How we renew our food hygiene certificate",
  "content": "<h2>Steps</h2><ol><li><p>Book the inspection 8 weeks before expiry</p></li><li><p>Upload the new certificate</p></li></ol>",
  "emoji": "🧾",
  "tags": [
    "food-safety",
    "procedures"
  ],
  "parent_id": "kd_1Proc"
}'
Response
{
  "doc": {
    "id": "kd_7Hn2qLx",
    "title": "How we renew our food hygiene certificate",
    "content": "<h2>Steps</h2><ol><li><p>Book the inspection 8 weeks before expiry</p></li><li><p>Upload the new certificate</p></li></ol>",
    "emoji": "🧾",
    "tags": [
      "food-safety",
      "procedures"
    ],
    "parent_id": "kd_1Proc",
    "status": "draft",
    "organization_id": "org_northwind",
    "created_by": "u_71bXq",
    "created_by_name": "Priya Shah",
    "created_by_email": "priya@northwinddental.com",
    "created_at": "2026-09-27T14:05:00.000Z",
    "updated_by": "u_71bXq",
    "updated_by_name": "Priya Shah",
    "updated_at": "2026-09-27T14:05:00.000Z"
  }
}

New pages always start as draft; publish with updateKnowledgeDoc status: published. content is HTML like the web editor produces; unsafe markup (scripts, event handlers, iframes, non-https images) is removed.

Headers

  • Idempotency-Keystring
    Optional client-generated key (1-255 characters of letters, digits, - _ : .).
    pattern: ^[A-Za-z0-9_\-:.]{1,255}$

Body parameters

application/json
  • titlestring
    max length: 300
  • contentstring
    HTML, max 500 KB. Allowed - headings, paragraphs, bold/italic/underline/strike, lists, task lists, links (http, https, mailto), https images, tables, code, blockquotes, text color/highlight/alignment.
  • emojistring
    max length: 16
  • tagsarray of string
    max length: 50 · max items: 30
  • parent_idstring | null

Returns

201
Page created.
  • docobjectrequired
    A page in the Docs (knowledge base) section. Same record the web app creates.

Errors

400
The request is missing required fields or contains invalid values.
401
Missing, expired or invalid bearer token.
403
Authenticated, but your role or organization does not allow this action.
404
The record does not exist or is not in your organization.
405
The endpoint does not accept this HTTP method.
409
A request with the same Idempotency-Key is still being processed. Retry after Retry-After seconds.
422
The Idempotency-Key was already used with a different request body.
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.
500
Unexpected server error. Retry later; quote requestId to support.