# Replace status page structure — API reference

> Replaces the complete status-page structure with the supplied sections and resources.

Source: https://upfour.io/docs/api/status-pages/replace-status-page-structure

[Developers](https://upfour.io/docs/api.md)/[Status pages](https://upfour.io/docs/api/status-pages.md)

Replaces the complete status-page structure with the supplied sections and resources.

PUT https://app.upfour.io/v1/status-pages/{pageID}/structure

scope status_page.write stable returns 200

## Parameters

| Field | Type | Description |
| --- | --- | --- |
| `pageID` required | uuid | path parameter |

## Body

`application/json` required 1 field

All other fields18 fields

sectionsStructureSectionInput[]

The whole structure: sections not listed are deleted, and omitting the field removes all of them.

In the app: **Structure**

Nested fields 17 fields

| Field | Type | Description |
| --- | --- | --- |
| `auto_group_id` optional | uuid  · nullable | Required for monitor_group and job_group, rejected for the other sources. |
| `auto_source` optional | string one of`none` `all_monitors` `all_jobs` `monitor_group` `job_group` | none (stored resources), all_monitors, all_jobs, monitor_group or job_group. An automatic section cannot also hold resources. |
| `auto_widget_type` optional | string | How the components of an automatic section render; history by default. |
| `name` optional | string | |
| `resources` optional | StructureResourceInput[] | |
| Each item · 12 fields FieldTypeDescription `auto_publish` optional boolean  · nullable false keeps the automatic report for this component as an internal draft. Default true. `explanation` optional string `feed_component_id` optional string `feed_url` optional string Address of a vendor's status page (Atlassian Statuspage or Instatus); needs feed_component_id. `heartbeat_id` optional uuid  · nullable `is_external` optional boolean Shown for transparency but never counted into the page's own status or availability. Always true for a feed component. `manual_status` optional string one of`""` `operational` `degraded` `down` `maintenance` Only for a component with no monitor, scheduled job or feed. Empty derives the status. `mark_degraded_for` optional string any_incident shows an open incident as degraded instead of down; any non-empty value also shows a slow but up monitor as degraded. Default no_incident. `mark_down_for` optional string any_incident (the default) shows the component as down while an incident is open; any other value shows it as degraded instead. `monitor_id` optional uuid  · nullable At most one of monitor_id and heartbeat_id; with neither the component is manual (manual_status) or follows a vendor feed (feed_url). `public_name` optional string `widget_type` optional string How the component renders: history (daily bars, the default), plain, or response_times (monitors only). Not validated by the service. | | |

## Returns

A successful request returns `200` with application/json.

Response fields 2 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | StatusPageSection[]  · nullable | |
| Each item · 54 fields FieldTypeDescription `auto_source` string one of`none` `all_monitors` `all_jobs` `monitor_group` `job_group` `auto_widget_type` string `created_at` string (date-time) `id` uuid `name` string `position` integer `resources` StatusPageResource[]  · nullable Each item · 45 fields FieldTypeDescription `auto_publish` boolean `explanation` string `heartbeat_id` uuid  · nullable `id` uuid `mark_degraded_for` string any_incident shows an open incident as degraded instead of down; any non-empty value also shows a slow but up monitor as degraded. Default no_incident. `mark_down_for` string any_incident (the default) shows the component as down while an incident is open; any other value shows it as degraded instead. `monitor_id` uuid  · nullable `position` integer `public_name` string `section_id` uuid `widget_type` string `active_incident_ids` uuid[] `feed_component_id` string `feed_component_name` string `feed_format` string one of`statuspage_v2` `instatus` `feed_url` string `freshness_timeout_seconds` integer `history` PublicStatusHistory PublicStatusHistory · 12 fields FieldTypeDescription `covered` boolean `days` integer `ends_at` string (date-time) `segments` PublicStatusHistoryDay[]  · nullable Each item · 4 fields FieldTypeDescription `covered` boolean `date` string `status` string one of`up` `degraded` `down` `no_data` `uptime_percentage` number `starts_at` string (date-time) `uptime_by_range` map of number `uptime_percentage` number `watching_since` string (date-time) `is_external` boolean `last_checked_at` string (date-time) `manual_status` string one of`operational` `degraded` `down` `maintenance` `monitor_state` string one of`UP` `DOWN` `PAUSED` `response_times` PublicResponseTimeHistory PublicResponseTimeHistory · 5 fields FieldTypeDescription `days` PublicResponseTimeDay[]  · nullable Each item · 3 fields FieldTypeDescription `avg_ms` number `date` string `p95_ms` number `current_avg_ms` number `runtime_status` string Current status of the component, derived from its monitor, scheduled job, manual status or vendor feed. `source` StatusPageResourceSource StatusPageResourceSource · 3 fields FieldTypeDescription `checked_at` string (date-time)  · nullable `name` string `url` string `status_page_id` uuid `auto_group_id` uuid | | |
| `pagination` | Pagination | |
| Pagination · 5 fields FieldTypeDescription `cursor` string  · nullable `has_more` boolean `limit` integer 1–250 `next_cursor` string  · nullable `prev_cursor` string  · nullable | | |

## Errors

Only the errors this operation can return. Every error uses the [same envelope](https://upfour.io/docs/api/responses.md).

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | [bad_request](https://upfour.io/docs/api/errors#code-bad_request) | The request is malformed or fails validation. |
| 402 | [billing_action_unavailable](https://upfour.io/docs/api/errors#code-billing_action_unavailable) | The Company's billing state does not allow this action. **When:** A metered or limited action while the billing state, such as paused or without credit, blocks it; details holds the action and billing_state. **Fix:** Top up the credit or change the plan, then retry. |
| 404 | [not_found](https://upfour.io/docs/api/errors#code-not_found) | The requested resource does not exist or is outside the caller's scope. |
| 403 | [permission_denied](https://upfour.io/docs/api/errors#code-permission_denied) | The credentials do not permit this action. |
| 503 | [quota_gate_unavailable](https://upfour.io/docs/api/errors#code-quota_gate_unavailable) | The limit check itself failed, so the action was not carried out. **When:** The quota service could not decide while the request ran. **Fix:** Retry in a moment; nothing was changed. |
| 403 / 429 | [quota_limit_reached](https://upfour.io/docs/api/errors#code-quota_limit_reached) | A usage or inventory limit of the Company was reached. **When:** Counters and concurrency limits answer 429 with Retry-After, inventory and capacity limits answer 403; details holds purpose, limit and window. **Fix:** On 429 wait Retry-After seconds; on 403 free something up, request a higher limit where details.raise_request is true, or buy an extension. `quota_limit_reached` (window `total`): the Company already holds the most of these it may have. `error.details` carries `purpose` and `limit`; remove one or ask support for a higher limit. |

Every call can also return `unauthorized` (401), `rate_limit_exceeded` (429) or `internal_error` (500 / 502). See [Responses and errors](https://upfour.io/docs/api/responses.md).

[PreviousGet status page structure](https://upfour.io/docs/api/status-pages/get-status-page-structure.md) [NextList status page subscribers](https://upfour.io/docs/api/status-pages/list-status-page-subscribers.md)

## Request

### cURL

```bash
curl -s -X PUT "https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/structure" \
  -H "Authorization: Bearer $UP4_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sections": [
      {
        "name": "Website and checkout",
        "resources": [
          {
            "monitor_id": "00000000-0000-4000-8000-000000000002",
            "public_name": "Marketing website"
          }
        ]
      }
    ]
  }'
```

### JavaScript

```javascript
const res = await fetch("https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/structure", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.UP4_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    sections: [
      {
        name: "Website and checkout",
        resources: [
          {
            monitor_id: "00000000-0000-4000-8000-000000000002",
            public_name: "Marketing website",
          },
        ],
      },
    ],
  }),
});
console.log(res.status, await res.json());
```

### Python

```python
import os
import requests

res = requests.put(
    "https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/structure",
    headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
    json={
        "sections": [
            {
                "name": "Website and checkout",
                "resources": [
                    {
                        "monitor_id": "00000000-0000-4000-8000-000000000002",
                        "public_name": "Marketing website",
                    },
                ],
            },
        ],
    },
)
print(res.status_code, res.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	payload := strings.NewReader(`{
  "sections": [
    {
      "name": "Website and checkout",
      "resources": [
        {
          "monitor_id": "00000000-0000-4000-8000-000000000002",
          "public_name": "Marketing website"
        }
      ]
    }
  ]
}`)
	req, _ := http.NewRequest("PUT", "https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/structure", payload)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.StatusCode, string(out))
}
```

### PHP

```php
<?php
$payload = <<<'JSON'
{
  "sections": [
    {
      "name": "Website and checkout",
      "resources": [
        {
          "monitor_id": "00000000-0000-4000-8000-000000000002",
          "public_name": "Marketing website"
        }
      ]
    }
  ]
}
JSON;

$ch = curl_init("https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/structure");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("UP4_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
```

## Response

### 200

```json
{
  "data": [
    {
      "auto_source": "none",
      "auto_widget_type": "history",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000003",
      "name": "Website and checkout",
      "position": 0,
      "resources": [
        {
          "auto_publish": true,
          "explanation": "",
          "heartbeat_id": null,
          "id": "00000000-0000-4000-8000-000000000004",
          "mark_degraded_for": "",
          "mark_down_for": "",
          "monitor_id": "00000000-0000-4000-8000-000000000002",
          "position": 0,
          "public_name": "Marketing website",
          "section_id": "00000000-0000-4000-8000-000000000003",
          "widget_type": ""
        }
      ],
      "status_page_id": "00000000-0000-4000-8000-000000000001"
    }
  ],
  "pagination": {
    "cursor": null,
    "has_more": false,
    "limit": 50,
    "next_cursor": null,
    "prev_cursor": null
  }
}
```

### 400

```json
{
  "error": {
    "code": "bad_request",
    "message": "The request is malformed or fails validation.",
    "request_id": "req_…"
  }
}
```

### 402

```json
{
  "error": {
    "code": "billing_action_unavailable",
    "message": "The Company's billing state does not allow this action.",
    "request_id": "req_…"
  }
}
```

### 403

```json
{
  "error": {
    "code": "permission_denied",
    "message": "The credentials do not permit this action.",
    "request_id": "req_…"
  }
}
```

### 404

```json
{
  "error": {
    "code": "not_found",
    "message": "The requested resource does not exist or is outside the caller's scope.",
    "request_id": "req_…"
  }
}
```

### 429

```json
{
  "error": {
    "code": "quota_limit_reached",
    "message": "A usage or inventory limit of the Company was reached.",
    "request_id": "req_…"
  }
}
```

### 503

```json
{
  "error": {
    "code": "quota_gate_unavailable",
    "message": "The limit check itself failed, so the action was not carried out.",
    "request_id": "req_…"
  }
}
```
