Get Project
Retrieve a single project by ID with complete configuration details, including settings, hosting configuration, and statistics.
Endpoint
Path Parameters
| Name | Type | Required | Description |
|---|
id | string | Yes | Unique project identifier (e.g., proj_abc123) |
Query Parameters
| Name | Type | Required | Description |
|---|
include | string | No | Comma-separated list of additional data to include: pages, settings, stats |
| Name | Required | Description |
|---|
Authorization | Yes | Bearer $PAGEGUN_API_KEY |
Content-Type | No | application/json |
Response
Returns a project object with complete configuration details.
{
"data": {
"id": "proj_abc123",
"name": "My Website",
"slug": "my-website",
"domain": "mywebsite.com",
"status": "active",
"hosting_mode": "full_host",
"page_count": 12,
"settings": {
"theme": "default",
"favicon": "https://example.com/favicon.ico",
"logo": "https://example.com/logo.png",
"custom_css": "",
"google_analytics": "GA-XXXXXXXX-X",
"meta_description": "My awesome website built with PageGun",
"social_image": "https://example.com/og-image.png"
},
"hosting": {
"mode": "full_host",
"subdomain": "mywebsite",
"custom_domain": "mywebsite.com",
"ssl_enabled": true,
"cdn_enabled": true
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:00:00Z"
}
}
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, archived, or suspended |
hosting_mode | string | Hosting configuration: full_host, rewrite, or data_mode |
page_count | integer | Total number of pages in this project |
settings | object | Project configuration settings |
hosting | object | Hosting and domain configuration |
created_at | string | ISO 8601 timestamp when project was created |
updated_at | string | ISO 8601 timestamp when project was last modified |
Settings Object
| Field | Type | Description |
|---|
theme | string | Visual theme identifier |
favicon | string | URL to the favicon image |
logo | string | URL to the logo image |
custom_css | string | Custom CSS styles for the project |
google_analytics | string | Google Analytics tracking ID |
meta_description | string | Default meta description for SEO |
social_image | string | Default social sharing image URL |
Hosting Object
| Field | Type | Description |
|---|
mode | string | Hosting mode: full_host, rewrite, or data_mode |
subdomain | string | PageGun subdomain (e.g., mysite for mysite.pagegun.dev) |
custom_domain | string | Custom domain if configured |
ssl_enabled | boolean | Whether SSL certificate is active |
cdn_enabled | boolean | Whether CDN acceleration is enabled |
Examples
Basic Request
curl -X GET "https://api.pagegun.com/projects/proj_abc123" \
-H "Authorization: Bearer $PAGEGUN_API_KEY"
Include Additional Data
curl -X GET "https://api.pagegun.com/projects/proj_abc123?include=pages,stats" \
-H "Authorization: Bearer $PAGEGUN_API_KEY"
With JavaScript
const response = await fetch('https://api.pagegun.com/projects/proj_abc123', {
headers: {
'Authorization': `Bearer ${process.env.PAGEGUN_API_KEY}`
}
});
const project = await response.json();
console.log(project.data.name);
Error Responses
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."
}