# Add a section resource — API reference

> Adds a monitor, Scheduled job, manual component or vendor feed to a section with display and status rules.

Source: https://upfour.io/docs/api/status-pages/add-a-section-resource

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

Adds a monitor, Scheduled job, manual component or vendor feed to a section with display and status rules.

POST https://app.upfour.io/v1/status-pages/{pageID}/sections/{sectionID}/resources

scope status_page.write stable [Idempotency-Key supported](https://upfour.io/docs/api/idempotency.md) returns 201

## Parameters

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

## Body

The 5 fields most calls use come first; the rest are grouped below.

`application/json` required 13 fields

public_namestring

monitor_iduuid · 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).

heartbeat_iduuid · nullable

feed_urlstring

Address of a vendor's status page (Atlassian Statuspage or Instatus); needs feed_component_id.

feed_component_idstring

Display4 fields

widget_typestring

How the component renders: history (daily bars, the default), plain, or response_times (monitors only). Not validated by the service.

explanationstring

positioninteger · nullable

Omitted appends the component at the end.

is_externalboolean

Shown for transparency but never counted into the page's own status or availability. Always true for a feed component.

Status rules4 fields

manual_statusstring

Only for a component with no monitor, scheduled job or feed. Empty derives the status.

""operationaldegradeddownmaintenance

mark_degraded_forstring

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_forstring

any_incident (the default) shows the component as down while an incident is open; any other value shows it as degraded instead.

auto_publishboolean · nullable

false keeps the automatic report for this component as an internal draft. Default true.

## Returns

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

Response fields 1 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | StatusPageResource | |
| StatusPageResource · 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 | | |

## 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).

[PreviousList section resources](https://upfour.io/docs/api/status-pages/list-section-resources.md) [NextDelete a section resource](https://upfour.io/docs/api/status-pages/delete-a-section-resource.md)

## Request

### cURL

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

### JavaScript

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

### Python

```python
import os
import requests

res = requests.post(
    "https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/sections/00000000-0000-4000-8000-000000000002/resources",
    headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
    json={
        "monitor_id": "00000000-0000-4000-8000-000000000003",
        "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(`{
  "monitor_id": "00000000-0000-4000-8000-000000000003",
  "public_name": "Marketing website"
}`)
	req, _ := http.NewRequest("POST", "https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/sections/00000000-0000-4000-8000-000000000002/resources", 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'
{
  "monitor_id": "00000000-0000-4000-8000-000000000003",
  "public_name": "Marketing website"
}
JSON;

$ch = curl_init("https://app.upfour.io/v1/status-pages/00000000-0000-4000-8000-000000000001/sections/00000000-0000-4000-8000-000000000002/resources");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    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

### 201

```json
{
  "data": {
    "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-000000000003",
    "position": 0,
    "public_name": "Marketing website",
    "section_id": "00000000-0000-4000-8000-000000000002",
    "widget_type": ""
  }
}
```

### 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_…"
  }
}
```
