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.

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).

Credentials
Host key (X-OpenCanvas-Host and X-OpenCanvas-Key).
Deprecated
Retired in v0.3. Use batchBlocks.
Operation id
legacyPatch

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe host's file id 1 to 1024 characters.

Request body

Required, application/json.

FieldTypeDescription
(body)requiredobject-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "PATCH_INVALID",
    "message": "op 1: blockId is required"
  }
}

Codes: PATCH_INVALID.

401Unauthorized: API_KEY_INVALID

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "BLOCK_NOT_FOUND",
    "message": "no block with that blockId"
  }
}

Codes: BLOCK_NOT_FOUND.

409Conflict: CONFLICT

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "HOST_UNAVAILABLE",
    "message": "host answered 503 Service Unavailable"
  }
}

Codes: HOST_UNAVAILABLE.

503Service Unavailable: ROOM_UNAVAILABLE

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "ROOM_UNAVAILABLE",
    "message": "the change could not be stored; retry"
  }
}

Codes: ROOM_UNAVAILABLE.

Errors

StatusCodeWhen
401API_KEY_INVALID0.1 routes: the host id or key is missing or wrong.
400PATCH_INVALID0.1 patch: an op is malformed.
404BLOCK_NOT_FOUNDNo block in the canvas has that blockId (the path's, an op's blockId, or a comment's blockId).
413DOC_TOO_LARGEThe change would make the canvas larger than the server's document limit.
409CONFLICTYour save callback answered that the file changed outside OpenCanvas; the host's conflict policy runs and the save is not retried.
503ROOM_UNAVAILABLEThe change could not be stored in the live room. Retry.
502HOST_UNAVAILABLEYour 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).

Credentials
Host key (X-OpenCanvas-Host and X-OpenCanvas-Key).
Deprecated
Retired in v0.3. Use commitFile.
Operation id
legacyCommit

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe 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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "INTERNAL",
    "message": "internal error"
  }
}

Codes: INTERNAL.

Errors

StatusCodeWhen
401API_KEY_INVALID0.1 routes: the host id or key is missing or wrong.
409CONFLICTYour 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).

Credentials
Host key (X-OpenCanvas-Host and X-OpenCanvas-Key).
Deprecated
Retired in v0.3. Use setRole.
Operation id
legacySetRole

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe host's file id 1 to 1024 characters.

Request body

Required, application/json.

FieldTypeDescription
(body)requiredobject-

Example

{
  "userId": "u_42",
  "role": "view"
}

Responses

200OK

Body application/json

object

Example

{
  "connections": 1,
  "sessions": 2
}
400Bad Request: ROLE_INVALID

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "ROLE_INVALID",
    "message": "role must be view, comment, edit or none"
  }
}

Codes: ROLE_INVALID.

401Unauthorized: API_KEY_INVALID

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "API_KEY_INVALID",
    "message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
  }
}

Codes: API_KEY_INVALID.

Errors

StatusCodeWhen
401API_KEY_INVALID0.1 routes: the host id or key is missing or wrong.
400ROLE_INVALIDrole 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).

Credentials
Host key (X-OpenCanvas-Host and X-OpenCanvas-Key).
Deprecated
Retired in v0.3. Use closeSession.
Operation id
legacyCloseSession

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe 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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "API_KEY_INVALID",
    "message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
  }
}

Codes: API_KEY_INVALID.

Errors

StatusCodeWhen
401API_KEY_INVALID0.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).

Credentials
Host key (X-OpenCanvas-Host and X-OpenCanvas-Key).
Deprecated
Retired in v0.3. Use invalidateMembers.
Operation id
legacyInvalidateMembers

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe host's file id 1 to 1024 characters.

Responses

200OK

Body application/json

object

Example

{
  "invalidated": true
}
401Unauthorized: API_KEY_INVALID

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "API_KEY_INVALID",
    "message": "missing or wrong X-OpenCanvas-Host / X-OpenCanvas-Key"
  }
}

Codes: API_KEY_INVALID.

Errors

StatusCodeWhen
401API_KEY_INVALID0.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).

Credentials
Host key (X-OpenCanvas-Host and X-OpenCanvas-Key).
Deprecated
Retired in v0.3. Use importFile.
Operation id
legacyImport

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe host's file id 1 to 1024 characters.
formatrequiredquerystring
authorquerystring

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "IMPORT_INVALID",
    "message": "the file must be UTF-8 text"
  }
}

Codes: IMPORT_INVALID.

401Unauthorized: API_KEY_INVALID

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "IMPORT_OFF",
    "message": "this host does not allow md import"
  }
}

Codes: IMPORT_OFF.

404Not Found: BLOCK_NOT_FOUND

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "BLOCK_NOT_FOUND",
    "message": "no block with that blockId"
  }
}

Codes: BLOCK_NOT_FOUND.

409Conflict: CONFLICT

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "HOST_UNAVAILABLE",
    "message": "host answered 503 Service Unavailable"
  }
}

Codes: HOST_UNAVAILABLE.

503Service Unavailable: ROOM_UNAVAILABLE

Body application/json

FieldTypeDescription
errorobject-
codestring-
messagestring-

Example

{
  "error": {
    "code": "ROOM_UNAVAILABLE",
    "message": "the change could not be stored; retry"
  }
}

Codes: ROOM_UNAVAILABLE.

Errors

StatusCodeWhen
401API_KEY_INVALID0.1 routes: the host id or key is missing or wrong.
403IMPORT_OFFThe format is not in the host's [host.flags] import_formats, or the operator set OC_IMPORT=off.
400IMPORT_INVALIDThe file could not be read: not UTF-8, a malformed CSV, or a diagram that is unreadable, too deep or declares entities.
413IMPORT_TOO_LARGEThe file is over 5 MiB, or a CSV has more than 10,000 rows or 200 columns.
404BLOCK_NOT_FOUNDNo block in the canvas has that blockId (the path's, an op's blockId, or a comment's blockId).
413DOC_TOO_LARGEThe change would make the canvas larger than the server's document limit.
409CONFLICTYour save callback answered that the file changed outside OpenCanvas; the host's conflict policy runs and the save is not retried.
503ROOM_UNAVAILABLEThe change could not be stored in the live room. Retry.
502HOST_UNAVAILABLEYour 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).

Credentials
Host key (X-OpenCanvas-Host and X-OpenCanvas-Key).
Deprecated
Retired in v0.3. Use convert.
Operation id
legacyConvert

Parameters

NameInTypeDescription
fromrequiredquerystring
torequiredquerystring

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

FieldTypeDescription
errorobject-
codestring-
messagestring-

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

StatusCodeWhen
401API_KEY_INVALID0.1 routes: the host id or key is missing or wrong.
404, 400FORMAT_UNSUPPORTEDExport (404): the format in the path is not one of md, html, json, ocanvas, docx, pdf. Convert (400): from or to is not supported.
400INPUT_INVALIDConvert: the body is not a readable .ocanvas file.
501PDF_RENDERER_NOT_CONFIGUREDPDF needs the operator to run the Gotenberg sidecar and set OC_PDF_RENDERER.

Last changed .