API Reference / Settings
Update Project Settings
Update one or more settings for a project. This endpoint supports partial updates — only include the fields you want to change.
Endpoint
HTTP
PUT /projects/:id/settingsPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The project ID |
Headers
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Bearer $PAGEGUN_API_KEY |
Content-Type | Yes | application/json |
Body Parameters
All fields are optional. Only include the fields you want to update.
| Name | Type | Description |
|---|---|---|
theme | string | Visual theme: "default", "dark", "minimal" |
favicon_url | string | URL to favicon (.ico, .png, or .svg) |
og_image_url | string | Default Open Graph image URL |
meta_title | string | Default meta title for the project |
meta_description | string | Default meta description |
google_analytics_id | string | Google Analytics measurement ID (e.g., "G-XXXXXXXXXX") |
custom_head_html | string | Custom HTML to inject into <head> on every page |
footer_text | string | Footer text shown on all pages |
nav_links | array | Header navigation links. Each: { "label": string, "href": string } |
Response
JSON
{
"data": {
"project_id": "proj_abc123",
"updated_fields": ["theme", "meta_title"],
"updated_at": "2024-01-21T10:00:00Z"
}
}Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid field value (e.g., unknown theme name) |
| 404 | not_found | Project not found |
Examples
Update Theme
Terminal
curl -X PUT "https://api.pagegun.com/projects/proj_abc123/settings" \
-H "Authorization: Bearer $PAGEGUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"theme": "dark"}'Update SEO Defaults
Terminal
curl -X PUT "https://api.pagegun.com/projects/proj_abc123/settings" \
-H "Authorization: Bearer $PAGEGUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"meta_title": "Example API Documentation",
"meta_description": "Complete API reference and guides for Example API.",
"og_image_url": "https://example.com/docs-og.jpg"
}'Add Navigation Links
Terminal
curl -X PUT "https://api.pagegun.com/projects/proj_abc123/settings" \
-H "Authorization: Bearer $PAGEGUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"nav_links": [
{ "label": "Home", "href": "https://example.com" },
{ "label": "API Status", "href": "https://status.example.com" },
{ "label": "GitHub", "href": "https://github.com/example" }
]
}'Add Custom Analytics
Terminal
curl -X PUT "https://api.pagegun.com/projects/proj_abc123/settings" \
-H "Authorization: Bearer $PAGEGUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"google_analytics_id": "G-XXXXXXXXXX",
"custom_head_html": "<script src=\"https://cdn.example.com/analytics.js\"></script>"
}'Important Notes
- Partial updates: Only fields included in the request body are changed. Omitted fields are not affected.
- Re-publish required: Settings changes that affect page rendering (theme, footer, nav) require re-publishing pages to take effect.
- Navigation regeneration: Changing nav_links does not regenerate docs navigation. Only publishing a
docstype page triggers nav rebuild.
Related
- Get Settings — Read current settings
- Hosting Modes — Configure how your site is hosted