Get Started

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/settings

Path Parameters

NameTypeRequiredDescription
idstringYesThe project ID

Headers

NameRequiredDescription
AuthorizationYesBearer $PAGEGUN_API_KEY
Content-TypeYesapplication/json

Body Parameters

All fields are optional. Only include the fields you want to update.

NameTypeDescription
themestringVisual theme: "default", "dark", "minimal"
favicon_urlstringURL to favicon (.ico, .png, or .svg)
og_image_urlstringDefault Open Graph image URL
meta_titlestringDefault meta title for the project
meta_descriptionstringDefault meta description
google_analytics_idstringGoogle Analytics measurement ID (e.g., "G-XXXXXXXXXX")
custom_head_htmlstringCustom HTML to inject into <head> on every page
footer_textstringFooter text shown on all pages
nav_linksarrayHeader 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

StatusCodeDescription
400validation_errorInvalid field value (e.g., unknown theme name)
404not_foundProject 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"
  }'
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 docs type page triggers nav rebuild.
© 2026 PageGun. All rights reserved.