export const metadata = {
  title: "Status Page Components - OnlineOrNot API Documentation",
  description:
    "Add and manage individual service components displayed on status pages",
}

## Create a component   {{ tag: 'POST', label: '/v1/status_pages/{status_page_id}/components' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Website","description":"a name for the component"},"status":{"type":"string","enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"default":"OPERATIONAL","example":"MAJOR_OUTAGE","description":"Status of the component"},"display_uptime":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"display_metrics":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."}},"required":["name"]},"name":"body","required":true,"exampleValues":{"object":{"name":"Website","status":"MAJOR_OUTAGE","display_uptime":true,"display_metrics":true},"json":"{\n  \"name\": \"Website\",\n  \"status\": \"MAJOR_OUTAGE\",\n  \"display_uptime\": true,\n  \"display_metrics\": true\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","minLength":1,"example":"Website","description":"a name for the component"},"name":"» name","required":true,"description":"a name for the component","safeType":"string","depth":1,"exampleValues":{"object":"Website","json":"'Website'"},"shortDesc":"a name for the component"},{"in":"body","schema":{"type":"string","enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"default":"OPERATIONAL","example":"MAJOR_OUTAGE","description":"Status of the component"},"name":"» status","required":false,"description":"Status of the component","safeType":"string","depth":1,"exampleValues":{"object":"MAJOR_OUTAGE","json":"'MAJOR_OUTAGE'"},"shortDesc":"Status of the component"},{"in":"body","schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"name":"» display_uptime","required":false,"description":"Show this component's uptime and historical incidents on the status page.","safeType":"boolean","depth":1,"exampleValues":{"object":true,"json":"'true'"},"shortDesc":"Show this component's uptime and historical incidents on the status page."},{"in":"body","schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"name":"» display_metrics","required":false,"description":"Show this component's response time metrics on the status page.","safeType":"boolean","depth":1,"exampleValues":{"object":true,"json":"'true'"},"shortDesc":"Show this component's response time metrics on the status page."}]} title="Body parameters" />

<h3 id="post__v1_status_pages_{status_page_id}_components-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Returns the newly created status page component|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"201","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"name":{"type":"string","example":"Website","description":"a name for the component"},"status":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"display_uptime":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"display_metrics":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"group_id":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"is_external_component":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"}},"required":["id","name","status","display_uptime","display_metrics","created_at","updated_at","group_id"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"in":"body","name":"id","depth":2,"description":"Status Page Component ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","example":"Website","description":"a name for the component"},"in":"body","name":"name","depth":2,"description":"a name for the component","type":"string","safeType":"string","required":true,"displayName":"»» name"},{"schema":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"in":"body","name":"status","depth":2,"description":"Status of the component","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» status"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"in":"body","name":"display_uptime","depth":2,"description":"Show this component's uptime and historical incidents on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_uptime"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"in":"body","name":"display_metrics","depth":2,"description":"Show this component's response time metrics on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_metrics"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"in":"body","name":"created_at","depth":2,"description":"When the component was created","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"in":"body","name":"updated_at","depth":2,"description":"When the component was last updated","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"in":"body","name":"group_id","depth":2,"description":"Status Page Group ID","type":"string","safeType":"string","required":true,"displayName":"»» group_id"},{"schema":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"},"in":"body","name":"is_external_component","depth":2,"description":"Whether this component is synced from an external status page","type":"boolean","safeType":"boolean","required":false,"displayName":"»» is_external_component"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="POST" label="/v1/status_pages/{status_page_id}/components">
```bash {{ title: 'cURL' }}
curl --request POST \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Website","status":"MAJOR_OUTAGE","display_uptime":true,"display_metrics":true}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"name\":\"Website\",\"status\":\"MAJOR_OUTAGE\",\"display_uptime\":true,\"display_metrics\":true}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"Website\",\"status\":\"MAJOR_OUTAGE\",\"display_uptime\":true,\"display_metrics\":true}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"name":"Website","status":"MAJOR_OUTAGE","display_uptime":true,"display_metrics":true}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"name\":\"Website\",\"status\":\"MAJOR_OUTAGE\",\"display_uptime\":true,\"display_metrics\":true}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components"

payload = {
    "name": "Website",
    "status": "MAJOR_OUTAGE",
    "display_uptime": True,
    "display_metrics": True
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "name": "Website",
    "status": "MAJOR_OUTAGE",
    "display_uptime": true,
    "display_metrics": true,
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-02-01T00:00:00.000Z",
    "group_id": "a1b2c3d4",
    "is_external_component": false
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## List all components   {{ tag: 'GET', label: '/v1/status_pages/{status_page_id}/components' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"schema":{"type":"string","default":"1","example":1,"description":"Page number of paginated results."},"required":false,"description":"Page number of paginated results.","name":"page","in":"query","exampleValues":{"object":1,"json":"'1'"},"originalType":"string","safeType":"string","shortDesc":"Page number of paginated results.","style":"form"},{"schema":{"type":"string","default":"20","example":20,"description":"Number of items per page."},"required":false,"description":"Number of items per page.","name":"per_page","in":"query","exampleValues":{"object":20,"json":"'20'"},"originalType":"string","safeType":"string","shortDesc":"Number of items per page.","style":"form"},{"schema":{"type":"string","example":"example","description":"Search term to filter results."},"required":false,"description":"Search term to filter results.","name":"search","in":"query","exampleValues":{"object":"example","json":"'example'"},"originalType":"string","safeType":"string","shortDesc":"Search term to filter results.","style":"form"}]} title="Query parameters" />

<h3 id="get__v1_status_pages_{status_page_id}_components-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns a list of components for a status page|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"name":{"type":"string","example":"Website","description":"a name for the component"},"status":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"display_uptime":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"display_metrics":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"group_id":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"is_external_component":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"}},"required":["id","name","status","display_uptime","display_metrics","created_at","updated_at","group_id"]}},"in":"body","name":"result","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"in":"body","name":"id","depth":2,"description":"Status Page Component ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","example":"Website","description":"a name for the component"},"in":"body","name":"name","depth":2,"description":"a name for the component","type":"string","safeType":"string","required":true,"displayName":"»» name"},{"schema":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"in":"body","name":"status","depth":2,"description":"Status of the component","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» status"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"in":"body","name":"display_uptime","depth":2,"description":"Show this component's uptime and historical incidents on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_uptime"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"in":"body","name":"display_metrics","depth":2,"description":"Show this component's response time metrics on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_metrics"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"in":"body","name":"created_at","depth":2,"description":"When the component was created","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"in":"body","name":"updated_at","depth":2,"description":"When the component was last updated","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"in":"body","name":"group_id","depth":2,"description":"Status Page Group ID","type":"string","safeType":"string","required":true,"displayName":"»» group_id"},{"schema":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"},"in":"body","name":"is_external_component","depth":2,"description":"Whether this component is synced from an external status page","type":"boolean","safeType":"boolean","required":false,"displayName":"»» is_external_component"},{"schema":{"type":"object","properties":{"page":{"type":"number","default":1,"example":1,"description":"Page number of paginated results."},"per_page":{"type":"number","default":20,"example":20,"description":"Number of items per page."},"count":{"type":"number","example":1,"description":"Number of items on the current page."},"total_count":{"type":"number","example":1,"description":"Total number of items."}},"required":["count","total_count"]},"in":"body","name":"result_info","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result_info"},{"schema":{"type":"number","default":1,"example":1,"description":"Page number of paginated results."},"in":"body","name":"page","depth":2,"description":"Page number of paginated results.","type":"number","safeType":"number","required":false,"displayName":"»» page"},{"schema":{"type":"number","default":20,"example":20,"description":"Number of items per page."},"in":"body","name":"per_page","depth":2,"description":"Number of items per page.","type":"number","safeType":"number","required":false,"displayName":"»» per_page"},{"schema":{"type":"number","example":1,"description":"Number of items on the current page."},"in":"body","name":"count","depth":2,"description":"Number of items on the current page.","type":"number","safeType":"number","required":true,"displayName":"»» count"},{"schema":{"type":"number","example":1,"description":"Total number of items."},"in":"body","name":"total_count","depth":2,"description":"Total number of items.","type":"number","safeType":"number","required":true,"displayName":"»» total_count"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/v1/status_pages/{status_page_id}/components">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components", {
  "method": "GET",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": [
    {
      "id": "a1b2c3d4",
      "name": "Website",
      "status": "MAJOR_OUTAGE",
      "display_uptime": true,
      "display_metrics": true,
      "created_at": "2021-01-01T00:00:00.000Z",
      "updated_at": "2021-02-01T00:00:00.000Z",
      "group_id": "a1b2c3d4",
      "is_external_component": false
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Retrieve a component   {{ tag: 'GET', label: '/v1/status_pages/{status_page_id}/components/{status_page_component_id}' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"},{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page Component ID"},"required":true,"description":"Status Page Component ID","name":"status_page_component_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page Component ID","style":"simple"}]} title="Path parameters" />

<h3 id="get__v1_status_pages_{status_page_id}_components_{status_page_component_id}-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns a status page component|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"name":{"type":"string","example":"Website","description":"a name for the component"},"status":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"display_uptime":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"display_metrics":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"group_id":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"is_external_component":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"}},"required":["id","name","status","display_uptime","display_metrics","created_at","updated_at","group_id"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"in":"body","name":"id","depth":2,"description":"Status Page Component ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","example":"Website","description":"a name for the component"},"in":"body","name":"name","depth":2,"description":"a name for the component","type":"string","safeType":"string","required":true,"displayName":"»» name"},{"schema":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"in":"body","name":"status","depth":2,"description":"Status of the component","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» status"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"in":"body","name":"display_uptime","depth":2,"description":"Show this component's uptime and historical incidents on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_uptime"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"in":"body","name":"display_metrics","depth":2,"description":"Show this component's response time metrics on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_metrics"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"in":"body","name":"created_at","depth":2,"description":"When the component was created","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"in":"body","name":"updated_at","depth":2,"description":"When the component was last updated","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"in":"body","name":"group_id","depth":2,"description":"Status Page Group ID","type":"string","safeType":"string","required":true,"displayName":"»» group_id"},{"schema":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"},"in":"body","name":"is_external_component","depth":2,"description":"Whether this component is synced from an external status page","type":"boolean","safeType":"boolean","required":false,"displayName":"»» is_external_component"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/v1/status_pages/{status_page_id}/components/{status_page_component_id}">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4", {
  "method": "GET",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "name": "Website",
    "status": "MAJOR_OUTAGE",
    "display_uptime": true,
    "display_metrics": true,
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-02-01T00:00:00.000Z",
    "group_id": "a1b2c3d4",
    "is_external_component": false
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Update a component   {{ tag: 'PATCH', label: '/v1/status_pages/{status_page_id}/components/{status_page_component_id}' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"},{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page Component ID"},"required":true,"description":"Status Page Component ID","name":"status_page_component_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page Component ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Website","description":"a name for the component"},"status":{"type":"string","enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"display_uptime":{"type":"boolean","example":true,"description":"Show this component's uptime and historical incidents on the status page."},"display_metrics":{"type":"boolean","example":true,"description":"Show this component's response time metrics on the status page."},"group_id":{"type":["string","null"],"example":"a1b2c3d4","description":"Component group ID to associate this component with. Set to null to remove from group."},"check_ids":{"type":"array","items":{"type":"string"},"example":["abc123","def456"],"description":"Array of uptime check IDs to associate with this component"},"heartbeat_id":{"type":["string","null"],"example":"hb123456","description":"Heartbeat ID to associate with this component. Set to null to remove."},"override_status":{"type":"boolean","example":false,"description":"Override the automatic status from external status page. When true, status can be manually set."}}},"name":"body","required":true,"exampleValues":{"object":{"name":"Website","status":"MAJOR_OUTAGE","display_uptime":true,"display_metrics":true,"group_id":"a1b2c3d4","check_ids":["abc123","def456"],"heartbeat_id":"hb123456","override_status":false},"json":"{\n  \"name\": \"Website\",\n  \"status\": \"MAJOR_OUTAGE\",\n  \"display_uptime\": true,\n  \"display_metrics\": true,\n  \"group_id\": \"a1b2c3d4\",\n  \"check_ids\": [\n    \"abc123\",\n    \"def456\"\n  ],\n  \"heartbeat_id\": \"hb123456\",\n  \"override_status\": false\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","minLength":1,"example":"Website","description":"a name for the component"},"name":"» name","required":false,"description":"a name for the component","safeType":"string","depth":1,"exampleValues":{"object":"Website","json":"'Website'"},"shortDesc":"a name for the component"},{"in":"body","schema":{"type":"string","enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"name":"» status","required":false,"description":"Status of the component","safeType":"string","depth":1,"exampleValues":{"object":"MAJOR_OUTAGE","json":"'MAJOR_OUTAGE'"},"shortDesc":"Status of the component"},{"in":"body","schema":{"type":"boolean","example":true,"description":"Show this component's uptime and historical incidents on the status page."},"name":"» display_uptime","required":false,"description":"Show this component's uptime and historical incidents on the status page.","safeType":"boolean","depth":1,"exampleValues":{"object":true,"json":"'true'"},"shortDesc":"Show this component's uptime and historical incidents on the status page."},{"in":"body","schema":{"type":"boolean","example":true,"description":"Show this component's response time metrics on the status page."},"name":"» display_metrics","required":false,"description":"Show this component's response time metrics on the status page.","safeType":"boolean","depth":1,"exampleValues":{"object":true,"json":"'true'"},"shortDesc":"Show this component's response time metrics on the status page."},{"in":"body","schema":{"type":["string","null"],"example":"a1b2c3d4","description":"Component group ID to associate this component with. Set to null to remove from group."},"name":"» group_id","required":false,"description":"Component group ID to associate this component with. Set to null to remove from group.","safeType":["string","null"],"depth":1,"exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"shortDesc":"Component group ID to associate this component with. Set to null to remove from group."},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["abc123","def456"],"description":"Array of uptime check IDs to associate with this component"},"name":"» check_ids","required":false,"description":"Array of uptime check IDs to associate with this component","safeType":"string[]","depth":1,"exampleValues":{"object":["abc123","def456"],"json":"[\n  \"abc123\",\n  \"def456\"\n]"},"shortDesc":"Array of uptime check IDs to associate with this component"},{"in":"body","schema":{"type":["string","null"],"example":"hb123456","description":"Heartbeat ID to associate with this component. Set to null to remove."},"name":"» heartbeat_id","required":false,"description":"Heartbeat ID to associate with this component. Set to null to remove.","safeType":["string","null"],"depth":1,"exampleValues":{"object":"hb123456","json":"'hb123456'"},"shortDesc":"Heartbeat ID to associate with this component. Set to null to remove."},{"in":"body","schema":{"type":"boolean","example":false,"description":"Override the automatic status from external status page. When true, status can be manually set."},"name":"» override_status","required":false,"description":"Override the automatic status from external status page. When true, status can be manually set.","safeType":"boolean","depth":1,"exampleValues":{"object":false,"json":"'false'"},"shortDesc":"Override the automatic status from external status page. When true, status can be manually set."}]} title="Body parameters" />

<h3 id="patch__v1_status_pages_{status_page_id}_components_{status_page_component_id}-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the updated status page component|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"name":{"type":"string","example":"Website","description":"a name for the component"},"status":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"display_uptime":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"display_metrics":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"created_at":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"updated_at":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"group_id":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"is_external_component":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"}},"required":["id","name","status","display_uptime","display_metrics","created_at","updated_at","group_id"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"in":"body","name":"id","depth":2,"description":"Status Page Component ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","example":"Website","description":"a name for the component"},"in":"body","name":"name","depth":2,"description":"a name for the component","type":"string","safeType":"string","required":true,"displayName":"»» name"},{"schema":{"type":["string","null"],"enum":["OPERATIONAL","MAJOR_OUTAGE","PARTIAL_OUTAGE","DEGRADED_PERFORMANCE","NO_IMPACT","MAINTENANCE"],"example":"MAJOR_OUTAGE","description":"Status of the component"},"in":"body","name":"status","depth":2,"description":"Status of the component","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» status"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's uptime and historical incidents on the status page."},"in":"body","name":"display_uptime","depth":2,"description":"Show this component's uptime and historical incidents on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_uptime"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Show this component's response time metrics on the status page."},"in":"body","name":"display_metrics","depth":2,"description":"Show this component's response time metrics on the status page.","type":"boolean","safeType":"boolean","required":true,"displayName":"»» display_metrics"},{"schema":{"type":"string","example":"2021-01-01T00:00:00.000Z","description":"When the component was created"},"in":"body","name":"created_at","depth":2,"description":"When the component was created","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2021-02-01T00:00:00.000Z","description":"When the component was last updated"},"in":"body","name":"updated_at","depth":2,"description":"When the component was last updated","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Group ID"},"in":"body","name":"group_id","depth":2,"description":"Status Page Group ID","type":"string","safeType":"string","required":true,"displayName":"»» group_id"},{"schema":{"type":"boolean","example":false,"description":"Whether this component is synced from an external status page"},"in":"body","name":"is_external_component","depth":2,"description":"Whether this component is synced from an external status page","type":"boolean","safeType":"boolean","required":false,"displayName":"»» is_external_component"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="PATCH" label="/v1/status_pages/{status_page_id}/components/{status_page_component_id}">
```bash {{ title: 'cURL' }}
curl --request PATCH \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Website","status":"MAJOR_OUTAGE","display_uptime":true,"display_metrics":true,"group_id":"a1b2c3d4","check_ids":["abc123","def456"],"heartbeat_id":"hb123456","override_status":false}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4", {
  "method": "PATCH",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"name\":\"Website\",\"status\":\"MAJOR_OUTAGE\",\"display_uptime\":true,\"display_metrics\":true,\"group_id\":\"a1b2c3d4\",\"check_ids\":[\"abc123\",\"def456\"],\"heartbeat_id\":\"hb123456\",\"override_status\":false}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"Website\",\"status\":\"MAJOR_OUTAGE\",\"display_uptime\":true,\"display_metrics\":true,\"group_id\":\"a1b2c3d4\",\"check_ids\":[\"abc123\",\"def456\"],\"heartbeat_id\":\"hb123456\",\"override_status\":false}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4")
  .patch(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

HttpRequest::methodRegister('PATCH');
$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"name":"Website","status":"MAJOR_OUTAGE","display_uptime":true,"display_metrics":true,"group_id":"a1b2c3d4","check_ids":["abc123","def456"],"heartbeat_id":"hb123456","override_status":false}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"name\":\"Website\",\"status\":\"MAJOR_OUTAGE\",\"display_uptime\":true,\"display_metrics\":true,\"group_id\":\"a1b2c3d4\",\"check_ids\":[\"abc123\",\"def456\"],\"heartbeat_id\":\"hb123456\",\"override_status\":false}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4"

payload = {
    "name": "Website",
    "status": "MAJOR_OUTAGE",
    "display_uptime": True,
    "display_metrics": True,
    "group_id": "a1b2c3d4",
    "check_ids": ["abc123", "def456"],
    "heartbeat_id": "hb123456",
    "override_status": False
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("PATCH", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "name": "Website",
    "status": "MAJOR_OUTAGE",
    "display_uptime": true,
    "display_metrics": true,
    "created_at": "2021-01-01T00:00:00.000Z",
    "updated_at": "2021-02-01T00:00:00.000Z",
    "group_id": "a1b2c3d4",
    "is_external_component": false
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Delete a component   {{ tag: 'DELETE', label: '/v1/status_pages/{status_page_id}/components/{status_page_component_id}' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"},{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page Component ID"},"required":true,"description":"Status Page Component ID","name":"status_page_component_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page Component ID","style":"simple"}]} title="Path parameters" />

<h3 id="delete__v1_status_pages_{status_page_id}_components_{status_page_component_id}-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the deleted component's ID|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"}},"required":["id"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Status Page Component ID"},"in":"body","name":"id","depth":2,"description":"Status Page Component ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="DELETE" label="/v1/status_pages/{status_page_id}/components/{status_page_component_id}">
```bash {{ title: 'cURL' }}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4", {
  "method": "DELETE",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4")
  .delete(null)
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/a1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4"
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Update the sort order of ungrouped components   {{ tag: 'PUT', label: '/v1/status_pages/{status_page_id}/components/sort-order' }}
<Row>
<Col>

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Status Page ID"},"required":true,"description":"Status Page ID","name":"status_page_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Status Page ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"component_ids":{"type":"array","items":{"type":"string"},"example":["a1b2c3d4","e5f6g7h8"],"description":"Ordered list of ungrouped component IDs"}},"required":["component_ids"]},"name":"body","required":true,"exampleValues":{"object":{"component_ids":["a1b2c3d4","e5f6g7h8"]},"json":"{\n  \"component_ids\": [\n    \"a1b2c3d4\",\n    \"e5f6g7h8\"\n  ]\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["a1b2c3d4","e5f6g7h8"],"description":"Ordered list of ungrouped component IDs"},"name":"» component_ids","required":true,"description":"Ordered list of ungrouped component IDs","safeType":"string[]","depth":1,"exampleValues":{"object":["a1b2c3d4","e5f6g7h8"],"json":"[\n  \"a1b2c3d4\",\n  \"e5f6g7h8\"\n]"},"shortDesc":"Ordered list of ungrouped component IDs"}]} title="Body parameters" />

<h3 id="put__v1_status_pages_{status_page_id}_components_sort-order-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Sort order updated successfully|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Sort order updated successfully","description":"Success message"}},"required":["message"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"Sort order updated successfully","description":"Success message"},"in":"body","name":"message","depth":2,"description":"Success message","type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="PUT" label="/v1/status_pages/{status_page_id}/components/sort-order">
```bash {{ title: 'cURL' }}
curl --request PUT \
  --url https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/sort-order \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"component_ids":["a1b2c3d4","e5f6g7h8"]}'
```

```javascript
fetch("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/sort-order", {
  "method": "PUT",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"component_ids\":[\"a1b2c3d4\",\"e5f6g7h8\"]}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"component_ids\":[\"a1b2c3d4\",\"e5f6g7h8\"]}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/sort-order")
  .put(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/sort-order');
$request->setMethod(HTTP_METH_PUT);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"component_ids":["a1b2c3d4","e5f6g7h8"]}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/sort-order")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"component_ids\":[\"a1b2c3d4\",\"e5f6g7h8\"]}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/status_pages/a1b2c3d4/components/sort-order"

payload = {"component_ids": ["a1b2c3d4", "e5f6g7h8"]}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("PUT", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "message": "Sort order updated successfully"
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

