Move a page to the trash
const url = 'https://app.lyra-docs.com/api/v1/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/trash';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.lyra-docs.com/api/v1/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/trash \ --header 'Authorization: Bearer <token>'Moves a page and everything inside it to the trash. People can restore it from the trash in Lyra, or with POST /api/v1/pages/{pageId}/restore.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The page’s id
Header Parameters
Section titled “Header Parameters”Any unique string, up to 200 characters. Send the same key when you retry, and Lyra answers with the first answer instead of doing it twice.
Responses
Section titled “Responses”OK
A page, database or database row.
object
Doc is a page, database a database, row a row of a database
Where the page opens in Lyra
What the token can do on the page: view < comment < edit < full
Someone in the workspace.
object
Someone in the workspace.
object
Example
{ "id": "0193a7c2-5d41-7c3e-9a51-6f0d2b8e4a10", "title": "Launch plan", "icon": "🚀", "kind": "doc", "url": "https://app.lyra-docs.com/p/0193a7c2-5d41-7c3e-9a51-6f0d2b8e4a10", "parentId": "0193a7c2-4b10-7a2d-8e33-1c9f5a7b2d01", "teamspaceId": "0193a7c1-9e02-7f41-b6a8-3d5e7c9a1b22", "databaseId": null, "role": "full", "breadcrumbs": [ { "id": "0193a7c2-4b10-7a2d-8e33-1c9f5a7b2d01", "title": "Projects", "icon": null, "kind": "doc" } ], "createdAt": "2026-12-02T09:30:00.000Z", "createdBy": { "id": "0193a7c0-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "name": "Sam Lee" }, "updatedAt": "2026-12-02T09:30:00.000Z", "updatedBy": { "id": "0193a7c0-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "name": "Sam Lee" }, "inTrash": false, "expiresAt": null}Headers
Section titled “Headers”How many requests the token can send in a minute
How many it has left this minute
Seconds until the count starts again
The id of this request. Send it to support if something goes wrong.
The request does not match the schema: a missing field, a wrong type or a value out of range.
What went wrong.
object
object
A stable code to check in your code, such as page_not_found
A sentence for people, which can change
For invalid_request, each part of the request that was wrong
Example
{ "error": { "code": "invalid_request", "message": "The request is not valid.", "issues": [ { "instancePath": "/title", "message": "Too big: expected string to have <=500 characters" } ] }}The token is missing, wrong, revoked or expired.
What went wrong.
object
object
A stable code to check in your code, such as page_not_found
A sentence for people, which can change
For invalid_request, each part of the request that was wrong
Example
{ "error": { "code": "unauthorized", "message": "Please sign in." }}The token’s person can see this, but can’t do this to it.
What went wrong.
object
object
A stable code to check in your code, such as page_not_found
A sentence for people, which can change
For invalid_request, each part of the request that was wrong
Example
{ "error": { "code": "forbidden", "message": "You don't have access to do that." }}It doesn’t exist, or the token’s person can’t see it. The code names what, such as page_not_found.
What went wrong.
object
object
A stable code to check in your code, such as page_not_found
A sentence for people, which can change
For invalid_request, each part of the request that was wrong
Example
{ "error": { "code": "page_not_found", "message": "This page doesn't exist or you don't have access to it." }}A request with the same Idempotency-Key is still running.
What went wrong.
object
object
A stable code to check in your code, such as page_not_found
A sentence for people, which can change
For invalid_request, each part of the request that was wrong
Example
{ "error": { "code": "request_in_progress", "message": "A request with this key is still running." }}The request is well formed but Lyra can’t do it, such as a block id that isn’t on the page (block_not_found), or an Idempotency-Key used before with a different body (idempotency_key_reused).
What went wrong.
object
object
A stable code to check in your code, such as page_not_found
A sentence for people, which can change
For invalid_request, each part of the request that was wrong
Example
{ "error": { "code": "block_not_found", "message": "Block 'a9f0' is not on this page" }}Too many requests. Each token can send 120 requests a minute. Wait for the seconds in Retry-After.
What went wrong.
object
object
A stable code to check in your code, such as page_not_found
A sentence for people, which can change
For invalid_request, each part of the request that was wrong
Example
{ "error": { "code": "rate_limited", "message": "Too many requests. Try again in 21 seconds." }}Headers
Section titled “Headers”Seconds to wait before sending again