Export and import
Export a canvas, import Markdown, HTML or CSV into it, and convert files without a canvas.
- GET
/api/v1/files/{fileId}/export/{format} - GET
/api/v1/files/{fileId}/render - POST
/api/v1/files/{fileId}/import - POST
/api/v1/convert
Export the canvas
GET/api/v1/files/{fileId}/export/{format}
The canvas as a file: md, html, json (the document JSON), ocanvas (the native file), docx or pdf. The host's export_formats decides which are allowed. Images in DOCX and PDF come only from your callback_base or asset_origins; PDF needs the operator's Gotenberg sidecar. Answers Cache-Control: no-store.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
formatrequired | path | string | md, html, json, ocanvas, docx or pdf One of md, html, json, ocanvas, docx, pdf. |
Responses
200OK: The exported file
Headers
| Header | Description |
|---|---|
RateLimit-Policy | Token buckets that apply: "subject";q=<burst>;w=<seconds to refill>, and "file-writes" on writes |
RateLimit | The bucket closest to empty: "<name>";r=<remaining>;t=<seconds until full> |
Body application/octet-stream
binary
Example
## Launch plan
Ship on Monday.
- [ ] Write the release notes
### Tasks
| Task | Status | Due | Owner |
| --- | --- | --- | --- |
| Write the release notes | Doing | 2026-11-27 | |
| Tag the release | Todo | 2026-11-28 | |
401Unauthorized: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"detail": "missing or wrong credentials",
"code": "UNAUTHENTICATED"
}Codes: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED.
403Forbidden: ROLE_FORBIDDEN, SCOPE_REQUIRED, FILES_REQUIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:scope-required",
"title": "Forbidden",
"status": 403,
"detail": "SCOPE_REQUIRED: comment_add needs canvas:comment",
"code": "SCOPE_REQUIRED"
}Codes: SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, EXPORT_OFF.
404Not Found: API_OFF, BLOCK_NOT_FOUND, NOT_FOUND, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:api-off",
"title": "Not Found",
"status": 404,
"detail": "the API is not enabled for this host ([host.flags] api_v1)",
"code": "API_OFF"
}Codes: API_OFF, FORMAT_UNSUPPORTED.
429Too Many Requests: RATE_LIMITED, with Retry-After, RateLimit-Policy and RateLimit
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:rate-limited",
"title": "Too Many Requests",
"status": 429,
"detail": "too many requests (subject limit); retry later",
"code": "RATE_LIMITED"
}Codes: RATE_LIMITED.
501Not Implemented: PDF_RENDERER_NOT_CONFIGURED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:pdf-renderer-not-configured",
"title": "Not Implemented",
"status": 501,
"detail": "PDF export needs OC_PDF_RENDERER=gotenberg:<url>; use the print view instead",
"code": "PDF_RENDERER_NOT_CONFIGURED"
}Codes: PDF_RENDERER_NOT_CONFIGURED.
502Bad Gateway: HOST_UNAVAILABLE: your load or save callback failed
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:host-unavailable",
"title": "Bad Gateway",
"status": 502,
"detail": "host answered 503 Service Unavailable",
"code": "HOST_UNAVAILABLE"
}Codes: HOST_UNAVAILABLE.
503Service Unavailable: UNAVAILABLE, ROOM_UNAVAILABLE, with Retry-After
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unavailable",
"title": "Service Unavailable",
"status": 503,
"detail": "the idempotency store is unavailable; retry",
"code": "UNAVAILABLE"
}Codes: UNAVAILABLE.
Errors
| Status | Code | When |
|---|---|---|
| 404, 400 | FORMAT_UNSUPPORTED | Export (404): the format in the path is not one of md, html, json, ocanvas, docx, pdf. Convert (400): from or to is not supported. |
| 403 | EXPORT_OFF | The host's export settings do not allow this format. |
| 502 | HOST_UNAVAILABLE | Your load or save callback failed or timed out, so the file could not be loaded or saved. |
| 501 | PDF_RENDERER_NOT_CONFIGURED | PDF needs the operator to run the Gotenberg sidecar and set OC_PDF_RENDERER. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
Render the canvas as read-only HTML
GET/api/v1/files/{fileId}/render
The compact, read-only view of a canvas (LIVE-06, docs/27 §2.2 "Host surfaces") for host surfaces that cannot run the <open-canvas> web component, such as a chat message showing a live block: the export renderer's HTML, sanitised, served with a sandboxing Content-Security-Policy and Cache-Control: no-store. Live blocks inside are resolved for the caller (what they cannot read is a placeholder). ETag is the document revision.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
format | query | string | html (the only format) One of html. |
Responses
200OK: One read-only, sanitised HTML page
Headers
| Header | Description |
|---|---|
RateLimit-Policy | Token buckets that apply: "subject";q=<burst>;w=<seconds to refill>, and "file-writes" on writes |
RateLimit | The bucket closest to empty: "<name>";r=<remaining>;t=<seconds until full> |
ETag | The document revision |
Body text/html
string
Example
<!doctype html>
<html><head><meta charset="utf-8"><title>Q1 OKRs</title></head>
<body>
<h1>Q1 OKRs</h1>
<p>Ship the client this week</p>
</body></html>
401Unauthorized: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"detail": "missing or wrong credentials",
"code": "UNAUTHENTICATED"
}Codes: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED.
403Forbidden: ROLE_FORBIDDEN, SCOPE_REQUIRED, FILES_REQUIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:scope-required",
"title": "Forbidden",
"status": 403,
"detail": "SCOPE_REQUIRED: comment_add needs canvas:comment",
"code": "SCOPE_REQUIRED"
}Codes: SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED.
404Not Found: API_OFF, BLOCK_NOT_FOUND, NOT_FOUND, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:api-off",
"title": "Not Found",
"status": 404,
"detail": "the API is not enabled for this host ([host.flags] api_v1)",
"code": "API_OFF"
}Codes: API_OFF, FORMAT_UNSUPPORTED.
429Too Many Requests: RATE_LIMITED, with Retry-After, RateLimit-Policy and RateLimit
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:rate-limited",
"title": "Too Many Requests",
"status": 429,
"detail": "too many requests (subject limit); retry later",
"code": "RATE_LIMITED"
}Codes: RATE_LIMITED.
502Bad Gateway: HOST_UNAVAILABLE: your load or save callback failed
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:host-unavailable",
"title": "Bad Gateway",
"status": 502,
"detail": "host answered 503 Service Unavailable",
"code": "HOST_UNAVAILABLE"
}Codes: HOST_UNAVAILABLE.
503Service Unavailable: UNAVAILABLE, ROOM_UNAVAILABLE, with Retry-After
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unavailable",
"title": "Service Unavailable",
"status": 503,
"detail": "the idempotency store is unavailable; retry",
"code": "UNAVAILABLE"
}Codes: UNAVAILABLE.
Errors
| Status | Code | When |
|---|---|---|
| 404, 400 | FORMAT_UNSUPPORTED | Export (404): the format in the path is not one of md, html, json, ocanvas, docx, pdf. Convert (400): from or to is not supported. |
| 502 | HOST_UNAVAILABLE | Your load or save callback failed or timed out, so the file could not be loaded or saved. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
Import Markdown, HTML or CSV into the canvas
POST/api/v1/files/{fileId}/import
Add a file's content to the canvas, after blockId or at the end, as one change. Send the file as the raw body (UTF-8, at most 5 MiB). Markdown and HTML become blocks (HTML keeps only safe links and images, never scripts or styles); CSV becomes one database block (the first column is the title; the others are typed number, date, checkbox, select or text, or by types), at most 10,000 rows and 200 columns. The format must be in the host's [host.flags] import_formats. The import path also takes diagrams (format=drawio or excalidraw, with dryRun, page and boardId) and spreadsheets (format=xlsx or ods, one Spreadsheet block) as described in the integration guide. If nobody had the file open, the answer carries the saved version.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
format | query | string | md, html or csv One of md, html, csv. |
blockId | query | string | Insert after this block |
name | query | string | CSV: database name |
types | query | string | CSV: JSON array of column types |
Idempotency-Key | header | string | 1-255 visible ASCII characters, scoped to the caller. A repeat of the same request within 24 h answers the stored result (Idempotency-Replayed: true); another request with the same key is 422 IDEMPOTENCY_KEY_REUSED; a duplicate while the first runs is 409 IDEMPOTENCY_IN_PROGRESS. Failed requests are not stored. 1 to 255 characters. |
Request body
Required, application/octet-stream.
The file itself, as the raw body.
Example
## Notes
Imported from Markdown.
- First point
- Second point
Responses
200OK
Headers
| Header | Description |
|---|---|
Idempotency-Replayed | true when this is the stored answer of an earlier request with the same Idempotency-Key |
RateLimit-Policy | Token buckets that apply: "subject";q=<burst>;w=<seconds to refill>, and "file-writes" on writes |
RateLimit | The bucket closest to empty: "<name>";r=<remaining>;t=<seconds until full> |
Body application/json
| Field | Type | Description |
|---|---|---|
formatrequired | string | - |
blocks | integer | Markdown and HTML: blocks added |
rows | integer | CSV: rows imported |
dbId | string | CSV: the new database |
blockIdsrequired | array of string | - |
live | boolean | - |
version | string | When nobody had the file open: the version your save callback answered |
Other members may appear; ignore the ones you do not know.
Example
{
"format": "md",
"blocks": 2,
"blockIds": [
"b_01m87jw2k3m4n5p6q7r8s9t0v1",
"b_01m87jw2k3w4x5y6z7a8b9c0d1"
],
"live": true
}400Bad Request: BAD_INPUT, PATCH_INVALID, CURSOR_INVALID, IDEMPOTENCY_KEY_INVALID, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:idempotency-key-invalid",
"title": "Bad Request",
"status": 400,
"detail": "Idempotency-Key must be 1-255 visible ASCII characters",
"code": "IDEMPOTENCY_KEY_INVALID"
}Codes: IDEMPOTENCY_KEY_INVALID, IMPORT_INVALID.
401Unauthorized: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"detail": "missing or wrong credentials",
"code": "UNAUTHENTICATED"
}Codes: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED.
403Forbidden: ROLE_FORBIDDEN, SCOPE_REQUIRED, FILES_REQUIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:scope-required",
"title": "Forbidden",
"status": 403,
"detail": "SCOPE_REQUIRED: comment_add needs canvas:comment",
"code": "SCOPE_REQUIRED"
}Codes: SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, IMPORT_OFF.
404Not Found: API_OFF, BLOCK_NOT_FOUND, NOT_FOUND, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:api-off",
"title": "Not Found",
"status": 404,
"detail": "the API is not enabled for this host ([host.flags] api_v1)",
"code": "API_OFF"
}Codes: API_OFF, BLOCK_NOT_FOUND.
409Conflict: CONFLICT, CONFIRMATION_REQUIRED, IDEMPOTENCY_IN_PROGRESS (with Retry-After)
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:idempotency-in-progress",
"title": "Conflict",
"status": 409,
"detail": "a request with this Idempotency-Key is still running",
"code": "IDEMPOTENCY_IN_PROGRESS"
}Codes: IDEMPOTENCY_IN_PROGRESS, CONFLICT.
413Payload Too Large: DOC_TOO_LARGE, IMPORT_TOO_LARGE
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:body-too-large",
"title": "Payload Too Large",
"status": 413,
"detail": "the request body is too large",
"code": "BODY_TOO_LARGE"
}Codes: BODY_TOO_LARGE, IMPORT_TOO_LARGE, DOC_TOO_LARGE.
422Unprocessable Entity: IDEMPOTENCY_KEY_REUSED: the Idempotency-Key was used with a different request
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:idempotency-key-reused",
"title": "Unprocessable Entity",
"status": 422,
"detail": "this Idempotency-Key was used with a different request",
"code": "IDEMPOTENCY_KEY_REUSED"
}Codes: IDEMPOTENCY_KEY_REUSED.
429Too Many Requests: RATE_LIMITED, with Retry-After, RateLimit-Policy and RateLimit
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:rate-limited",
"title": "Too Many Requests",
"status": 429,
"detail": "too many requests (subject limit); retry later",
"code": "RATE_LIMITED"
}Codes: RATE_LIMITED.
502Bad Gateway: HOST_UNAVAILABLE: your load or save callback failed
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:host-unavailable",
"title": "Bad Gateway",
"status": 502,
"detail": "host answered 503 Service Unavailable",
"code": "HOST_UNAVAILABLE"
}Codes: HOST_UNAVAILABLE.
503Service Unavailable: UNAVAILABLE, ROOM_UNAVAILABLE, with Retry-After
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unavailable",
"title": "Service Unavailable",
"status": 503,
"detail": "the idempotency store is unavailable; retry",
"code": "UNAVAILABLE"
}Codes: UNAVAILABLE, ROOM_UNAVAILABLE.
Errors
| Status | Code | When |
|---|---|---|
| 400 | IDEMPOTENCY_KEY_INVALID | The Idempotency-Key header is empty, longer than 255 bytes, or has characters outside visible ASCII. |
| 422 | IDEMPOTENCY_KEY_REUSED | The key was used in the last 24 hours with another method, path or body. Use a new key for a new request. |
| 409 | IDEMPOTENCY_IN_PROGRESS | A request with the same key is still running, on this or another node. Retry after Retry-After (1 second) to get its answer. |
| 413 | BODY_TOO_LARGE | The request body is over the server's limit (at least 5 MiB, the import limit). |
| 403 | IMPORT_OFF | The format is not in the host's [host.flags] import_formats, or the operator set OC_IMPORT=off. |
| 400 | IMPORT_INVALID | The file could not be read: not UTF-8, a malformed CSV, or a diagram that is unreadable, too deep or declares entities. |
| 413 | IMPORT_TOO_LARGE | The file is over 5 MiB, or a CSV has more than 10,000 rows or 200 columns. |
| 404 | BLOCK_NOT_FOUND | No block in the canvas has that blockId (the path's, an op's blockId, or a comment's blockId). |
| 413 | DOC_TOO_LARGE | The change would make the canvas larger than the server's document limit. |
| 409 | CONFLICT | Your save callback answered that the file changed outside OpenCanvas; the host's conflict policy runs and the save is not retried. |
| 503 | ROOM_UNAVAILABLE | The change could not be stored in the live room. Retry. |
| 502 | HOST_UNAVAILABLE | Your load or save callback failed or timed out, so the file could not be loaded or saved. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
Stateless conversion
POST/api/v1/convert
Convert a file without a canvas: from Markdown, HTML or .ocanvas, to ocanvas, md, html, json, docx or pdf. Send the file as the raw body; the answer is the converted file. Changes nothing, so it takes no Idempotency-Key. Images in DOCX and PDF come only from your callback_base or asset_origins; boards become pictures.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
from | query | string | md, html or ocanvas |
to | query | string | ocanvas, md, html, json, docx or pdf |
Request body
Required, application/octet-stream.
The file itself, as the raw body.
Example
<h1>Hello</h1><p>From <strong>HTML</strong>.</p>Responses
200OK: The converted file
Headers
| Header | Description |
|---|---|
RateLimit-Policy | Token buckets that apply: "subject";q=<burst>;w=<seconds to refill>, and "file-writes" on writes |
RateLimit | The bucket closest to empty: "<name>";r=<remaining>;t=<seconds until full> |
Body application/octet-stream
binary
Example
# Hello
From **HTML**.
400Bad Request: BAD_INPUT, PATCH_INVALID, CURSOR_INVALID, IDEMPOTENCY_KEY_INVALID, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:format-unsupported",
"title": "Bad Request",
"status": 400,
"detail": "formats: md, html, json, ocanvas, docx, pdf",
"code": "FORMAT_UNSUPPORTED"
}Codes: FORMAT_UNSUPPORTED, INPUT_INVALID.
401Unauthorized: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"detail": "missing or wrong credentials",
"code": "UNAUTHENTICATED"
}Codes: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED.
403Forbidden: ROLE_FORBIDDEN, SCOPE_REQUIRED, FILES_REQUIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:scope-required",
"title": "Forbidden",
"status": 403,
"detail": "SCOPE_REQUIRED: comment_add needs canvas:comment",
"code": "SCOPE_REQUIRED"
}Codes: SCOPE_REQUIRED.
404Not Found: API_OFF, BLOCK_NOT_FOUND, NOT_FOUND, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:api-off",
"title": "Not Found",
"status": 404,
"detail": "the API is not enabled for this host ([host.flags] api_v1)",
"code": "API_OFF"
}Codes: API_OFF, FORMAT_UNSUPPORTED.
413Payload Too Large: DOC_TOO_LARGE, IMPORT_TOO_LARGE
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:body-too-large",
"title": "Payload Too Large",
"status": 413,
"detail": "the request body is too large",
"code": "BODY_TOO_LARGE"
}Codes: BODY_TOO_LARGE.
429Too Many Requests: RATE_LIMITED, with Retry-After, RateLimit-Policy and RateLimit
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:rate-limited",
"title": "Too Many Requests",
"status": 429,
"detail": "too many requests (subject limit); retry later",
"code": "RATE_LIMITED"
}Codes: RATE_LIMITED.
501Not Implemented: PDF_RENDERER_NOT_CONFIGURED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:pdf-renderer-not-configured",
"title": "Not Implemented",
"status": 501,
"detail": "PDF export needs OC_PDF_RENDERER=gotenberg:<url>; use the print view instead",
"code": "PDF_RENDERER_NOT_CONFIGURED"
}Codes: PDF_RENDERER_NOT_CONFIGURED.
Errors
| Status | Code | When |
|---|---|---|
| 413 | BODY_TOO_LARGE | The request body is over the server's limit (at least 5 MiB, the import limit). |
| 404, 400 | FORMAT_UNSUPPORTED | Export (404): the format in the path is not one of md, html, json, ocanvas, docx, pdf. Convert (400): from or to is not supported. |
| 400 | INPUT_INVALID | Convert: the body is not a readable .ocanvas file. |
| 501 | PDF_RENDERER_NOT_CONFIGURED | PDF needs the operator to run the Gotenberg sidecar and set OC_PDF_RENDERER. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, RATE_LIMITED, INTERNAL.
Last changed .