Skip to content

Create a page

POST
/api/v1/pages
curl --request POST \
--url https://app.lyra-docs.com/api/v1/pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "title": "Weekly notes", "markdown": "# This week\n\n- Shipped the importer\n- Fixed the sign-in email", "parentId": "0193a7c2-4b10-7a2d-8e33-1c9f5a7b2d01" }'

Creates a page from Markdown inside a page (parentId), at the top of a teamspace (teamspaceId), or, with neither, in your private pages. The Markdown can hold Lyra’s own blocks, such as cards, columns and Mermaid diagrams. warnings lists each line Lyra read differently from what it looks like you meant; built counts the blocks other than plain text it made. With temporary: true the page moves to the trash on its own after expiresInDays days.

Idempotency-Key
string
<= 200 characters

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.

Media typeapplication/json
object
title
string
"" <= 500 characters
markdown
string
"" <= 200000 characters
icon

An emoji

string
<= 16 characters
parentId

Create it inside this page

string format: uuid
teamspaceId

Create it at the top of this teamspace

string format: uuid
temporary
boolean
expiresInDays

Days from now until a temporary page moves to the trash, 3 if left out. Only with temporary: true.

integer
>= 1 <= 365

Example

{
"title": "Weekly notes",
"markdown": "# This week\n\n- Shipped the importer\n- Fixed the sign-in email",
"parentId": "0193a7c2-4b10-7a2d-8e33-1c9f5a7b2d01"
}

Created

Media typeapplication/json
object
page
required

A page, database or database row.

object
id
required
string format: uuid
title
required
string
icon
required
Any of:

An emoji

string
<= 16 characters
kind
required

Doc is a page, database a database, row a row of a database

string
Allowed values: doc database row
url
required

Where the page opens in Lyra

string
parentId
required

The page it is inside, or null at the top of a teamspace

Any of:
string format: uuid
teamspaceId
required

The teamspace it is in, or null for a private page

Any of:
string format: uuid
databaseId
required

For a row, the database it belongs to

Any of:
string format: uuid
role
required

What the token can do on the page: view < comment < edit < full

string
Allowed values: view comment edit full
breadcrumbs
required

The pages above it, from the top down

Array<object>

A page above this one that the token can see.

object
id
required
string format: uuid
title
required
string
icon
required
Any of:

An emoji

string
<= 16 characters
kind
required
string
Allowed values: doc database row
createdAt
required
string format: date-time
createdBy
required

Someone in the workspace.

object
id
required
string format: uuid
name
required
string
updatedAt
required
string format: date-time
updatedBy
required

Someone in the workspace.

object
id
required
string format: uuid
name
required
string
inTrash
required
boolean
expiresAt
required

When a temporary page moves to the trash on its own, or null for a page that stays

Any of:
string format: date-time
built
required

How many blocks other than plain text the Markdown made, by type, such as {“card”: 3}

object
key
additional properties
integer
warnings
required
Array<object>

A line of Markdown that Lyra read differently from what it looks like you meant, such as a block it does not have or a container that is never closed.

object
line

The line of the Markdown it is about, counting from 1

integer
message
required
string

Example

{
"page": {
"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
},
"warnings": [
{
"line": 4,
"message": "Lyra has no block named callout, so this line shows as text. Its blocks are card, columns, column, timeline, item, arrow, stat, choice."
}
]
}
X-RateLimit-Limit
integer

How many requests the token can send in a minute

X-RateLimit-Remaining
integer

How many it has left this minute

X-RateLimit-Reset
integer

Seconds until the count starts again

X-Request-Id
string

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.

Media typeapplication/json

What went wrong.

object
error
required
object
code
required

A stable code to check in your code, such as page_not_found

string
message
required

A sentence for people, which can change

string
issues

For invalid_request, each part of the request that was wrong

Array

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.

Media typeapplication/json

What went wrong.

object
error
required
object
code
required

A stable code to check in your code, such as page_not_found

string
message
required

A sentence for people, which can change

string
issues

For invalid_request, each part of the request that was wrong

Array

Example

{
"error": {
"code": "unauthorized",
"message": "Please sign in."
}
}

The token’s person can see this, but can’t do this to it.

Media typeapplication/json

What went wrong.

object
error
required
object
code
required

A stable code to check in your code, such as page_not_found

string
message
required

A sentence for people, which can change

string
issues

For invalid_request, each part of the request that was wrong

Array

Example

{
"error": {
"code": "forbidden",
"message": "You don't have access to do that."
}
}

A request with the same Idempotency-Key is still running.

Media typeapplication/json

What went wrong.

object
error
required
object
code
required

A stable code to check in your code, such as page_not_found

string
message
required

A sentence for people, which can change

string
issues

For invalid_request, each part of the request that was wrong

Array

Example

{
"error": {
"code": "request_in_progress",
"message": "A request with this key is still running."
}
}

The page, file or Markdown is too large: page_too_large, file_too_large, or markdown_too_complex for Markdown too long or too deeply nested to read in one go.

Media typeapplication/json

What went wrong.

object
error
required
object
code
required

A stable code to check in your code, such as page_not_found

string
message
required

A sentence for people, which can change

string
issues

For invalid_request, each part of the request that was wrong

Array

Example

{
"error": {
"code": "file_too_large",
"message": "Files can be up to 50 MB."
}
}

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).

Media typeapplication/json

What went wrong.

object
error
required
object
code
required

A stable code to check in your code, such as page_not_found

string
message
required

A sentence for people, which can change

string
issues

For invalid_request, each part of the request that was wrong

Array

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.

Media typeapplication/json

What went wrong.

object
error
required
object
code
required

A stable code to check in your code, such as page_not_found

string
message
required

A sentence for people, which can change

string
issues

For invalid_request, each part of the request that was wrong

Array

Example

{
"error": {
"code": "rate_limited",
"message": "Too many requests. Try again in 21 seconds."
}
}
Retry-After
integer

Seconds to wait before sending again