Parse a document to Markdown
Parse a document to Markdown
Convert a document into readable, structured Markdown content.
Accepts either a file upload (multipart/form-data) or a document URL (JSON body).
Sync mode (default)
Blocks until parsing completes and returns 200 with the full markdown result.
curl -X POST https://api.context212.com/api/v1/parse \ -H 'Authorization: Bearer $TOKEN' \ -F file=@invoice.pdfAsync mode (options.async = true)
Not implemented yet — returns 501.
Supported file types: .pdf, .png, .jpg, .jpeg, .pptx, .docx, .xlsx, .html, .xhtml
Sync limits: 20 MB file size, 15 pages.
Authorization
bearerAuth Console session token (Authorization: Bearer <session>) or product API key (Authorization: Bearer <api-key> or x-api-key). Session tokens are validated via Better Auth get-session; API keys against the shared database.
In: header
Header Parameters
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/parse" \ -H "Content-Type: application/json" \ -d '{ "document": "http://example.com" }'{ "id": "string", "status": "string", "created_at": "2019-08-24T14:15:22Z", "completed_at": "2019-08-24T14:15:22Z", "processing_time_ms": 0, "document": { "filename": "string", "page_count": 0, "file_size_bytes": 0, "mime_type": "string" }, "result": { "pages": [ { "index": 0, "markdown": "string" } ] }, "usage": { "pages_processed": 0 }}Delete a workspace DELETE
Delete a workspace Soft-delete a custom workspace you own. The workspace and its memberships are marked as deleted but retained for the configured recovery period; collection data (documents, chunks, embeddings) is preserved until the workspace is permanently deleted by the cleanup task. The workspace can be restored within the recovery period via `PATCH` with `deleted_at=null` (use `?include_deleted=true` to address it after deletion). **Restrictions:** - PERSONAL workspaces cannot be deleted (system-managed) — returns 403 - Caller must be an OWNER of the workspace (or hold instance/company workspace-delete permission)
Get the status and result of an async parse job GET
Get the status and result of an async parse job Poll for the status and result of an async parse job submitted via `POST /api/v1/parse` with `options.async=true`. Returns the same envelope shape as the synchronous parse endpoint once `status` is `completed`. ```bash curl https://api.context212.com/api/v1/parse/parse_Kg \ -H 'Authorization: Bearer $TOKEN' ``` **Recommended polling cadence:** 1s for the first 10s, then 5s, capped at 30s. Stop polling once `status` is in `{completed, failed}`.