Projects

Projects are the top-level container in PageGun. Each project holds pages, settings, and publishing configuration. You need at least one project before creating pages.


List Projects

GET /v1/projects

Returns a list of all projects in your account.

Query Parameters

NameTypeRequiredDescription
limitintegerNoNumber of results to return. Default: 20, Max: 100
offsetintegerNoNumber of results to skip. Default: 0

Request

curl https://api.pagegun.com/v1/projects \ -H "Authorization: Bearer pgk_live_xxxxx"
const response = await fetch("https://api.pagegun.com/v1/projects", { headers: { Authorization: "Bearer pgk_live_xxxxx" }, }); const { data } = await response.json();

Response

{ "success": true, "data": [ { "id": "MgdGoare", "name": "My Website", "created_at": "2024-01-15T08:30:00Z", "updated_at": "2024-02-01T12:00:00Z" } ] }

Response Fields

NameTypeDescription
idstringUnique project identifier
namestringProject display name
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp

Create Project

POST /v1/projects

Creates a new project.

Note

Project creation is currently limited to whitelisted users. Contact support if you need to create projects via the API.

Request Body

NameTypeRequiredDescription
namestringYesProject name (1–100 characters)

Request

curl -X POST https://api.pagegun.com/v1/projects \ -H "Authorization: Bearer pgk_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{"name": "My New Website"}'
const response = await fetch("https://api.pagegun.com/v1/projects", { method: "POST", headers: { Authorization: "Bearer pgk_live_xxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ name: "My New Website" }), }); const { data } = await response.json();

Response 201 Created

{ "success": true, "data": { "id": "AbCdEfGh", "name": "My New Website", "created_at": "2024-03-01T10:00:00Z", "updated_at": "2024-03-01T10:00:00Z" } }

Get Project

GET /v1/projects/:id

Retrieves a single project by ID.

Path Parameters

NameTypeRequiredDescription
idstringYesProject ID

Request

curl https://api.pagegun.com/v1/projects/MgdGoare \ -H "Authorization: Bearer pgk_live_xxxxx"
const response = await fetch("https://api.pagegun.com/v1/projects/MgdGoare", { headers: { Authorization: "Bearer pgk_live_xxxxx" }, }); const { data } = await response.json();

Response

{ "success": true, "data": { "id": "MgdGoare", "name": "My Website", "context": "A documentation site for our API", "settings": { "custom_domain": "docs.example.com" }, "created_at": "2024-01-15T08:30:00Z", "updated_at": "2024-02-01T12:00:00Z" } }

Response Fields

NameTypeDescription
idstringUnique project identifier
namestringProject display name
contextstringProject description or context for AI generation
settingsobjectProject-level settings (custom domain, etc.)
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp

Update Project

PUT /v1/projects/:id

Updates a project. Supports partial updates — only include the fields you want to change.

Path Parameters

NameTypeRequiredDescription
idstringYesProject ID

Request Body

NameTypeRequiredDescription
namestringNoNew project name
contextstringNoProject description or AI context
settingsobjectNoProject settings object

Request

curl -X PUT https://api.pagegun.com/v1/projects/MgdGoare \ -H "Authorization: Bearer pgk_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{"name": "Updated Website Name", "context": "Our documentation portal"}'
const response = await fetch("https://api.pagegun.com/v1/projects/MgdGoare", { method: "PUT", headers: { Authorization: "Bearer pgk_live_xxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ name: "Updated Website Name", context: "Our documentation portal", }), }); const { data } = await response.json();

Response

{ "success": true, "data": { "id": "MgdGoare", "name": "Updated Website Name", "context": "Our documentation portal", "settings": {}, "created_at": "2024-01-15T08:30:00Z", "updated_at": "2024-03-15T14:30:00Z" } }
© 2026 PageGun. All rights reserved.