Read a page as Markdown
const url = 'https://app.lyra-docs.com/api/v1/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/markdown?withIds=true';const options = {method: 'GET', 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 GET \ --url 'https://app.lyra-docs.com/api/v1/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/markdown?withIds=true' \ --header 'Authorization: Bearer <token>'Returns what is on a page as Markdown. With withIds=true each block starts with a line, the ids that POST /api/v1/pages/{pageId}/edits takes; Lyra skips these lines in Markdown you send back. heading reads only the section under the first heading that matches, and blockId only that block (for a heading, the section under it).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The page’s id
Query Parameters
Section titled “Query Parameters”Start each block with a line
Responses
Section titled “Responses”OK
object
Example
{ "pageId": "0193a7c2-5d41-7c3e-9a51-6f0d2b8e4a10", "markdown": "# Launch plan\n\nWe launch on the 10th.\n"}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." }}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