Skip to content

Describe a database

GET
/api/v1/databases/{databaseId}
curl --request GET \
--url https://app.lyra-docs.com/api/v1/databases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>'

Returns a database’s properties, with their ids, types, options and formulas, and its views. Rows use the property names as keys.

databaseId
required
string format: uuid

The database’s id, the same as its page id

OK

Media typeapplication/json

A database’s properties and views.

object
id
required
string format: uuid
title
required
string
properties
required
Array<object>

A column of a database.

object
id
required
string
name
required
string
type
required

Title, text, number, select, multi_select, status, date, person, checkbox, url, email, phone, relation, formula, rollup, created_time, created_by, edited_time, edited_by, unique_id or files

string
options

The option labels of a select, multi_select or status

Array<string>
formula
string
formulaResult
string
relatedDatabaseId
string format: uuid
rollup
object
relationPropertyId
required
string
targetPropertyId
required
string
function
required
string
views
required
Array<object>
object
id
required
string
name
required
string
type
required
string

Example

{
"id": "0193a7c2-5d41-7c3e-9a51-6f0d2b8e4a10",
"title": "Tasks",
"properties": [
{
"id": "title",
"name": "Name",
"type": "title"
},
{
"id": "0193a7c4-1111-7aaa-8bbb-000000000001",
"name": "Status",
"type": "status",
"options": [
"Not started",
"In progress",
"Done"
]
},
{
"id": "0193a7c4-1111-7aaa-8bbb-000000000002",
"name": "Due",
"type": "date"
}
],
"views": [
{
"id": "0193a7c4-2222-7aaa-8bbb-000000000003",
"name": "All tasks",
"type": "table"
}
]
}
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."
}
}

It doesn’t exist, or the token’s person can’t see it. The code names what, such as page_not_found.

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": "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.

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