Skip to main content
POST
/
format
/
v1
/
document
Format documents with professional layouts
curl --request POST \
  --url https://api.case.dev/format/v1/document \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>",
  "output_format": "pdf",
  "input_format": "md",
  "options": {
    "components": [
      {
        "templateId": "<string>",
        "content": "<string>",
        "variables": {},
        "styles": {}
      }
    ]
  }
}
'
"<string>"

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Body

application/json
content
string
required

The source content to format

output_format
enum<string>
required

Desired output format

Available options:
pdf,
docx,
html_preview
input_format
enum<string>
default:md

Format of the input content

Available options:
md,
json,
text
options
object

Response

Formatted document (binary for PDF/DOCX, HTML for preview)

The response is of type file.