---
title: "Add a component"
method: POST
path: "/status-pages/{statusPage}/components"
tags: ["Status page components"]
---

# Add a component

`POST /status-pages/{statusPage}/components`

## Request

- Base URL: `https://api.spectate.net/v1`
- URL: `https://api.spectate.net/v1/status-pages/{statusPage}/components`
- Auth: HTTP bearer

The component starts operational and goes last in its group unless you give a
`position`. Without a group it goes last in the last ungrouped section, and the components
after that section move down by one position. `monitor_id` must be a monitor of the team
(`422` otherwise).

## Path parameters

- `statusPage` string, uuid, required

## Request body

- CreateStatusPageComponent: A new component of a status page. Its status follows incidents and maintenance.
  - `name` string, required: Name shown on the page
  - `description` string, nullable: Text shown with the name; `null` for none
  - `group` string, nullable: Group to show the component in; `null` for no group
  - `position` integer: Order on the whole page, lowest first, from 0 to 32767. New components go last in their section when left out
  - `monitor_id` string, uuid, nullable: A monitor of the team whose uptime history and response times the component shows, and whose downtime opens an incident when monitor automation is on; `null` for none
  - `show_latency_chart` boolean: Show the monitor's response time chart under the component

## Response `201`

The new component.

- StatusPageComponent: A component of a status page: a part of your service visitors see the status of, optionally following a monitor.
  - `id` string, uuid, required: Component ID
  - `name` string, required: Name shown on the page
  - `description` string, nullable, required: Text shown with the name; `null` for none
  - `group` string, nullable, required: Group the component is shown in; `null` for no group
  - `position` integer, required: Order on the whole page, lowest first. A named group shows once, where its first component falls
  - `status` 'operational' | 'degraded_performance' | 'partial_outage' | 'major_outage' | 'under_maintenance', required: A status page component's status, derived from incidents and maintenance. | | |---| | `operational` <br/> Working normally. | | `degraded_performance` <br/> Slower or less reliable than usual. | | `partial_outage` <br/> Down for some visitors or some functions. | | `major_outage` <br/> Down. | | `under_maintenance` <br/> In planned maintenance. |
  - `monitor` MonitorReference, required: A monitor something follows.
    - `id` string, uuid, required: Monitor ID
    - `label` string, required: Monitor name
  - `show_latency_chart` boolean, required: Whether the page shows the monitor's response time chart under the component
  - `created_at` string, date-time, required: When the component was created

## Other responses

- `401`: `UNAUTHENTICATED`: no token was sent. `INVALID_TOKEN`: the token is unknown or revoked. `TOKEN_EXPIRED`: the token has expired.
- `403`: `FORBIDDEN`: the token lacks an ability this endpoint requires (listed in `details.required_abilities`). `TEAM_PENDING_DELETION`: the team is scheduled for deletion. `TEAM_SUSPENDED`: Spectate suspended the team.
- `404`: `RESOURCE_NOT_FOUND`: there is no such resource in this team.
- `422`: `VALIDATION_FAILED`: the request is invalid; `details.errors` lists the fields.
- `429`: `RATE_LIMITED`: too many requests for this token. Wait for the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/spectate/apis/spectate-api.md) - [All operations](https://skmtc.dev/spectate/apis/spectate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spectate/apis/spectate-api/revisions/9b1a233997de?raw)
