Skip to main content
GET
/
pages
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
page = client.pages.list()
page = page.data[0]
print(page.id)
{
  "object": "list",
  "data": [
    {
      "object": "page",
      "id": "<string>",
      "name": "<string>",
      "parent": {
        "type": "page",
        "page_id": "<string>"
      },
      "created_at": "2023-11-07T05:31:56Z"
    }
  ],
  "has_more": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

limit
integer
default:20

The limit on the number of objects to return, ranging between 1 and 100.

Required range: 1 <= x <= 100
after
string

A cursor to use in pagination. after is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo to fetch the next page of the list.

before
string

A cursor to use in pagination. before is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include before=obj_bar to fetch the previous page of the list.

parent
object

Filter pages by parent. Pass {"type":"root"} to get root-level pages, or {"type":"page","page_id":"page_123"} to get pages nested under a specific page. If not specified, returns all pages. The parent page reference, indicating where this page is nested

Response

200 - application/json

List of pages

object
enum<string>
required

The object type, always 'list'

Available options:
list
data
object[]
required

Array of page objects

has_more
boolean
required

Whether there are more results available