# Components

## 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"}],"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 API key. You can find this in your Spike dashboard under Settings > API."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"}}}}},"paths":{"/api/status-page/{status_page_id}/component":{"get":{"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":"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"}}}},"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"}],"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 API key. You can find this in your Spike dashboard under Settings > API."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"}}}}},"paths":{"/api/status-page/{status_page_id}/component/{component_id}":{"get":{"summary":"Get a component","description":"Get Details of a status page component","tags":["Components"],"parameters":[{"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"}}}},"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"}],"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 API key. You can find this in your Spike dashboard under Settings > API."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"}}}}},"paths":{"/api/status-page/{status_page_id}/component/create":{"post":{"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":"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"}}}},"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"}],"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 API key. You can find this in your Spike dashboard under Settings > API."}},"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message describing the problem"},"error":{"type":"string","description":"Error type or code"}}}}},"paths":{"/api/status-page/{status_page_id}/component/{component_id}/update":{"post":{"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":"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"}}}},"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"}}}}}}}}}
````


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spike.sh/spike-api-docs/components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
