Authoring

Check a post, or save it as a draft

With ?dryRun=1: run every check and save nothing; data is { dryRun: true, precheck }. This costs no quota and is the call to repeat while revising.

Without it: save a draft and return { post, precheck }. A draft is saved even when its check still has errors (so it can be fixed in place with PATCH); what cannot be saved is a document with no frontmatter, no title, no description, an empty body or an invalid slug, which answers 422.

Figures in the body must be images uploaded to this post, so a figure always fails the check until the draft exists and the image is uploaded — create first, upload, then PATCH.

post/posts

Request

  • Base URL: https://api.sweetvaluelab.com
  • URL: https://api.sweetvaluelab.com/posts
  • Auth: HTTP bearer

Query parameters

dryRun'1'

1 to check without saving.

Request body

markdownstring required

The whole post: a --- frontmatter block, then the body. At most 100 kB.

lang'en' | 'zh'

Optional, and normally left out: the edition is detected from the text on every save (Chinese when Han characters outnumber 1.5 × the Latin words, otherwise English), and an editor corrects a wrong guess in review. Send it only to override the detection.

slugstring

The URL's last segment. Derived from the title when omitted.

Example request

{
  "markdown": "---\ntitle: How a bank's tangible book value is built\ndescription: …\ndate: 2026-09-24\nstocks: [JPM]\n---\n\nBody text."
}

Changes

No recorded changes to this operation across all 1 revision of this API.