> For the complete documentation index, see [llms.txt](https://docs.spike.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.spike.sh/spike-api-docs/components.md).

# Components

Create, read and update the components shown on a status page.

## Get all components in a status page

> Gets a list of all the components linked to a status page

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Components","description":"Create, read and update the components shown on a status page."}],"servers":[{"url":"https://statuspage.spike.sh","description":"Status page server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your organisation's API key. Create one in the Spike dashboard under Settings > API. Sent on every request as the `x-api-key` header."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"},"success":{"type":"boolean","description":"Present on the endpoints whose handlers include it (for example the API-key filter and the public on-call routes). Always `false` on an error."},"valid_api":{"type":"boolean","description":"Present on `401`s produced by the session/API-key filter. `false` means the supplied `x-api-key` was not recognised."},"statusCode":{"type":"number","description":"Echo of the HTTP status, present on a few permission errors."}}}}},"paths":{"/api/status-page/{status_page_id}/component":{"get":{"operationId":"getApiStatusPageByStatusPageIdComponent","summary":"Get all components in a status page","description":"Gets a list of all the components linked to a status page","tags":["Components"],"parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string"},"description":"Your API key. Find it in your Spike dashboard under Settings > API."},{"name":"status_page_id","in":"path","required":true,"schema":{"type":"string"},"description":"status_page_id parameter"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get a component

> Get Details of a status page component

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Components","description":"Create, read and update the components shown on a status page."}],"servers":[{"url":"https://statuspage.spike.sh","description":"Status page server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your organisation's API key. Create one in the Spike dashboard under Settings > API. Sent on every request as the `x-api-key` header."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"},"success":{"type":"boolean","description":"Present on the endpoints whose handlers include it (for example the API-key filter and the public on-call routes). Always `false` on an error."},"valid_api":{"type":"boolean","description":"Present on `401`s produced by the session/API-key filter. `false` means the supplied `x-api-key` was not recognised."},"statusCode":{"type":"number","description":"Echo of the HTTP status, present on a few permission errors."}}}}},"paths":{"/api/status-page/{status_page_id}/component/{component_id}":{"get":{"operationId":"getApiStatusPageByStatusPageIdComponentByComponentId","summary":"Get a component","description":"Get Details of a status page component","tags":["Components"],"parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string"},"description":"Your API key. Find it in your Spike dashboard under Settings > API."},{"name":"status_page_id","in":"path","required":true,"schema":{"type":"string"},"description":"status_page_id parameter"},{"name":"component_id","in":"path","required":true,"schema":{"type":"string"},"description":"component_id parameter"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create a component

> Create a new component for a status page\
> \
> \`\`\`\
> {\
> &#x9;"components": \[\
> &#x9;	{\
> &#x9;		"name": "title of the component",\
> &#x9;		"desc": "Description of hthe component",\
> &#x9;		"status": "degraded-performance",\
> &#x9;		"private": true\
> &#x9;	}\
> &#x9;]\
> }\
> \`\`\`\
> \
> You can create multiple components at once.\
> \
> \### Params:\
> \
> \`name\*\`: Title of the component.\
> \
> \`desc\*\`: Updated description\
> \
> \`status\`: Status of the component valid choices for status are \`operational\`, \`degraded-performance\`, \`partial-outage\`, \`critical-outage\` any other choice will not reflect on the status page\
> \
> \`private\`: You can choose to private or public the status page based on this flag\
> \
> \\\* Required<br>

````json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Components","description":"Create, read and update the components shown on a status page."}],"servers":[{"url":"https://statuspage.spike.sh","description":"Status page server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your organisation's API key. Create one in the Spike dashboard under Settings > API. Sent on every request as the `x-api-key` header."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"},"success":{"type":"boolean","description":"Present on the endpoints whose handlers include it (for example the API-key filter and the public on-call routes). Always `false` on an error."},"valid_api":{"type":"boolean","description":"Present on `401`s produced by the session/API-key filter. `false` means the supplied `x-api-key` was not recognised."},"statusCode":{"type":"number","description":"Echo of the HTTP status, present on a few permission errors."}}}}},"paths":{"/api/status-page/{status_page_id}/component/create":{"post":{"operationId":"postApiStatusPageByStatusPageIdComponentCreate","summary":"Create a component","description":"Create a new component for a status page\n\n```\n{\n\t\"components\": [\n\t\t{\n\t\t\t\"name\": \"title of the component\",\n\t\t\t\"desc\": \"Description of hthe component\",\n\t\t\t\"status\": \"degraded-performance\",\n\t\t\t\"private\": true\n\t\t}\n\t]\n}\n```\n\nYou can create multiple components at once.\n\n### Params:\n\n`name*`: Title of the component.\n\n`desc*`: Updated description\n\n`status`: Status of the component valid choices for status are `operational`, `degraded-performance`, `partial-outage`, `critical-outage` any other choice will not reflect on the status page\n\n`private`: You can choose to private or public the status page based on this flag\n\n\\* Required\n","tags":["Components"],"parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string"},"description":"Your API key. Find it in your Spike dashboard under Settings > API."},{"name":"status_page_id","in":"path","required":true,"schema":{"type":"string"},"description":"status_page_id parameter"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"components":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"desc":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
````

## Update a component

> Update a component. You can update name, description, status. you can also choose to private or public a status page.\
> \
> \`\`\`\
> {\
> &#x9;"name": "title of the component",\
> &#x9;"desc": "Description of hthe component",\
> &#x9;"status": "degraded-performance",\
> &#x9;"private": true\
> }\
> \`\`\`\
> \
> \### Params:\
> \
> \`name\`: Title of the component.\
> \
> \`desc\`: Updated description\
> \
> \`status\`: Status of the component valid choices for status are \`operational\`, \`degraded-performance\`, \`partial-outage\`, \`critical-outage\` any other choice will not reflect on the status page\
> \
> \`private\`: You can choose to private or public the status page based on this flag<br>

````json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Components","description":"Create, read and update the components shown on a status page."}],"servers":[{"url":"https://statuspage.spike.sh","description":"Status page server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your organisation's API key. Create one in the Spike dashboard under Settings > API. Sent on every request as the `x-api-key` header."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"},"success":{"type":"boolean","description":"Present on the endpoints whose handlers include it (for example the API-key filter and the public on-call routes). Always `false` on an error."},"valid_api":{"type":"boolean","description":"Present on `401`s produced by the session/API-key filter. `false` means the supplied `x-api-key` was not recognised."},"statusCode":{"type":"number","description":"Echo of the HTTP status, present on a few permission errors."}}}}},"paths":{"/api/status-page/{status_page_id}/component/{component_id}/update":{"post":{"operationId":"postApiStatusPageByStatusPageIdComponentByComponentIdUpdate","summary":"Update a component","description":"Update a component. You can update name, description, status. you can also choose to private or public a status page.\n\n```\n{\n\t\"name\": \"title of the component\",\n\t\"desc\": \"Description of hthe component\",\n\t\"status\": \"degraded-performance\",\n\t\"private\": true\n}\n```\n\n### Params:\n\n`name`: Title of the component.\n\n`desc`: Updated description\n\n`status`: Status of the component valid choices for status are `operational`, `degraded-performance`, `partial-outage`, `critical-outage` any other choice will not reflect on the status page\n\n`private`: You can choose to private or public the status page based on this flag\n","tags":["Components"],"parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string"},"description":"Your API key. Find it in your Spike dashboard under Settings > API."},{"name":"status_page_id","in":"path","required":true,"schema":{"type":"string"},"description":"status_page_id parameter"},{"name":"component_id","in":"path","required":true,"schema":{"type":"string"},"description":"component_id parameter"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"desc":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
````
