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

# Integrations

Create, read and archive integrations. An integration is referenced by its `token`, never its `_id`.

## Create an integration

> Create a new integration for a team. You can find more details on \`/integrations/available\` route.\
> Learn more about integrations \[here]\(<https://docs.spike.sh/integrations-guideline/setup-integrations>).<br>

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Integrations","description":"Create, read and archive integrations. An integration is referenced by its `token`, never its `_id`."}],"servers":[{"url":"https://api.spike.sh","description":"API server"}],"security":[{"ApiKeyAuth":[],"TeamIdHeader":[]}],"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":{"/integrations/create":{"post":{"operationId":"postIntegrationsCreate","summary":"Create an integration","description":"Create a new integration for a team. You can find more details on `/integrations/available` route.\nLearn more about integrations [here](https://docs.spike.sh/integrations-guideline/setup-integrations).\n","tags":["Integrations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customName":{"type":"string"},"desc":{"type":"string"},"slug":{"type":"string"},"escalation":{"type":"string"},"service":{"type":"string"},"repeatEscalation":{"type":"boolean"},"ackTimeout":{"type":"integer"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"token":{"type":"string","description":"The integration reference used by `POST /incidents/create` (as `integrationWebhook`) and by `GET|DELETE /integrations/{token}`. Never use the `_id`."},"webhookUrl":{"type":"string"},"service":{"type":"string"},"escalation":{"type":"string"},"teams":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"x-team-id","in":"header","required":true,"schema":{"type":"string"},"description":"The team's `_id` — a 24-character hex ObjectId, NOT the short `uid` slug. Read it from `GET /teams/get-all-teams`."}]}}}}
```

## Fetch an integration

> Get Details of a integration

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Integrations","description":"Create, read and archive integrations. An integration is referenced by its `token`, never its `_id`."}],"servers":[{"url":"https://api.spike.sh","description":"API server"}],"security":[{"ApiKeyAuth":[],"TeamIdHeader":[]}],"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":{"/integrations/{token}":{"get":{"operationId":"getIntegrationsByToken","summary":"Fetch an integration","description":"Get Details of a integration","tags":["Integrations"],"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":"x-team-id","in":"header","required":true,"schema":{"type":"string"},"description":"The team's `_id` — a 24-character hex ObjectId, NOT the short `uid` slug. Read it from `GET /teams/get-all-teams`."},{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"token parameter"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","description":"Envelope. `integration.webhookUrl` is synthesised from the token on read.","properties":{"integration":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"token":{"type":"string","description":"The integration reference used by `POST /incidents/create` (as `integrationWebhook`) and by `GET|DELETE /integrations/{token}`. Never use the `_id`."},"webhookUrl":{"type":"string"},"service":{"type":"string"},"escalation":{"type":"string"},"teams":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}}},"incidents":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"counterId":{"type":"string","description":"Human-facing id, `<teamUid>-<counter>`. Accepted anywhere an incident id is taken."},"message":{"type":"string"},"status":{"type":"string","enum":["NACK","ACK","RES"],"description":"Lifecycle state of the incident. `NACK` = triggered (nobody has acknowledged it yet). `ACK` = acknowledged (a responder is on it). `RES` = resolved. These three literals are the only values the API ever returns or accepts — there is no `triggered`/`acknowledged`/`resolved` spelling."},"priority":{"type":"string","enum":["p1","p2","p3","p4","p5"]},"severity":{"type":"string","enum":["sev1","sev2","sev3"]},"counter":{"type":"number"},"org":{"type":"string"},"teams":{"type":"array","items":{"type":"string"}},"integration":{"type":"object"},"service":{"type":"object"},"escalation":{"type":"object"},"responders":{"type":"array","items":{"type":"object"}},"createdAt":{"type":"string","format":"date-time"},"NACK_at":{"type":"string","format":"date-time"}}}},"totalIncidents":{"type":"number"},"totalOpenIncidents":{"type":"number"},"currentPage":{"type":"number"},"perPage":{"type":"number"},"total":{"type":"number"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Archive an integration

> Archive an integration. Archive integrations will not be shown in the UI

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Integrations","description":"Create, read and archive integrations. An integration is referenced by its `token`, never its `_id`."}],"servers":[{"url":"https://api.spike.sh","description":"API server"}],"security":[{"ApiKeyAuth":[],"TeamIdHeader":[]}],"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":{"/integrations/{token}/archive":{"delete":{"operationId":"deleteIntegrationsByTokenArchive","summary":"Archive an integration","description":"Archive an integration. Archive integrations will not be shown in the UI","tags":["Integrations"],"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":"x-team-id","in":"header","required":true,"schema":{"type":"string"},"description":"The team's `_id` — a 24-character hex ObjectId, NOT the short `uid` slug. Read it from `GET /teams/get-all-teams`."},{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"token parameter"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"integration_archive":{"type":"boolean"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Fetch available integrations on Spike.sh

> Gets a list of integrations available on Spike

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Integrations","description":"Create, read and archive integrations. An integration is referenced by its `token`, never its `_id`."}],"servers":[{"url":"https://api.spike.sh","description":"API server"}],"security":[{"ApiKeyAuth":[],"TeamIdHeader":[]}],"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":{"/integrations/available":{"get":{"operationId":"getIntegrationsAvailable","summary":"Fetch available integrations on Spike.sh","description":"Gets a list of integrations available on Spike","tags":["Integrations"],"responses":{"200":{"description":"A bare JSON array of the integration types you can create.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"category":{"type":"string"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"x-team-id","in":"header","required":true,"schema":{"type":"string"},"description":"The team's `_id` — a 24-character hex ObjectId, NOT the short `uid` slug. Read it from `GET /teams/get-all-teams`."}]}}}}
```

## Fetch all your integrations

> Get a list of all the integrations for a specific team.

```json
{"openapi":"3.1.0","info":{"title":"Spike API","version":"1.0.0"},"tags":[{"name":"Integrations","description":"Create, read and archive integrations. An integration is referenced by its `token`, never its `_id`."}],"servers":[{"url":"https://api.spike.sh","description":"API server"}],"security":[{"ApiKeyAuth":[],"TeamIdHeader":[]}],"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":{"/integrations":{"get":{"operationId":"getIntegrations","summary":"Fetch all your integrations","description":"Get a list of all the integrations for a specific team.","tags":["Integrations"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"token":{"type":"string","description":"The integration reference used by `POST /incidents/create` (as `integrationWebhook`) and by `GET|DELETE /integrations/{token}`. Never use the `_id`."},"webhookUrl":{"type":"string"},"service":{"type":"string"},"escalation":{"type":"string"},"teams":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}}}},"totalIntegrations":{"type":"number"},"currentPage":{"type":"number"},"perPage":{"type":"number"},"total":{"type":"number"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"x-team-id","in":"header","required":true,"schema":{"type":"string"},"description":"The team's `_id` — a 24-character hex ObjectId, NOT the short `uid` slug. Read it from `GET /teams/get-all-teams`."}]}}}}
```
