0.1 routes (deprecated)
The 0.1 host routes, kept through 0.x with their old answers, and retired in v0.3. Use the /api/v1 successor each one names.
- POST
/v1/files/{fileId}/patch - POST
/v1/files/{fileId}/commit - POST
/v1/files/{fileId}/role - DELETE
/v1/files/{fileId}/session - POST
/v1/files/{fileId}/members/invalidate - POST
/v1/files/{fileId}/import - POST
/v1/convert
Patch blocks (0.1)
POST/v1/files/{fileId}/patch
0.1 route, kept through 0.x with its answers and {error:{code,message}} errors. Successor: /api/v1/files/{fileId}/blocks:batch (sent in Link: rel="successor-version", with Deprecation).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
Request body
Required, application/json.
| Field | Type | Description |
|---|---|---|
(body)required | object | - |
Example
{
"ops": [
{
"op": "append",
"markdown": "Shipped on Friday."
}
],
"author": {
"id": "u_42",
"name": "Ada Lovelace"
}
}Responses
200OK
Body application/json
object
Example
{
"applied": 1,
"blockIds": [
"b_01m87jv4s4hw2f9n0k3q6t8y1v"
],
"live": true
}400Bad Request: PATCH_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "PATCH_INVALID",
"message": "op 1: blockId is required"
}
}Codes: PATCH_INVALID.
401Unauthorized: API_KEY_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "API_KEY_INVALID",
"message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
}
}Codes: API_KEY_INVALID.
404Not Found: BLOCK_NOT_FOUND
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "BLOCK_NOT_FOUND",
"message": "no block with that blockId"
}
}Codes: BLOCK_NOT_FOUND.
409Conflict: CONFLICT
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "CONFLICT",
"message": "the file changed elsewhere; the host's conflict policy is running"
}
}Codes: CONFLICT.
413Payload Too Large: DOC_TOO_LARGE
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "DOC_TOO_LARGE",
"message": "the patched document would exceed the size limit"
}
}Codes: DOC_TOO_LARGE.
502Bad Gateway: HOST_UNAVAILABLE
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "HOST_UNAVAILABLE",
"message": "host answered 503 Service Unavailable"
}
}Codes: HOST_UNAVAILABLE.
503Service Unavailable: ROOM_UNAVAILABLE
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "ROOM_UNAVAILABLE",
"message": "the change could not be stored; retry"
}
}Codes: ROOM_UNAVAILABLE.
Errors
| Status | Code | When |
|---|---|---|
| 401 | API_KEY_INVALID | 0.1 routes: the host id or key is missing or wrong. |
| 400 | PATCH_INVALID | 0.1 patch: an op is malformed. |
| 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. |
Save now (0.1)
POST/v1/files/{fileId}/commit
0.1 route, kept through 0.x with its answers and {error:{code,message}} errors. Successor: /api/v1/files/{fileId}/commit (sent in Link: rel="successor-version", with Deprecation).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
Responses
200OK
Body application/json
object
Example
{
"live": true,
"saved": true,
"version": "18"
}401Unauthorized: API_KEY_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "API_KEY_INVALID",
"message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
}
}Codes: API_KEY_INVALID.
409Conflict: CONFLICT
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "CONFLICT",
"message": "the file changed elsewhere; the host's conflict policy is running"
}
}Codes: CONFLICT.
500Internal Server Error: INTERNAL
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "INTERNAL",
"message": "internal error"
}
}Codes: INTERNAL.
Errors
| Status | Code | When |
|---|---|---|
| 401 | API_KEY_INVALID | 0.1 routes: the host id or key is missing or wrong. |
| 409 | CONFLICT | Your save callback answered that the file changed outside OpenCanvas; the host's conflict policy runs and the save is not retried. |
Also, like every operation on a file: INTERNAL.
Change a role (0.1)
POST/v1/files/{fileId}/role
0.1 route, kept through 0.x with its answers and {error:{code,message}} errors. Successor: /api/v1/files/{fileId}/role (sent in Link: rel="successor-version", with Deprecation).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
Request body
Required, application/json.
| Field | Type | Description |
|---|---|---|
(body)required | object | - |
Example
{
"userId": "u_42",
"role": "view"
}Responses
200OK
Body application/json
object
Example
{
"connections": 1,
"sessions": 2
}400Bad Request: ROLE_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "ROLE_INVALID",
"message": "role must be view, comment, edit or none"
}
}Codes: ROLE_INVALID.
401Unauthorized: API_KEY_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "API_KEY_INVALID",
"message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
}
}Codes: API_KEY_INVALID.
Errors
| Status | Code | When |
|---|---|---|
| 401 | API_KEY_INVALID | 0.1 routes: the host id or key is missing or wrong. |
| 400 | ROLE_INVALID | role is not view, comment, edit or none. |
Close the session (0.1)
DELETE/v1/files/{fileId}/session
0.1 route, kept through 0.x with its answers and {error:{code,message}} errors. Successor: /api/v1/files/{fileId}/session (sent in Link: rel="successor-version", with Deprecation).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
Responses
200OK
Body application/json
object
Example
{
"closed": true,
"sessions": 3
}401Unauthorized: API_KEY_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "API_KEY_INVALID",
"message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
}
}Codes: API_KEY_INVALID.
Errors
| Status | Code | When |
|---|---|---|
| 401 | API_KEY_INVALID | 0.1 routes: the host id or key is missing or wrong. |
Members changed (0.1)
POST/v1/files/{fileId}/members/invalidate
0.1 route, kept through 0.x with its answers and {error:{code,message}} errors. Successor: /api/v1/files/{fileId}/members:invalidate (sent in Link: rel="successor-version", with Deprecation).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
Responses
200OK
Body application/json
object
Example
{
"invalidated": true
}401Unauthorized: API_KEY_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "API_KEY_INVALID",
"message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
}
}Codes: API_KEY_INVALID.
Errors
| Status | Code | When |
|---|---|---|
| 401 | API_KEY_INVALID | 0.1 routes: the host id or key is missing or wrong. |
Import (0.1)
POST/v1/files/{fileId}/import
0.1 route, kept through 0.x with its answers and {error:{code,message}} errors. Successor: /api/v1/files/{fileId}/import (sent in Link: rel="successor-version", with Deprecation).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
formatrequired | query | string | |
author | query | string |
Request body
Required, application/octet-stream.
The file itself, as the raw body.
Example
## Notes
Imported from Markdown.
Responses
200OK
Body application/json
object
Example
{
"format": "md",
"blocks": 2,
"blockIds": [
"b_01m87jw2k3m4n5p6q7r8s9t0v1",
"b_01m87jw2k3w4x5y6z7a8b9c0d1"
],
"live": true
}400Bad Request: IMPORT_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "IMPORT_INVALID",
"message": "the file must be UTF-8 text"
}
}Codes: IMPORT_INVALID.
401Unauthorized: API_KEY_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "API_KEY_INVALID",
"message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
}
}Codes: API_KEY_INVALID.
403Forbidden: IMPORT_OFF
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "IMPORT_OFF",
"message": "this host does not allow md import"
}
}Codes: IMPORT_OFF.
404Not Found: BLOCK_NOT_FOUND
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "BLOCK_NOT_FOUND",
"message": "no block with that blockId"
}
}Codes: BLOCK_NOT_FOUND.
409Conflict: CONFLICT
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "CONFLICT",
"message": "the file changed elsewhere; the host's conflict policy is running"
}
}Codes: CONFLICT.
413Payload Too Large: IMPORT_TOO_LARGE, DOC_TOO_LARGE
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "IMPORT_TOO_LARGE",
"message": "at most 200 columns"
}
}Codes: IMPORT_TOO_LARGE, DOC_TOO_LARGE.
502Bad Gateway: HOST_UNAVAILABLE
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "HOST_UNAVAILABLE",
"message": "host answered 503 Service Unavailable"
}
}Codes: HOST_UNAVAILABLE.
503Service Unavailable: ROOM_UNAVAILABLE
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "ROOM_UNAVAILABLE",
"message": "the change could not be stored; retry"
}
}Codes: ROOM_UNAVAILABLE.
Errors
| Status | Code | When |
|---|---|---|
| 401 | API_KEY_INVALID | 0.1 routes: the host id or key is missing or wrong. |
| 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. |
Convert (0.1)
POST/v1/convert
0.1 route, kept through 0.x with its answers and {error:{code,message}} errors. Successor: /api/v1/convert (sent in Link: rel="successor-version", with Deprecation).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fromrequired | query | string | |
torequired | query | string |
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
Body application/octet-stream
binary
Example
# Hello
From **HTML**.
400Bad Request: FORMAT_UNSUPPORTED, INPUT_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "FORMAT_UNSUPPORTED",
"message": "formats: md, html, json, ocanvas, docx, pdf"
}
}Codes: FORMAT_UNSUPPORTED, INPUT_INVALID.
401Unauthorized: API_KEY_INVALID
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "API_KEY_INVALID",
"message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
}
}Codes: API_KEY_INVALID.
404Not Found: FORMAT_UNSUPPORTED
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "FORMAT_UNSUPPORTED",
"message": "formats: md, html, json, ocanvas, docx, pdf"
}
}Codes: FORMAT_UNSUPPORTED.
501Not Implemented: PDF_RENDERER_NOT_CONFIGURED
Body application/json
| Field | Type | Description |
|---|---|---|
error | object | - |
code | string | - |
message | string | - |
Example
{
"error": {
"code": "PDF_RENDERER_NOT_CONFIGURED",
"message": "PDF export needs OC_PDF_RENDERER=gotenberg:<url>; use the print view instead"
}
}Codes: PDF_RENDERER_NOT_CONFIGURED.
Errors
| Status | Code | When |
|---|---|---|
| 401 | API_KEY_INVALID | 0.1 routes: the host id or key is missing or wrong. |
| 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. |
Last changed .