Blocks
List, read and find blocks, and change them in one atomic batch.
- GET
/api/v1/files/{fileId}/blocks - GET
/api/v1/files/{fileId}/blocks/{blockId} - GET
/api/v1/files/{fileId}/blocks:find - POST
/api/v1/files/{fileId}/blocks:batch - POST
/api/v1/files/{fileId}/live - GET
/api/v1/files/{fileId}/references
List top-level blocks
GET/api/v1/files/{fileId}/blocks
Top-level blocks in document order, a page at a time. Each page answers has_more and next_cursor (and a Link header when more follow); pass the cursor back unchanged. Cursors are signed Yjs positions: paging survives concurrent edits, and every block that exists for the whole walk comes back exactly once.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
limit | query | integer | 1-100, default 100 1 to 100. |
cursor | query | string | Opaque, signed cursor from next_cursor (bound to this file and query, valid 1 h) |
Responses
200OK
Headers
| Header | Description |
|---|---|
ETag | The document (or block) revision, quoted. |
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> |
Link | <…?cursor=…&limit=…>; rel="next" when more follow |
Body application/json
| Field | Type | Description |
|---|---|---|
blocksrequired | array of Block | - |
blockIdrequired | string | null | - |
revrequired | string | - |
noderequired | object | - |
rev | string | - |
has_morerequired | boolean | - |
next_cursorrequired | string | null | - |
Example
{
"blocks": [
{
"blockId": "b_01m87jv4rtz1wkrv27pzmqk64r",
"node": {
"attrs": {
"blockId": "b_01m87jv4rtz1wkrv27pzmqk64r",
"level": 2
},
"content": [
{
"text": "Launch plan",
"type": "text"
}
],
"type": "heading"
},
"rev": "689ac3d33e18"
},
{
"blockId": "b_01m87jv4rtkdxymn93jwtx35sk",
"node": {
"attrs": {
"blockId": "b_01m87jv4rtkdxymn93jwtx35sk"
},
"content": [
{
"text": "Ship on Friday.",
"type": "text"
}
],
"type": "paragraph"
},
"rev": "5641be1fd2cb"
}
],
"has_more": true,
"next_cursor": "eyJmIjoiZG9jXzEiLCJpIjoiQU1XcW5aRHpfZThKRDBFIiwiayI6ImJsb2NrcyIsInEiOiJlM2IwYzQ0Mjk4ZmMxYzE0OWFmYmY0YzgiLCJ4IjoxODAwMDAzNjAwfQ.pdHAPcfzMM5tjJk54UBrTS9TIqKP3xtJR9yZRY1bPv4",
"rev": "fc3a67f52c7b"
}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:cursor-invalid",
"title": "Bad Request",
"status": 400,
"detail": "the cursor is not valid for this request",
"code": "CURSOR_INVALID"
}Codes: CURSOR_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.
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.
410Gone: CURSOR_EXPIRED: cursors last an hour; start again without one
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:cursor-expired",
"title": "Gone",
"status": 410,
"detail": "the cursor has expired; start again without one",
"code": "CURSOR_EXPIRED"
}Codes: CURSOR_EXPIRED.
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.
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 |
|---|---|---|
| 400 | CURSOR_INVALID | The cursor is not one this server signed for this file and query: changed, truncated, from another host, or sent with a different filter, sort or fields. Pass next_cursor back unchanged. |
| 410 | CURSOR_EXPIRED | Cursors last an hour. Start the walk again without one. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
Read one block (also nested ones)
GET/api/v1/files/{fileId}/blocks/{blockId}
One block by its blockId, top-level or nested (a paragraph in a column, a task in a list). The block's rev comes back as ETag.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
blockIdrequired | path | string | The block's blockId attribute |
Responses
200OK
Headers
| Header | Description |
|---|---|
ETag | The document (or block) revision, quoted. |
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> |
Link | <…?cursor=…&limit=…>; rel="next" when more follow |
Body application/json
| Field | Type | Description |
|---|---|---|
blockIdrequired | string | null | - |
revrequired | string | - |
noderequired | object | - |
Example
{
"blockId": "b_01m87jv4rtkdxymn93jwtx35sk",
"node": {
"attrs": {
"blockId": "b_01m87jv4rtkdxymn93jwtx35sk"
},
"content": [
{
"text": "Ship on Friday.",
"type": "text"
}
],
"type": "paragraph"
},
"rev": "5641be1fd2cb"
}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, BLOCK_NOT_FOUND.
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.
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 | BLOCK_NOT_FOUND | No block in the canvas has that blockId (the path's, an op's blockId, or a comment's blockId). |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
Find blocks whose text contains q (case-insensitive)
GET/api/v1/files/{fileId}/blocks:find
Blocks whose text contains q, case-insensitively, in document order, with an excerpt and the block's position (path, indexes from the top). types keeps only those block types (paragraph, heading, taskList, ...).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
q | query | string | Text to find |
types | query | string | Comma-separated block types |
limit | query | integer | 1-100 |
Responses
200OK
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/json
| Field | Type | Description |
|---|---|---|
matchesrequired | array of object | - |
blockId | string | - |
rev | string | - |
type | string | - |
path | string | Indexes from the top, dot-separated |
excerpt | string | - |
Other members may appear; ignore the ones you do not know.
Example
{
"matches": [
{
"blockId": "b_01m87jv4rtkdxymn93jwtx35sk",
"excerpt": "Ship on Friday.",
"path": "1",
"rev": "5641be1fd2cb",
"type": "paragraph"
}
]
}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:bad-input",
"title": "Bad Request",
"status": 400,
"detail": "rows[0].values must be an object",
"code": "BAD_INPUT"
}Codes: BAD_INPUT.
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.
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.
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 |
|---|---|---|
| 400 | BAD_INPUT | The request is not what the operation takes: the body is not a JSON object, a field is missing or has the wrong type, an op, mode, format or event type is unknown, or fileId is longer than 1,024 bytes. detail says which. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
Change blocks in one atomic transaction
POST/api/v1/files/{fileId}/blocks:batch
Change blocks in one Yjs transaction: all ops apply, or none. Ops: append and insertAfter (with markdown or Tiptap blocks), replace, delete, and editText (textEdits: [{find, replace}]). An op with ifMatch whose block changed since you read it answers 412 STALE_BLOCK with the fresh block, and the If-Match header does the same for the whole document. Deleting more than 5 blocks needs "confirm": true.
New content lands directly. Changes to existing blocks land directly too, unless the call sends "mode": "suggest" or the host sets [host.api] default_mode = "suggest": then they become a suggestion (suggestionId) for a person to accept. The answer's rev is the new document revision (also the ETag).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
If-Match | header | string | The document rev (ETag) the batch expects; a mismatch answers 412 STALE_BLOCK. |
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/json.
| Field | Type | Description |
|---|---|---|
opsrequired | array of BatchOp | At least 1 item. |
oprequired | string | One of append, insertAfter, replace, delete, editText. |
blockId | string | - |
ifMatch | string | The block rev this op expects |
markdown | string | - |
blocks | array of object | - |
textEdits | array of object | - |
find | string | - |
replace | string | - |
mode | string | One of direct, suggest. |
confirm | boolean | - |
Example
{
"ops": [
{
"op": "append",
"markdown": "## Decisions\n\nShip on Friday."
},
{
"op": "editText",
"blockId": "b_01m87jv4rtkdxymn93jwtx35sk",
"ifMatch": "5641be1fd2cb",
"textEdits": [
{
"find": "Friday",
"replace": "Monday"
}
]
}
]
}Responses
200OK
Headers
| Header | Description |
|---|---|
ETag | The document (or block) revision, quoted. |
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> |
Link | <…?cursor=…&limit=…>; rel="next" when more follow |
Body application/json
| Field | Type | Description |
|---|---|---|
applied | integer | - |
mode | string | - |
blockIds | array of string | - |
rev | string | - |
suggestionId | string | - |
Example
{
"applied": 2,
"blockIds": [
"b_01m87jv4s4hw2f9n0k3q6t8y1v",
"b_01m87jv4s4p7d2m5c8x0z3r6tb",
"b_01m87jv4rtkdxymn93jwtx35sk"
],
"mode": "direct",
"rev": "27ae51518968",
"stale": []
}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, BAD_INPUT.
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, 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, CONFIRMATION_REQUIRED.
412Precondition Failed: STALE_BLOCK, with fresh
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:stale-block",
"title": "Precondition Failed",
"status": 412,
"detail": "a block changed since it was read; re-read it and retry",
"code": "STALE_BLOCK",
"fresh": {
"stale": [
{
"blockId": "b_01m87jv4rtkdxymn93jwtx35sk",
"rev": "5641be1fd2cb",
"markdown": "Ship on Friday.\n"
}
]
}
}Codes: STALE_BLOCK.
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.
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.
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). |
| 400 | BAD_INPUT | The request is not what the operation takes: the body is not a JSON object, a field is missing or has the wrong type, an op, mode, format or event type is unknown, or fileId is longer than 1,024 bytes. detail says which. |
| 404 | BLOCK_NOT_FOUND | No block in the canvas has that blockId (the path's, an op's blockId, or a comment's blockId). |
| 412 | STALE_BLOCK | A block op's ifMatch or the If-Match header names a revision that is no longer current. fresh carries the current state: the changed blocks with their rev and Markdown, or the document rev. Nothing was applied. |
| 409 | CONFIRMATION_REQUIRED | The batch deletes more than 5 blocks. Send it again with "confirm": true. |
| 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.
Make blocks live
POST/api/v1/files/{fileId}/live
"Make live" (LIVE-01, docs/27 §2.2): OpenCanvas asks your POST {callback_base}/files to create the live file (with the X-OpenCanvas-Callback-Token you send), writes the blocks into it as one edit with meta.kind = "live", saves it through the normal commit path, and replaces them in this canvas with one liveBlock node, one edit. Needs [host.flags] live_blocks. The blocks must be top-level; SDK blocks and blocks that hold live blocks cannot move. Databases and boards the blocks show move with them.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
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/json.
| Field | Type | Description |
|---|---|---|
blockIdsrequired | array of string | Top-level blocks to move, 1-500 |
namerequired | string | The live file's name, 1-200 characters |
Example
{
"blockIds": [
"b_01j9k2m3n4"
],
"name": "Q1 OKRs"
}Responses
201The live file and the block that now references it
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 |
|---|---|---|
liveFileIdrequired | string | - |
blockIdrequired | string | - |
kindrequired | string | One of blocks, database, board. |
Other members may appear; ignore the ones you do not know.
Example
{
"liveFileId": "f_8812",
"blockId": "b_01j9k2m3n5",
"kind": "blocks"
}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:bad-input",
"title": "Bad Request",
"status": 400,
"detail": "rows[0].values must be an object",
"code": "BAD_INPUT"
}Codes: BAD_INPUT, IDEMPOTENCY_KEY_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, LIVE_DEPTH.
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, LIVE_OFF.
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.
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.
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:live-create-unsupported",
"title": "Not Implemented",
"status": 501,
"detail": "the host does not create files (POST /files)",
"code": "LIVE_CREATE_UNSUPPORTED"
}Codes: LIVE_CREATE_UNSUPPORTED.
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 |
|---|---|---|
| 400 | BAD_INPUT | The request is not what the operation takes: the body is not a JSON object, a field is missing or has the wrong type, an op, mode, format or event type is unknown, or fileId is longer than 1,024 bytes. detail says which. |
| 404 | BLOCK_NOT_FOUND | No block in the canvas has that blockId (the path's, an op's blockId, or a comment's blockId). |
| 404 | LIVE_OFF | Live block operations need [host.flags] live_blocks = true in the host's entry of the hosts file. |
| 403 | LIVE_DEPTH | The canvas is itself a live file (meta.kind = "live"), which may not contain live blocks or references (the depth rule, docs/27 §2.2). |
| 501 | LIVE_CREATE_UNSUPPORTED | Your POST {callback_base}/files answered 404, 405 or 501: "Make live" needs it. |
| 502 | HOST_UNAVAILABLE | Your load or save callback failed or timed out, so the file could not be loaded or saved. |
| 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. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
List the live blocks and block references
GET/api/v1/files/{fileId}/references
The liveBlock and blockRef nodes in this canvas (LIVE-01, docs/27 §2.4) with the caller's access to each source, from your POST /access answers (cached 30 s). "Where is this live block used" is yours to answer: OpenCanvas keeps no usage index, and tells you with the live.embedded and live.removed events instead.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fileIdrequired | path | string | The host's file id 1 to 1024 characters. |
Responses
200OK: Every reference, with the caller's access to its source
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/json
| Field | Type | Description |
|---|---|---|
itemsrequired | array of object | - |
blockIdrequired | string | - |
typerequired | string | One of liveBlock, blockRef. |
fileIdrequired | string | - |
refBlockId | string | - |
kind | string | - |
accessrequired | string | One of edit, comment, view, none. |
Example
{
"items": [
{
"blockId": "b_01j9k2m3n5",
"type": "liveBlock",
"fileId": "f_8812",
"kind": "blocks",
"access": "edit"
}
]
}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.
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": "string",
"title": "string",
"status": 0,
"code": "string"
}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
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, ROLE_FORBIDDEN, FILES_REQUIRED, RATE_LIMITED, UNAVAILABLE, INTERNAL.
Last changed .