List Projects
Retrieve all projects associated with your API key. This endpoint supports pagination and filtering to help you manage large numbers of projects.
Endpoint
| Name | Required | Description |
|---|
Authorization | Yes | Bearer $PAGEGUN_API_KEY |
Content-Type | No | application/json |
Query Parameters
| Name | Type | Required | Default | Description |
|---|
limit | integer | No | 25 | Number of projects to return per page (1-100) |
offset | integer | No | 0 | Number of projects to skip for pagination |
status | string | No | all | Filter by status: active, archived, or all |
domain | string | No | - | Filter by custom domain |
created_after | string | No | - | ISO 8601 timestamp to filter projects created after this date |
created_before | string | No | - | ISO 8601 timestamp to filter projects created before this date |
sort | string | No | created_at | Sort field: created_at, updated_at, or name |
order | string | No | desc | Sort order: asc or desc |
Response
Returns a paginated list of project objects.
{
"data": [
{
"id": "proj_abc123",
"name": "My Website",
"slug": "my-website",
"domain": "mywebsite.com",
"status": "active",
"hosting_mode": "full_host",
"page_count": 12,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:00:00Z"
}
],
"meta": {
"total": 156,
"limit": 25,
"offset": 0,
"has_more": true
}
}
Response Fields
Project Object
| Field | Type | Description |
|---|
id | string | Unique identifier for the project |
name | string | Display name of the project |
slug | string | URL-friendly version of the project name |
domain | string | Custom domain for the project (if configured) |
status | string | Current status: active or archived |
hosting_mode | string | Hosting configuration: full_host, rewrite, or data_mode |
page_count | integer | Number of pages in this project |
created_at | string | ISO 8601 timestamp when project was created |
updated_at | string | ISO 8601 timestamp when project was last modified |
| Field | Type | Description |
|---|
total | integer | Total number of projects matching the filter |
limit | integer | Maximum number of items returned in this response |
offset | integer | Number of items skipped for pagination |
has_more | boolean | Whether there are more results available |
Examples
Basic Request
curl -X GET "https://api.pagegun.com/projects" \
-H "Authorization: Bearer $PAGEGUN_API_KEY"
curl -X GET "https://api.pagegun.com/projects?limit=10&offset=20" \
-H "Authorization: Bearer $PAGEGUN_API_KEY"
Filter by Status and Domain
curl -X GET "https://api.pagegun.com/projects?status=active&domain=mysite.com" \
-H "Authorization: Bearer $PAGEGUN_API_KEY"
Sort by Name
curl -X GET "https://api.pagegun.com/projects?sort=name&order=asc" \
-H "Authorization: Bearer $PAGEGUN_API_KEY"
Error Responses
401 Unauthorized
{
"statusCode": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}
400 Bad Request
{
"statusCode": 422,
"name": "invalid_request",
"message": "Invalid parameter value"
}
429 Too Many Requests
{
"statusCode": 429,
"name": "rate_limit_exceeded",
"message": "Too many requests. Please try again later."
}
500 Internal Server Error
{
"statusCode": 500,
"name": "internal_error",
"message": "An internal error occurred. Please try again."
}