Skip to content

Errors

When a request fails, Lyra answers with an HTTP status of 400 or more and a JSON body like this:

{
"error": {
"code": "page_not_found",
"message": "This page doesn't exist or you don't have access to it."
}
}
  • code stays the same, so check it in your code.
  • message is a sentence for people. Its wording can change, so don’t check it in code.

Every answer, failed or not, has an X-Request-Id header. Include it when you write to support@lyra-docs.com about a request.

Status Code What happened What to do
400 invalid_request The request doesn’t match the endpoint: a missing field, a wrong type or a value out of range. issues says which part Fix the request
401 unauthorized The token is missing, wrong, revoked or expired Check Authorization: Bearer <token>, or create a new token
403 forbidden You can open this, but can’t do this to it, such as editing a page you can only view Ask for more access in Lyra
403 storage_limit_reached On Lyra Cloud, the organization has used all the file storage its plan allows, so the upload was refused On Free, an admin can upgrade to Team in Settings → Billing. On Team, write to support for more room
404 page_not_found, comment_thread_not_found, row_not_found, file_not_found, not_a_database It doesn’t exist, or you can’t see it. Lyra answers the same for both, so a token can’t learn what exists Check the id, and that you can open it in Lyra
404 not_found No endpoint has this path and method Check the path against the reference
404 section_not_found You read a page by heading or blockId, and nothing matched Read the page without them to see its headings
409 request_in_progress A request with the same Idempotency-Key is still running Wait for the first one
409 busy Someone else was changing the same thing at that moment Try again in a moment
413 page_too_large, file_too_large The page would be too large to save, or the file is over 50 MB Split the content, or send a smaller file
413 markdown_too_complex Lyra can’t read the Markdown in one go, such as ::: containers nested more than 20 deep. message says why Send it in smaller pieces, or nest it less
422 invalid_input The request is well formed, but Lyra can’t do it, such as moving a page inside itself or filtering on a property the database doesn’t have. message says why Change the request
422 block_not_found An edit names a block id that isn’t on the page Read the page again with withIds=true for its current ids
422 row_not_in_database The row belongs to a different database Use the row’s own database id
422 not_a_table, table_cell_not_found, too_many_cells, last_table_row, cell_not_read A table edit doesn’t fit the table Read the table again and fix the row and column numbers
422 idempotency_key_reused You sent an Idempotency-Key again with a different body Use a new key for a new request
429 rate_limited The token sent more than 120 requests in a minute Wait for the seconds in Retry-After. See Rate limits
429 daily_upload_limit You uploaded as much as you can for one day Try again tomorrow
500 internal Something went wrong on Lyra’s side Try again later. If it keeps happening, write to support with the X-Request-Id
503 unavailable Lyra is busy or restarting Try again in a moment

A 400 invalid_request lists what was wrong in issues:

{
"error": {
"code": "invalid_request",
"message": "The request is not valid.",
"issues": [
{
"keyword": "invalid_type",
"instancePath": "/title",
"schemaPath": "#/title/invalid_type",
"message": "Invalid input: expected string, received number",
"params": { "expected": "string" }
}
]
}
}

The reference lists the statuses each endpoint can answer.

Some failures are worth trying again: 409 busy, 429, 500 and 503, and a request that timed out or lost its connection before an answer came. But if a POST that creates something did reach Lyra, sending it again would create it twice.

To make a POST safe to retry, send an Idempotency-Key header with a value that is unique to that change, such as a UUID or weekly-report-2026-49:

Terminal window
curl -s -X POST "https://app.lyra-docs.com/api/v1/pages" \
-H "Authorization: Bearer $LYRA_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: weekly-report-2026-49" \
-d '{"title": "Weekly report"}'
  • If the first request worked, sending the same key and body again does nothing new. Lyra sends back the first answer, with the header Idempotent-Replayed: true.
  • If the first request failed, Lyra doesn’t keep its answer, so a retry with the same key runs again.
  • If the first request is still running, Lyra answers 409 request_in_progress.
  • The same key with a different body answers 422 idempotency_key_reused.

Keys are up to 200 characters, belong to you alone, and are kept for 24 hours. They work on every POST except file uploads. PUT, PATCH and DELETE are safe to send again without one, because sending them twice has the same effect as once. A second DELETE answers 404, since the thing is already gone.

Wait longer after each failed try, such as 1, 2, then 4 seconds, and stop after a few tries.