# Get published site configuration

`GET /v1/public/site`

URL: https://docs.spacerun.co/docs/platform/reference/public-site/getPublicSite

- **Operation ID:** `getPublicSite`
- **Tags:** Public site
- **Base URL:** `http://localhost:8787`

Anonymous read of the published subset only: public settings sections, resolved feature flags, published content blocks, published navigation and active announcements. Drafts are never returned. `surface` narrows content blocks and navigation to one app.

**Workflow:** [Integration guide](https://docs.spacerun.co/docs/platform/guides/support-and-public-api).

**Authentication:** none (public).

## Authentication

- **Auth:** none (public endpoint, no token required).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `surface` | query | `string` | no | One of: `"landing"`, `"portal"` |

## Responses

### 200

Published site configuration.

- Header `x-request-id`: Request identifier; quote it when reporting an error.
Content type: `application/json`

Schema: `object (PublicSiteConfig)`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `settings` | `object` | yes | Public settings sections keyed by section name; only sections flagged public. |
| `flags` | `object` | yes | Feature flags resolved to on/off; audience and rollout rules are never exposed. |
| `contentBlocks` | `(object (PublicContentBlock))[]` | yes | - |
| `contentBlocks[].id` | `string<uuid>` | yes | - |
| `contentBlocks[].surface` | `string` | yes | - |
| `contentBlocks[].slot` | `string` | yes | - |
| `contentBlocks[].locale` | `string` | yes | - |
| `contentBlocks[].sort_order` | `integer` | yes | - |
| `contentBlocks[].published` | `object` | yes | Published content payload of the block. |
| `contentBlocks[].version` | `integer` | yes | - |
| `contentBlocks[].published_at` | `string<date-time>` | yes | ISO timestamp. |
| `navigation` | `(object (PublicNavItem))[]` | yes | - |
| `navigation[].id` | `string<uuid>` | yes | - |
| `navigation[].surface` | `string` | yes | - |
| `navigation[].location` | `string` | yes | - |
| `navigation[].parent_id` | `string<uuid> \| null` | yes | - |
| `navigation[].label` | `string` | yes | - |
| `navigation[].href` | `string` | yes | - |
| `navigation[].sort_order` | `integer` | yes | - |
| `announcements` | `(object (PublicAnnouncement))[]` | yes | Currently active announcements, newest first. |
| `announcements[].id` | `string<uuid>` | yes | - |
| `announcements[].kind` | `string` | yes | - |
| `announcements[].surfaces` | `string[]` | yes | - |
| `announcements[].severity` | `string` | yes | - |
| `announcements[].title` | `string` | yes | - |
| `announcements[].body_md` | `string \| null` | yes | - |
| `announcements[].cta_label` | `string \| null` | yes | - |
| `announcements[].cta_url` | `string \| null` | yes | - |
| `announcements[].dismissible` | `boolean` | yes | - |
| `announcements[].starts_at` | `string<date-time>` | yes | - |
| `announcements[].ends_at` | `string<date-time> \| null` | yes | - |

## Errors

### 400

Request validation failed.

- Header `x-request-id`: Request identifier; quote it when reporting an error.
Content type: `application/json`

Schema: `object (ValidationErrorBody)`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | `boolean` | yes | One of: `false` |
| `error` | `object` | yes | - |
| `error.name` | `string` | yes | One of: `"ZodError"` |
| `error.issues` | `object[]` | yes | - |
| `error.issues[].code` | `string` | yes | - |
| `error.issues[].path` | `(string \| number)[]` | yes | - |
| `error.issues[].message` | `string` | yes | - |

**Request validation**

```json
{
  "success": false,
  "error": {
    "name": "ZodError",
    "issues": [
      {
        "code": "custom",
        "path": [
          "field"
        ],
        "message": "Invalid value"
      }
    ]
  }
}
```

### 500

Unexpected server error (`internal`). No details are returned.

- Header `x-request-id`: Request identifier; quote it when reporting an error.
Content type: `application/json`

Schema: `object (ErrorBody)`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes | Stable machine-readable error code, e.g. `forbidden`, `not_found`. |
| `details` | `any` | no | Optional structured context. For 403 it is `{ perm }`. |

**Error response**

```json
{
  "error": "internal"
}
```

## Examples

### curl

```bash
curl -X GET 'http://localhost:8787/v1/public/site'
```

### TypeScript

```ts
const response = await fetch("http://localhost:8787/v1/public/site", {
  method: "GET",
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const data = response.status === 204 || response.status === 205
  ? undefined
  : response.headers.get("content-type")?.includes("json")
    ? await response.json()
    : await response.text();
```
