# Components API Reference

Source: https://instatus.com/help/api/components

## Get all your status page components

**Endpoint:**

```bash
GET /v2/:page_id/components?page=:page&per_page=:per_page
```

- The default page number is 1.
- The default per_page number is 50 and the maximum is 100 items per page.

**Example response:**

```json
[
  {
    "id": "ckf01fvnxywz60a35wdbn5gz5",
    "name": "App",
    "status": "OPERATIONAL",
    "uniqueEmail": "nasa-app-1nozrueut@automation.instatus.com",
    "description": "",
    "showUptime": true,
    "order": 0,
    "group": null
  },
  {
    "id": "ckf01fvnxywz50a35nh1qzssm",
    "name": "Website",
    "status": "OPERATIONAL",
    "description": "",
    "showUptime": true,
    "order": 0,
    "group": null,
    "uniqueEmail": "nasa-website-1nozrueut@automation.instatus.com"
  }
]
```

## Get a component

**Endpoint:**

```bash
GET /v2/:page_id/components/:component_id
```

**Example response**

```json
{
  "id": "ckf01fvnxywz50a35nh1qzssm",
  "name": "Website",
  "description": "",
  "status": "OPERATIONAL",
  "uniqueEmail": "nasa-website-1nozrueut@automation.instatus.com",
  "showUptime": true,
  "order": 0,
  "group": null
}
```

## Create a component

**Endpoint:**

```bash
POST /v1/:page_id/components
```

**Example request:**

```json
{
  "name": "Test component",
  "description": "Testing",
  "status": "OPERATIONAL",
  "order": 6,
  "showUptime": true,
  "grouped": false,
  "archived": false,
  "translations": {
    "name": {
      "fr": "Composant de test"
    },
    "description": {
      "fr": "En test"
    }
  }
}
```

**Example response:**

```json
{
  "id": "ckf1d4f6a4aaf0a356vqg0rdm",
  "name": "Test component",
  "description": "Testing",
  "uniqueEmail": "nasa-test-component-oomaksikj@automation.instatus.com",
  "status": "OPERATIONAL",
  "showUptime": true,
  "order": 8,
  "group": null,
  "translations": {
    "name": {
      "fr": "Composant de test"
    },
    "description": {
      "fr": "En test"
    }
  }
}
```

If you'd like to add a component under a group, you may set `grouped` to `true` and `group` to your desired group's `ID`.

## Update a component

**Endpoint:**

```bash
PUT /v2/:page_id/components/:component_id
```

**Example request:**

```json
{
  "name": "Test component 4",
  "description": "Test test test",
  "status": "OPERATIONAL",
  "order": 6,
  "showUptime": true,
  "grouped": false,
  "archived": true,
  "translations": {
    "name": {
      "fr": "Composant de test 4"
    },
    "description": {
      "fr": "Test test test"
    }
  }
}
```

**Example response:**

```json
{
  "id": "ckf1d4f6a4aaf0a356vqg0rdm",
  "name": "Test component 4",
  "uniqueEmail": "nasa-test-component-oomaksikj@automation.instatus.com",
  "status": "OPERATIONAL",
  "description": "Test test test",
  "showUptime": true,
  "order": 6,
  "group": null,
  "translations": {
    "name": {
      "fr": "Composant de test 4"
    },
    "description": {
      "fr": "Test test test"
    }
  }
}
```
If you'd like to update a component's group, you may set `grouped` to `true` and `groupId` to your desired group's `ID`.

## Delete a component

**Endpoint:**

```bash
DELETE /v1/:page_id/components/:component_id
```

```json
{
  "id": "ckf1d4f6a4aaf0a356vqg0rdm"
}
```
