Comments

List comment threads, start a thread on a block or reply to one.

List comment threads

GET/api/v1/files/{fileId}/comments

Comment threads with their messages: the block (or quote) each is on, whether it is resolved, and who wrote each message (user id and name, never an e-mail address). resolved=false keeps the open ones.

Credentials
Host key, or a user token with canvas:read.
Least role
view on the file (effective permission min(scope, role)).
Operation id
listComments

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe host's file id 1 to 1024 characters.
resolvedquerybooleanOnly resolved (true) or open (false) threads

Responses

200OK

Headers

HeaderDescription
RateLimit-PolicyToken buckets that apply: "subject";q=<burst>;w=<seconds to refill>, and "file-writes" on writes
RateLimitThe bucket closest to empty: "<name>";r=<remaining>;t=<seconds until full>

Body application/json

FieldTypeDescription
threadsrequiredarray of object-
threadIdstring-
blockIdstring | null-
quotestring | null-
resolvedboolean-
messagesarray of object-
userIdstring-
bystringDisplay name
textstring-
atintegerUnix milliseconds

Other members may appear; ignore the ones you do not know.

Example

{
  "threads": [
    {
      "blockId": "b_01m87jv4rtkdxymn93jwtx35sk",
      "messages": [
        {
          "at": 1795550974775,
          "by": "u_42",
          "text": "Is Friday still right?",
          "userId": "u_42"
        },
        {
          "at": 1795550974778,
          "by": "u_42",
          "text": "Yes, confirmed.",
          "userId": "u_42"
        }
      ],
      "quote": "Ship on Monday.",
      "resolved": false,
      "threadId": "t_01m87jv4sqj5z6jz5q2n5zdtdw"
    }
  ]
}
401Unauthorized: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED

Body application/problem+json

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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.

Start a thread on a block or reply to one

POST/api/v1/files/{fileId}/comments

Start a thread on a block (blockId, optionally with the quote it is about) or on a quote alone, or reply to a thread with threadId. Needs canvas:comment. Mentions in the text notify people as in the editor.

Credentials
Host key, or a user token with canvas:comment.
Least role
comment on the file (effective permission min(scope, role)).
Idempotent
Send an Idempotency-Key to retry safely.
Operation id
addComment

Parameters

NameInTypeDescription
fileIdrequiredpathstringThe host's file id 1 to 1024 characters.
Idempotency-Keyheaderstring1-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.

FieldTypeDescription
textrequiredstring-
blockIdstring-
quotestring-
threadIdstring-

Example

{
  "text": "Is Friday still right?",
  "blockId": "b_01m87jv4rtkdxymn93jwtx35sk"
}

Responses

200OK

Headers

HeaderDescription
Idempotency-Replayedtrue when this is the stored answer of an earlier request with the same Idempotency-Key
RateLimit-PolicyToken buckets that apply: "subject";q=<burst>;w=<seconds to refill>, and "file-writes" on writes
RateLimitThe bucket closest to empty: "<name>";r=<remaining>;t=<seconds until full>

Body application/json

FieldTypeDescription
threadIdrequiredstring-

Other members may appear; ignore the ones you do not know.

Example

{
  "threadId": "t_01m87jv4sqj5z6jz5q2n5zdtdw"
}
400Bad Request: BAD_INPUT, PATCH_INVALID, CURSOR_INVALID, IDEMPOTENCY_KEY_INVALID, …

Body application/problem+json

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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, NOT_FOUND.

409Conflict: CONFLICT, CONFIRMATION_REQUIRED, IDEMPOTENCY_IN_PROGRESS (with Retry-After)

Body application/problem+json

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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.

413Payload Too Large: DOC_TOO_LARGE, IMPORT_TOO_LARGE

Body application/problem+json

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

FieldTypeDescription
typerequiredstringFormat uri-reference.
titlerequiredstring-
statusrequiredinteger-
detailstring-
coderequiredstringMachine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …)
freshanySTALE_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

StatusCodeWhen
400IDEMPOTENCY_KEY_INVALIDThe Idempotency-Key header is empty, longer than 255 bytes, or has characters outside visible ASCII.
422IDEMPOTENCY_KEY_REUSEDThe key was used in the last 24 hours with another method, path or body. Use a new key for a new request.
409IDEMPOTENCY_IN_PROGRESSA request with the same key is still running, on this or another node. Retry after Retry-After (1 second) to get its answer.
413BODY_TOO_LARGEThe request body is over the server's limit (at least 5 MiB, the import limit).
400BAD_INPUTThe 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.
404BLOCK_NOT_FOUNDNo block in the canvas has that blockId (the path's, an op's blockId, or a comment's blockId).
404NOT_FOUNDAn unknown database, board or comment thread id, or a path that is no API operation.
502HOST_UNAVAILABLEYour 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.

Last changed .