> 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/models.md).

# Models

## The StatusPageComponent object

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"components":{"schemas":{"StatusPageComponent":{"type":"object","description":"A component on a status page. Components can be nested one level deep: a top-level component may have nested components under it, and a nested component cannot itself have anything nested under it.","properties":{"_id":{"type":"string","description":"The component's id. Use it as the `parent` of a nested component."},"name":{"type":"string","description":"The component's name, as it appears on the status page."},"desc":{"type":"string","description":"Free-text description shown under the name."},"status":{"type":"string","enum":["operational","degraded-performance","partial-outage","critical-outage","planned-maintenance"],"description":"The component's own status. Any other value is stored but will not reflect on the status page."},"effectiveStatus":{"type":"string","enum":["operational","degraded-performance","partial-outage","critical-outage","planned-maintenance"],"description":"Read-only, computed. The status the status page actually shows for this component: for a top-level component with nested components it is the worst of its own `status` and its nested components' statuses; for everything else it equals `status`. Ranked, least to most severe: `operational`, `planned-maintenance`, `degraded-performance`, `partial-outage`, `critical-outage`."},"parent":{"type":["string","null"],"description":"The id of the component this one is nested under, or `null` when it is top-level. Send it on create or update to nest a component. The parent must already exist, belong to the same status page, and be top-level itself."},"order":{"type":"number","description":"Sort position among siblings — top-level components share one sequence, and each parent's nested components have their own. Rows are returned parent-first with each parent's nested components directly after it, both sorted by `order`."},"startDate":{"type":["string","null"],"description":"The date from which uptime is tracked for this component."},"statusPage":{"type":"string","description":"The id of the status page this component belongs to."}}}}}}
```

## The IncidentNote object

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"components":{"schemas":{"IncidentNote":{"type":"object","description":"A note on an incident — what responders write on the incident as they work it.","properties":{"_id":{"type":"string","description":"The note's id. Pin or archive the note by this id."},"content":{"type":["string","null"],"description":"The body of the note, exactly as it was sent. Markdown is stored and returned verbatim — the API never converts or sanitises it, so what renders it decides how it reads. `null` on an archived note, whose body is hidden from everyone but its author."},"isResolution":{"type":"boolean","description":"`true` when the note records what resolved the incident rather than a comment on it."},"archived":{"type":"boolean","description":"`true` when the note has been archived. Archiving is a reversible soft-hide, not a delete: the note stays visible to its author, who can restore it from the dashboard, and everyone else sees an audit line in its place."},"author":{"type":["object","null"],"description":"Who wrote the note, named the way every Spike surface names an actor. A note written through this API carries the API key that wrote it; a note a person wrote in the dashboard, Slack or the mobile app carries that user.","properties":{"type":{"type":"string","enum":["api-key","user"],"description":"Whether an API key or a person wrote the note."},"_id":{"type":"string","description":"The id of the API key or the user."},"name":{"type":"string","description":"How the author reads on an incident. A person's first name; an API key as `<key name> (API)`, for example `Internal key (API)`, so a note no human wrote never reads as though one did. A key with no name reads `Untitled (API)`."}}},"counterId":{"type":"string","description":"The `counterId` of the incident the note belongs to."},"incident":{"type":"string","description":"The `_id` of the incident the note belongs to."},"editedAt":{"type":["string","null"],"description":"When the note was last edited, or `null` if it never was. Only a note's own author may edit one, so a note written by an API key is never edited."},"createdAt":{"type":"string","description":"When the note was written."},"updatedAt":{"type":"string","description":"When the note last changed."}}}}}}
```

## The Error object

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"components":{"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."},"status":{"type":"boolean","description":"Present on the status-page component write endpoints, which answer a rejected write `{status: false, error, message}`. Always `false` on an error."}}}}}}
```
