Search
Search across the canvases a person can open, through the host's own index, and extract a canvas's search text.
Search across canvases through the host (ADR-065); OpenCanvas keeps no index
Extract search.json
POST/api/v1/extract
The search.json of a .ocanvas (or Markdown) body: the same plain-text projection every save carries, for hosts that cannot open the zip or want to re-index old files. Stateless: nothing is stored. Up to 100 MB and 2 s; comments only with [host.search] comments = true. Changes nothing, so it takes no Idempotency-Key.
Request body
Required, application/vnd.opencanvas+zip.
The file itself, as the raw body.
Example
<.ocanvas bytes>Responses
200OK: search.json
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 |
|---|---|---|
vrequired | integer | - |
titlerequired | string | - |
lang | string | - |
blocksrequired | array of object | - |
id | string | - |
typerequired | string | - |
pathrequired | array of string | - |
textrequired | string | - |
done | boolean | - |
databasesrequired | array of object | - |
idrequired | string | - |
titlerequired | string | - |
rowsrequired | array of object | - |
idrequired | string | - |
textrequired | string | - |
boardsrequired | array of object | - |
idrequired | string | - |
textrequired | array of string | - |
liverequired | array of object | - |
comments | array of object | - |
id | string | - |
text | string | - |
truncatedrequired | boolean | - |
Other members may appear; ignore the ones you do not know.
Example
{
"v": 1,
"title": "Sprint 42 planning",
"blocks": [
{
"id": "b_9f2",
"type": "heading",
"path": [],
"text": "Release 4.2"
},
{
"id": "b_a10",
"type": "todo",
"path": [
"Release 4.2"
],
"text": "SSO set-up docs updated",
"done": false
}
],
"databases": [
{
"id": "db_1",
"title": "Sprint 42 backlog",
"rows": [
{
"id": "r_1",
"text": "Fix CSV export timeout · Marco Bianchi · In review"
}
]
}
],
"boards": [
{
"id": "bd_1",
"text": [
"Hero copy is too long on phones"
]
}
],
"live": [],
"truncated": false
}401Unauthorized: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"detail": "missing or wrong credentials",
"code": "UNAUTHENTICATED"
}Codes: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED.
403Forbidden: ROLE_FORBIDDEN, SCOPE_REQUIRED, FILES_REQUIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:scope-required",
"title": "Forbidden",
"status": 403,
"detail": "SCOPE_REQUIRED: comment_add needs canvas:comment",
"code": "SCOPE_REQUIRED"
}Codes: SCOPE_REQUIRED.
404Not Found: API_OFF, BLOCK_NOT_FOUND, NOT_FOUND, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:api-off",
"title": "Not Found",
"status": 404,
"detail": "the API is not enabled for this host ([host.flags] api_v1)",
"code": "API_OFF"
}Codes: API_OFF.
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.
415Unsupported Media Type: UNSUPPORTED_MEDIA_TYPE: send application/vnd.opencanvas+zip or text/markdown
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"
}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:not-ocanvas",
"title": "Unprocessable Entity",
"status": 422,
"detail": "the body is not a .ocanvas file",
"code": "NOT_OCANVAS"
}Codes: NOT_OCANVAS, EXTRACT_TOO_SLOW.
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.
Errors
| Status | Code | When |
|---|---|---|
| 413 | BODY_TOO_LARGE | The request body is over the server's limit (at least 5 MiB, the import limit). |
| 422 | NOT_OCANVAS | The extract body is not a readable .ocanvas (or not UTF-8 Markdown). |
| 422 | EXTRACT_TOO_SLOW | Extraction has a 2 s budget per file. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, RATE_LIMITED, INTERNAL.
Search across canvases
GET/api/v1/search
Searches the canvases the token's user can open, through the host's own GET /search callback (the host indexes search.json; OpenCanvas keeps no index and caches nothing). Needs a user token: a host key gets 400 USER_TOKEN_REQUIRED. Hits on files the host's /access refuses are dropped. At most 10 searches a minute per user. The MCP tool canvas_search answers the same items.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
qrequired | query | string | The words to look for (at most 200 bytes) At most 200 characters. |
scope | query | string | A scope id the host offered |
cursor | query | string | next of the previous page |
limit | query | integer | Items per page, 1-50 (default 20) 1 to 50. |
Responses
200OK: Results
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 | At most 50 items. |
fileIdrequired | string | - |
titlerequired | string | - |
path | string | - |
blockId | string | - |
snippetrequired | string | Plain text; escape it before showing |
updatedAt | string | - |
scopesrequired | array of object | At most 4 items. |
idrequired | string | - |
labelrequired | string | - |
partialrequired | boolean | - |
nextrequired | string | null | - |
Example
{
"items": [
{
"fileId": "doc_8812",
"title": "Sprint 42 planning",
"path": "Engineering",
"blockId": "b_3fQ1",
"snippet": "Admins can sign in with SSO, and…",
"updatedAt": "2026-11-26T09:41:00Z"
}
],
"scopes": [
{
"id": "all",
"label": "All canvases"
}
],
"partial": false,
"next": null
}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, USER_TOKEN_REQUIRED.
401Unauthorized: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"detail": "missing or wrong credentials",
"code": "UNAUTHENTICATED"
}Codes: UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED.
403Forbidden: ROLE_FORBIDDEN, SCOPE_REQUIRED, FILES_REQUIRED
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:scope-required",
"title": "Forbidden",
"status": 403,
"detail": "SCOPE_REQUIRED: comment_add needs canvas:comment",
"code": "SCOPE_REQUIRED"
}Codes: SCOPE_REQUIRED.
404Not Found: API_OFF, BLOCK_NOT_FOUND, NOT_FOUND, …
Body application/problem+json
| Field | Type | Description |
|---|---|---|
typerequired | string | Format uri-reference. |
titlerequired | string | - |
statusrequired | integer | - |
detail | string | - |
coderequired | string | Machine code (BLOCK_NOT_FOUND, STALE_BLOCK, ROLE_FORBIDDEN, …) |
fresh | any | STALE_BLOCK: the current state to retry against |
Other members may appear; ignore the ones you do not know.
Example
{
"type": "urn:opencanvas:problem:api-off",
"title": "Not Found",
"status": 404,
"detail": "the API is not enabled for this host ([host.flags] api_v1)",
"code": "API_OFF"
}Codes: API_OFF, SEARCH_UNAVAILABLE.
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-error",
"title": "Bad Gateway",
"status": 502,
"detail": "the host answered 500 Internal Server Error",
"code": "HOST_ERROR"
}Codes: HOST_ERROR.
504HOST_TIMEOUT: the host did not answer in time
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-timeout",
"title": "Error",
"status": 504,
"detail": "the host did not answer the search in time",
"code": "HOST_TIMEOUT"
}Codes: HOST_TIMEOUT.
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. |
| 400 | USER_TOKEN_REQUIRED | Search runs as a person, so the host's permissions apply; a host key has no person. |
| 404 | SEARCH_UNAVAILABLE | The host has not turned on [host.search] callback, or its GET /search answered 404, 405 or 501. |
| 504 | HOST_TIMEOUT | The host's search callback took longer than [host.search] timeout_ms (default 8 s). |
| 502 | HOST_ERROR | The host's search callback failed or answered something that is not a search answer. |
Also, like every operation on a file: API_OFF, UNAUTHENTICATED, TOKEN_INVALID, TOKEN_EXPIRED, SCOPE_REQUIRED, RATE_LIMITED.
Last changed .