Spike.sh Incidents API

Incident management endpoints

OpenAPI Specification

spike-sh-incidents-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Spike.sh Alert Rules Incidents API
  description: 'REST API for managing incidents, on-call schedules, escalation policies, services, integrations, and alerting rules within the Spike.sh incident management platform. Spike.sh provides phone, SMS, WhatsApp, Telegram, Slack, and Microsoft Teams notifications, along with status pages, war rooms, and 80+ integrations.

    '
  version: 1.0.0
  contact:
    name: Spike.sh Support
    url: https://docs.spike.sh
  termsOfService: https://spike.sh/terms
servers:
- url: https://api.spike.sh
  description: Main API server
- url: https://statuspage.spike.sh
  description: Status page API server
security:
- ApiKeyAuth: []
tags:
- name: Incidents
  description: Incident management endpoints
paths:
  /incidents:
    get:
      tags:
      - Incidents
      summary: Fetch incidents
      description: Get all incidents for the specified team.
      operationId: getIncidents
      parameters:
      - $ref: '#/components/parameters/TeamIdHeader'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/all-occurrences:
    get:
      tags:
      - Incidents
      summary: Get all incident occurrences
      description: Retrieve all incident occurrences within a specified time range.
      operationId: getAllIncidentOccurrences
      parameters:
      - name: start
        in: query
        required: true
        schema:
          type: string
          format: date-time
        description: Start of the time range (ISO 8601)
      - name: end
        in: query
        required: true
        schema:
          type: string
          format: date-time
        description: End of the time range (ISO 8601)
      - name: teams
        in: query
        schema:
          type: string
      - name: status
        in: query
        schema:
          type: string
      - name: service
        in: query
        schema:
          type: string
      - name: integration
        in: query
        schema:
          type: string
      - name: page
        in: query
        schema:
          type: integer
      - name: perPage
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/create:
    post:
      tags:
      - Incidents
      summary: Create incident
      description: Manually create a new incident.
      operationId: createIncident
      parameters:
      - $ref: '#/components/parameters/TeamIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - title
              properties:
                title:
                  type: string
                  description: Incident title
                metadata:
                  type: object
                  description: Additional incident metadata
                escalation:
                  type: string
                  description: Escalation policy ID
                integration:
                  type: string
                  description: Integration ID
                priority:
                  type: string
                  enum:
                  - p1
                  - p2
                  - p3
                  - p4
                  - p5
                severity:
                  type: string
                  enum:
                  - sev1
                  - sev2
                  - sev3
      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'
  /incidents/{counterId}:
    get:
      tags:
      - Incidents
      summary: Fetch incident info
      description: Get details for a specific incident.
      operationId: getIncident
      parameters:
      - name: counterId
        in: path
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/TeamIdHeader'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Incident'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/{counterId}/get-previous-incidents:
    get:
      tags:
      - Incidents
      summary: Fetch previous occurrences
      description: Get all previous occurrences of an incident.
      operationId: getIncidentPreviousOccurrences
      parameters:
      - name: counterId
        in: path
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/TeamIdHeader'
      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'
  /incidents/{counterId}/previous-incident/{_id}:
    get:
      tags:
      - Incidents
      summary: Fetch single previous occurrence
      description: Get details for a single previous occurrence of an incident.
      operationId: getIncidentSinglePreviousOccurrence
      parameters:
      - name: counterId
        in: path
        required: true
        schema:
          type: string
      - name: _id
        in: path
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/TeamIdHeader'
      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'
  /incidents/{counterId}/incident-context:
    get:
      tags:
      - Incidents
      summary: Fetch incident context
      description: Get the context for a specific incident.
      operationId: getIncidentContext
      parameters:
      - name: counterId
        in: path
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/TeamIdHeader'
      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'
  /incidents/{counter_id}/activity-log:
    get:
      tags:
      - Incidents
      summary: Fetch activity log
      description: Get the activity log for a specific incident.
      operationId: getIncidentActivityLog
      parameters:
      - name: counter_id
        in: path
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/TeamIdHeader'
      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'
  /incidents/acknowledged:
    get:
      tags:
      - Incidents
      summary: Fetch acknowledged incidents
      description: Get all acknowledged incidents for the team.
      operationId: getAcknowledgedIncidents
      parameters:
      - $ref: '#/components/parameters/TeamIdHeader'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/triggered:
    get:
      tags:
      - Incidents
      summary: Fetch triggered incidents
      description: Get all triggered (unacknowledged) incidents for the team.
      operationId: getTriggeredIncidents
      parameters:
      - $ref: '#/components/parameters/TeamIdHeader'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/assigned-to-user:
    get:
      tags:
      - Incidents
      summary: Fetch user-assigned incidents
      description: Get all incidents assigned to a specific user.
      operationId: getIncidentsAssignedToUser
      parameters:
      - $ref: '#/components/parameters/TeamIdHeader'
      - name: id
        in: query
        required: true
        schema:
          type: string
        description: User ID
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/overview:
    get:
      tags:
      - Incidents
      summary: Fetch incident overview
      description: Get an overview of incidents.
      operationId: getIncidentOverview
      parameters:
      - $ref: '#/components/parameters/TeamIdHeader'
      - name: id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    TeamIdHeader:
      name: x-team-id
      in: header
      required: true
      schema:
        type: string
      description: Team identifier. Use GET /teams to retrieve your team ID.
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the problem
        error:
          type: string
          description: Error type or code
    Incident:
      type: object
      properties:
        _id:
          type: string
          description: Unique incident identifier
        counterId:
          type: string
          description: Human-readable incident counter ID
        title:
          type: string
          description: Incident title
        status:
          type: string
          enum:
          - triggered
          - acknowledged
          - resolved
          description: Current incident status
        priority:
          type: string
          enum:
          - p1
          - p2
          - p3
          - p4
          - p5
          description: Incident priority level
        severity:
          type: string
          enum:
          - sev1
          - sev2
          - sev3
          description: Incident severity level
        metadata:
          type: object
          description: Additional incident metadata
        escalation:
          type: string
          description: Escalation policy ID
        integration:
          type: string
          description: Integration ID
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key generated from https://app.spike.sh/api