List Pages

Retrieve all pages for a project with powerful filtering, sorting, and pagination options. Perfect for building admin interfaces or content management workflows.

Endpoint

GET /pages

Headers

NameRequiredDescription
AuthorizationYesBearer $PAGEGUN_API_KEY
Content-TypeNoapplication/json

Query Parameters

NameTypeRequiredDefaultDescription
project_idstringYes-Project ID to list pages for
typestringNoallFilter by page type: page, article, docs, item, or all
subroutestringNo-Filter by subroute (e.g., pages, blog, docs)
statusstringNoallFilter by status: draft, published, archived, or all
slugstringNo-Filter by slug (exact match or partial with * wildcard)
limitintegerNo25Number of results per page (1-100)
offsetintegerNo0Pagination offset
sortstringNoupdated_atSort field: created_at, updated_at, page_name, or slug
orderstringNodescSort order: asc or desc
created_afterstringNo-ISO 8601 timestamp to filter pages created after this date
created_beforestringNo-ISO 8601 timestamp to filter pages created before this date
updated_afterstringNo-ISO 8601 timestamp to filter pages updated after this date
updated_beforestringNo-ISO 8601 timestamp to filter pages updated before this date
include_contentbooleanNofalseInclude page content in response (increases response size)

Response

Returns a paginated list of page objects.

{ "data": [ { "id": "page_xyz789", "page_name": "Product Landing Page", "slug": "product-landing", "subroute": "pages", "type": "page", "status": "published", "url": "/product-landing", "meta": { "title": "Amazing Product - Get Started Today", "description": "Discover our amazing product features and benefits.", "image": "https://example.com/product-og.png" }, "sections_count": 8, "word_count": 1250, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-20T14:00:00Z" }, { "id": "page_abc456", "page_name": "Getting Started Guide", "slug": "getting-started", "subroute": "docs", "type": "docs", "status": "published", "url": "/docs/quick-start", "meta": { "title": "Getting Started - Documentation", "description": "Learn how to get started with our platform.", "image": null }, "sections_count": 5, "word_count": 850, "created_at": "2024-01-12T08:00:00Z", "updated_at": "2024-01-18T16:30:00Z" } ], "meta": { "total": 47, "limit": 25, "offset": 0, "has_more": true, "filters": { "project_id": "proj_abc123", "type": "all", "status": "all" } } }

Response Fields

Page Object

FieldTypeDescription
idstringUnique identifier for the page
page_namestringDisplay name of the page
slugstringURL slug for the page
subroutestringSubroute/folder for the page
typestringPage type: page, article, docs, or item
statusstringPublishing status: draft, published, or archived
urlstringFull URL path for the page
metaobjectSEO metadata for the page
sections_countintegerNumber of content sections in the page
word_countintegerApproximate word count of page content
created_atstringISO 8601 timestamp when page was created
updated_atstringISO 8601 timestamp when page was last modified

Meta Object (SEO)

FieldTypeDescription
titlestringPage title for SEO
descriptionstringMeta description for SEO
imagestringSocial sharing image URL

Meta Object (Pagination)

FieldTypeDescription
totalintegerTotal number of pages matching the filter
limitintegerMaximum number of items returned in this response
offsetintegerNumber of items skipped for pagination
has_morebooleanWhether there are more results available
filtersobjectApplied filters for this request

Examples

Basic Request

curl -X GET "https://api.pagegun.com/pages?project_id=proj_abc123" \ -H "Authorization: Bearer $PAGEGUN_API_KEY"

Filter by Type and Status

curl -X GET "https://api.pagegun.com/pages?project_id=proj_abc123&type=article&status=published" \ -H "Authorization: Bearer $PAGEGUN_API_KEY"

Pagination and Sorting

curl -X GET "https://api.pagegun.com/pages?project_id=proj_abc123&limit=10&offset=20&sort=page_name&order=asc" \ -H "Authorization: Bearer $PAGEGUN_API_KEY"

Search by Slug Pattern

curl -X GET "https://api.pagegun.com/pages?project_id=proj_abc123&slug=blog-*" \ -H "Authorization: Bearer $PAGEGUN_API_KEY"

Filter by Date Range

curl -X GET "https://api.pagegun.com/pages?project_id=proj_abc123&created_after=2024-01-01T00:00:00Z&created_before=2024-02-01T00:00:00Z" \ -H "Authorization: Bearer $PAGEGUN_API_KEY"

Include Content in Response

curl -X GET "https://api.pagegun.com/pages?project_id=proj_abc123&include_content=true&limit=5" \ -H "Authorization: Bearer $PAGEGUN_API_KEY"

JavaScript Example

const listPages = async (projectId, filters = {}) => { const params = new URLSearchParams({ project_id: projectId, ...filters }); const response = await fetch(`https://api.pagegun.com/pages?${params}`, { headers: { 'Authorization': `Bearer ${process.env.PAGEGUN_API_KEY}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.json(); }; // Usage examples const publishedArticles = await listPages('proj_abc123', { type: 'article', status: 'published', sort: 'created_at', order: 'desc' }); const recentPages = await listPages('proj_abc123', { created_after: '2024-01-01T00:00:00Z', limit: 50 });

Error Responses

400 Bad Request

{ "statusCode": 422, "name": "invalid_request", "message": "Invalid query parameter" }

401 Unauthorized

{ "statusCode": 401, "name": "unauthorized", "message": "Invalid or missing API key" }

403 Forbidden

{ "statusCode": 403, "name": "forbidden", "message": "You don't have access to this project" }

404 Not Found

{ "statusCode": 404, "name": "not_found", "message": "Project not found" }

429 Too Many Requests

{ "statusCode": 429, "name": "rate_limit_exceeded", "message": "Too many requests. Please try again later." }
© 2026 PageGun. All rights reserved.