openapi: 3.1.0
info:
  title: Spike API
  description: Spike is an incident management platform that helps teams detect, respond to, and resolve incidents faster. The Spike API allows you to programmatically manage users, incidents, escalation policies, on-call schedules, and integrations.
  version: 1.0.0
  contact:
    name: Spike Support
    url: https://spike.sh/support
    email: support@spike.sh
  license:
    name: Proprietary
    identifier: Proprietary
servers:
  - url: https://api.spike.sh
    description: API server
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.
    TeamIdHeader:
      type: apiKey
      in: header
      name: x-team-id
      description: Team ID of the team you are making the request to.
      x-example: YOUR_TEAM_ID
      x-gitbook-token-placeholder: 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
tags:
  - name: Users
  - name: Orgs
  - name: Teams
  - name: Incidents
  - name: Actions on Incidents
  - name: Suppressed Incidents
  - name: Integrations
  - name: Escalations
  - name: Alert Rules
  - name: Services
  - name: On-Call
  - name: On-call Overrides
  - name: Status Pages
  - name: Components
  - name: Status Page Incidents
  - name: Planned maintenances
  - name: Subscribers
paths:
  /users:
    get:
      summary: Get all users
      description: |
        Get a list of all members in your organization.
        This list includes all the members including the ones who are removed from the organization.
      tags:
        - Users
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /users/{userId}:
    get:
      summary: Get a user
      description: |
        Get a list of all members in your organization.
        This list includes all the members including the ones who are removed from the organization.
      tags:
        - Users
      security:
        - ApiKeyAuth: []
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
          description: userId 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'
  /orgs/members:
    get:
      summary: Fetch members in your org
      description: |
        Get a list of all members in your organization.
        This list includes all the members including the ones who are removed from the organization.
      tags:
        - Orgs
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /orgs/info:
    get:
      summary: Fetch your org info
      description: Get information about your orgranization.
      tags:
        - Orgs
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /teams/get-all-teams:
    get:
      summary: Fetch all the teams
      description: Get details of all the teams in your organisation.
      tags:
        - Teams
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /teams/get-my-teams:
    get:
      summary: Fetch all the teams you are part of
      description: Get details of all the teams that you are a member of
      tags:
        - Teams
      security:
        - ApiKeyAuth: []
      parameters:
        - 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'
  /incidents:
    get:
      summary: Fetch incidents
      description: Get a list of all the incidents for a team.
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          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:
      summary: Get all incident occurrences
      description: |
        Fetch all incident occurrences with filtering options for date range, teams, status, service, integration, and pagination.
        
        **Query Parameters:**
        - `start` (required): Start date in ISO 8601 format (e.g., 2026-01-01T00:00:00Z)
        - `end` (required): End date in ISO 8601 format (e.g., 2026-02-01T23:59:59Z)
        - `teams`: Comma-separated team IDs
        - `status`: Comma-separated status values (ACK=Acknowledged, RES=Resolved, NACK=Not Acknowledged)
        - `service`: Comma-separated service IDs
        - `integration`: Integration ID
        - `page`: Page number for pagination (default: 1)
        - `perPage`: Number of results per page (default: 25, max: 100)
        
        **Example:**
        ```
        GET /incidents/all-occurrences?start=2026-01-01T00:00:00Z&end=2026-02-01T23:59:59Z&teams=64a1b2c3d4e5f6789012345a&status=ACK,RES&page=1&perPage=25
        ```
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
      parameters:
        - name: start
          in: query
          required: true
          schema:
            type: string
          description: Start date in ISO 8601 format
          example: "2026-01-01T00:00:00Z"
        - name: end
          in: query
          required: true
          schema:
            type: string
          description: End date in ISO 8601 format
          example: "2026-02-01T23:59:59Z"
        - name: teams
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated team IDs (optional)
          example: "64a1b2c3d4e5f6789012345a,64a1b2c3d4e5f6789012345b"
        - name: status
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated status values (optional)
          example: "ACK,RES,NACK"
        - name: service
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated service IDs (optional)
          example: "64a1b2c3d4e5f6789012345c,64a1b2c3d4e5f6789012345d"
        - name: integration
          in: query
          required: false
          schema:
            type: string
          description: Integration ID (optional)
          example: "64a1b2c3d4e5f6789012345e"
        - name: page
          in: query
          required: false
          schema:
            type: string
          description: Page number for pagination
          example: "1"
        - name: perPage
          in: query
          required: false
          schema:
            type: string
          description: "Results per page (default: 25, max: 100)"
          example: "25"
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/{counterId}:
    get:
      summary: Fetch incident info
      description: "Get details of an incident. Includes incident title, metadata, priority, severity, and activity log"
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId 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'
  /incidents/create:
    post:
      summary: Create an incident
      description: "Creates an incident and send alerts. Accepts escalation `_id`, integration `token` along with priority and severity. You can send additional metadata in details"
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                metadata:
                  type: object
                escalation:
                  type: string
                integration:
                  type: string
                priority:
                  type: enum
                  enum:
                    - p1
                    - p2
                    - p3
                    - p4
                    - p5
                severity:
                  type: enum
                  enum:
                    - sev1
                    - sev2
                    - sev3
            example:
              title: testing api incident create 1 with invalid integration token
              metadata: { "key": "value" }
              escalation: "<escalation_id>"
              integration: "<integration_token>"
              priority: "p1"
              severity: "sev1"
      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-previous-incidents:
    get:
      summary: Fetch previous occurances of an incident
      description: Fetches previous occurances of an incident.
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId 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'
  /incidents/{counterId}/previous-incident/{_id}:
    get:
      summary: Fetch a previous occurance of an incident
      description: Fetches a previous occurance of an incident with it's details.
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId parameter
        - name: _id
          in: path
          required: true
          schema:
            type: string
          description: _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'
  /incidents/reassign:
    post:
      summary: Add responder to an incident
      description: "Add a responder to an incident. Accepts an array of incident counterIds (*116, prim-122*) and user ids."
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
                assigneeIds:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - "<counter-id>"
              assigneeIds:
                - "<user-id>"
      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}/incident-context:
    get:
      summary: Fetch incident context
      description: Fetches an overview of an incident
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId 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'
  /incidents/{counter_id}/activity-log:
    get:
      summary: Fetch incident activity log
      description: Get the activity log for an incident
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counter_id
          in: path
          required: true
          schema:
            type: string
          description: counter_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'
  /incidents/remove-responder:
    post:
      summary: Remove responder from an incident
      description: "Remove a responder from an incident. Accepts an array of incident counterIds (*116, prim-122*) and user ids."
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
                assigneeIds:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - "<counter-id>"
              assigneeIds:
                - "<user-id>"
      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/acknowledged:
    get:
      summary: Fetch all the acknowledged incidents
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          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:
      summary: Fetch all the triggered incidents
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          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:
      summary: Fetch incidents assigned to a user
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - 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'
  /incidents/overview:
    get:
      summary: Fetch incident bar overview
      description: "Get an overview of the incidents in the team. This includes the total number of incidents, number of open incidents and the number of incidents assigned"
      tags:
        - Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - 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'
  /incidents/acknowledge:
    post:
      summary: Acknowledge incident
      description: "**Acknowledge** one or more incidents. If any incident's integration has [Acknowledge Timeout](https://docs.spike.sh/incidents/acknowledge-timeout) set, it will come into play. Accepts an array of incident counter ids (*116, prim-122*)."
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - loca-4
      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/resolve:
    post:
      summary: Resolve incident
      description: "**Resolves** one or more incidents. Accepts an array of incident counter ids (*116, prim-122*)."
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - loca-4
      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/escalate:
    post:
      summary: Escalate incident
      description: "**Escalates** one or more incidents. Accepts an array of incident counter ids (*116, prim-122*)."
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - loca-4
      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/unacknowledge:
    post:
      summary: Unacknowledge incident
      description: "**Unacknowledge** one or more incidents. Accepts an array of incident counter ids (*116, prim-122*)."
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - loca-4
                - loca-1
      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/priority:
    post:
      summary: Set priority
      description: "Adds **Priority** to one or more incidents. Accepts an array of incident counter ids (*116, prim-122*). Priority can belong to one of `p1, p2, p3, p4, p5` values. Learn more about [priority](https://docs.spike.sh/incidents/priority-and-severity)"
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                priority:
                  type: enum
                  enum:
                    - p1
                    - p2
                    - p3
                    - p4
                    - p5
                ids:
                  type: array
                  items:
                    type: string
            example:
              priority: p5
              ids:
                - loca-1
                - loca-2
      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/severity:
    post:
      summary: Set severity
      description: "Adds **Severity** to one or more incidents. Accepts an array of incident counter ids (*116, prim-122*). Severity can belong to one of `sev1, sev2, sev3` values. Learn more about [severity](https://docs.spike.sh/incidents/priority-and-severity)"
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                severity:
                  type: enum
                  enum:
                    - sev1
                    - sev2
                    - sev3
                ids:
                  type: array
                  items:
                    type: string
            example:
              severity: sev1
              ids:
                - loca-1
                - loca-2
                - loca-3
                - loca-4
      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/priority/remove:
    delete:
      summary: Remove priority
      description: "**Removes Priority** to one or more incidents. Accepts an array of incident counter ids (*116, prim-122*)."
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - loca-1
                - loca-2
                - loca-3
                - loca-4
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/severity/remove:
    delete:
      summary: Remove severity
      description: "**Removes Severity** to one or more incidents. Accepts an array of incident counter ids (*116, prim-122*)."
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
            example:
              ids:
                - loca-1
                - loca-2
                - loca-3
                - loca-4
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /incidents/{counterId}/public-sharing:
    patch:
      summary: Enable/Disable public sharing
      description: "Enable/Disable public sharing for an incident. If enabled, you will get the public url in response. Learn more about [public sharing](https://docs.spike.sh/incidents/sharing-incidents)"
      tags:
        - Actions on Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                publicSharing:
                  type: boolean
            example:
              publicSharing: true
      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'
  /incidents/{counterId}/suppressed-incidents:
    get:
      summary: Fetch suppressed incidents
      description: Fetches suppressed incidents for an incident.
      tags:
        - Suppressed Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId 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'
  /incidents/{counterId}/suppressed-incidents/{_id}:
    get:
      summary: Fetch a suppressed incident
      description: "Fetches a suppressed incident with it's details for an incident. A suppressed incident is an incident that is created when an incident is in `triggered` state and a new incident is created for the same service."
      tags:
        - Suppressed Incidents
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId parameter
        - name: _id
          in: path
          required: true
          schema:
            type: string
          description: _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'
  /integrations/create:
    post:
      summary: Create an integration
      description: |
        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).
      tags:
        - Integrations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      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
            example:
              customName: string
              desc: string
              slug: string
              escalation: string
              service: string
              repeatEscalation: true
              ackTimeout: 0
      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'
  /integrations/{token}:
    get:
      summary: Fetch an integration
      description: Get Details of a integration
      tags:
        - Integrations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
          description: token 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'
  /integrations/{token}/archive:
    delete:
      summary: Archive an integration
      description: Archive an integration. Archive integrations will not be shown in the UI
      tags:
        - Integrations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
          description: token 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'
  /integrations/available:
    get:
      summary: Fetch available integrations on Spike.sh
      description: Gets a list of integrations available on Spike
      tags:
        - Integrations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /integrations:
    get:
      summary: Fetch all your integrations
      description: Get a list of all the integrations for a specific team.
      tags:
        - Integrations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /escalations:
    get:
      summary: Fetch list of escalations
      description: "[An escalation policy](https://docs.spike.sh/escalations/introduction-to-escalations) is a simple set of rules to alert the right person at the right time using the right channel such as phone, slack or email. If that person misses out then the incident gets escalated to the next person."
      tags:
        - Escalations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /escalations/{escalationId}:
    get:
      summary: Get escalation policy details
      description: "Get details of an escalation policy. Includes escalation policy name, description, and escalation rules."
      tags:
        - Escalations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: escalationId
          in: path
          required: true
          schema:
            type: string
          description: escalationId 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'
  /on-calls/{oncallId}/escalations:
    get:
      summary: Fetch escalations using an on-call
      description: Get a list of escalation policies that reference a specific on-call schedule. Useful for understanding which escalations will be affected if you modify or delete an on-call schedule.
      tags:
        - Escalations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: oncallId
          in: path
          required: true
          schema:
            type: string
          description: oncallId 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'
  /escalations/create:
    post:
      summary: Create an escalation policy
      description: |
        Create a new escalation policy for a team. An escalation policy defines **who** gets notified, **how** (via which channel), and the **delay between steps**.
        
        **Request Body:**
        - `name` (required): A descriptive name for the escalation policy.
        - `escalation` (required): An array of steps. Each step is an array of notification rules that fire in parallel. Steps are executed sequentially — Step 2 fires only if Step 1 is not acknowledged within its interval.
        - `delay` (optional): Delay in minutes before the first step begins (default: `0`).
        
        **Notification rule fields:**
        - `interval`: Time in minutes to wait before escalating to the next step. Only required in the first step.
        - `via`: The notification channel — one of `email`, `sms`, `phone`, `whatsapp`, `push-notification`, `slack`, `telegram`, or `ms-teams`.
        - `oncall`: Reference to an on-call schedule `{ "id": "<on-call-id>" }`. The currently on-call user will be notified.
        - `user`: Reference to a specific user `{ "id": "<user-id>" }`. Use this to always notify a fixed person.
        - `channel`: (Slack/MS Teams only) The channel to post to `{ "id": "<channel-id>", "value": "<channel-name>", "isPrivate": "false" }`.
        - `mention`: (Slack only) Mention config `{ "id": "false", "value": "No mention" }`.
        
        > **Tip:** Use `oncall` to route alerts to whoever is currently on-call, or `user` to always alert a specific person.
      tags:
        - Escalations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                escalation:
                  type: array
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        interval:
                          type: string
                        via:
                          type: string
                        oncall:
                          type: object
                          properties:
                            id:
                              type: string
                delay:
                  type: string
            example:
              name: Production Critical Alerts
              escalation:
                - - interval: "10"
                    via: email
                    oncall:
                      id: "<on-call-schedule-id>"
                  - interval: "10"
                    via: sms
                    oncall:
                      id: "<on-call-schedule-id>"
                  - interval: "10"
                    via: phone
                    oncall:
                      id: "<on-call-schedule-id>"
                  - interval: "10"
                    via: push-notification
                    user:
                      id: "<user-id>"
                - - interval: ""
                    via: slack
                    channel:
                      id: "<slack-channel-id>"
                      value: incidents
                      isPrivate: "false"
                    mention:
                      id: "false"
                      value: No mention
                  - interval: ""
                    via: push-notification
                    oncall:
                      id: "<on-call-schedule-id-2>"
              delay: "0"
      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'
  /escalations/{escalationId}/update:
    put:
      summary: Update an escalation policy
      description: |
        Update an existing escalation policy by its ID. Pass the escalation policy `_id` in the URL and provide the full updated policy in the request body.
        
        You must send the **complete escalation structure** — partial updates are not supported. The existing policy will be fully replaced with the provided data.
        
        **Request Body:**
        - `name` (required): Updated name for the escalation policy.
        - `escalation` (required): The full array of escalation steps (same format as Create).
        - `delay` (optional): Delay in minutes before the first step (default: `0`).
        
        See the *Create an escalation policy* endpoint for detailed field descriptions and notification channel options.
      tags:
        - Escalations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: escalationId
          in: path
          required: true
          schema:
            type: string
          description: escalationId parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                escalation:
                  type: array
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        interval:
                          type: string
                        via:
                          type: string
                        oncall:
                          type: object
                          properties:
                            id:
                              type: string
                delay:
                  type: string
            example:
              name: Updated Production Alerts
              escalation:
                - - interval: "10"
                    via: email
                    oncall:
                      id: "<on-call-schedule-id>"
                  - interval: "10"
                    via: sms
                    oncall:
                      id: "<on-call-schedule-id>"
                  - interval: "10"
                    via: phone
                    oncall:
                      id: "<on-call-schedule-id>"
                  - interval: "10"
                    via: push-notification
                    user:
                      id: "<user-id>"
                - - interval: ""
                    via: slack
                    channel:
                      id: "<slack-channel-id>"
                      value: incidents
                      isPrivate: "false"
                    mention:
                      id: "false"
                      value: No mention
                  - interval: ""
                    via: push-notification
                    oncall:
                      id: "<on-call-schedule-id-2>"
              delay: "0"
      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'
  /escalations/{escalationId}/archive:
    delete:
      summary: Archive an escalation policy
      description: |
        Archive (soft-delete) an escalation policy by its ID. Archived escalation policies will no longer be active and won't appear in the default escalation list.
        
        **Important:** Before archiving, make sure no active integrations are using this escalation policy. Archiving an in-use policy may result in incidents not being escalated properly.
        
        Pass the escalation policy `_id` as a path parameter. No request body is required.
      tags:
        - Escalations
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: escalationId
          in: path
          required: true
          schema:
            type: string
          description: escalationId 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'
  /automation/rules:
    get:
      summary: Fetch all alert rules
      description: |
        Get a list of all alert rules configured for a team. Returns both enabled and disabled rules.
        
        Each rule contains:
        - `name`: Rule name
        - `conditions`: Array of condition groups (OR logic between groups, AND logic within a group)
        - `actions`: Array of actions to execute when conditions match
        - `enabled`: Whether the rule is currently active
      tags:
        - Alert Rules
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /automation/rules/{ruleId}:
    get:
      summary: Get alert rule details
      description: "Get full details of a specific alert rule by its ID, including all conditions and actions."
      tags:
        - Alert Rules
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: ruleId
          in: path
          required: true
          schema:
            type: string
          description: ruleId 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'
  /automation/rules/create:
    post:
      summary: Create an alert rule
      description: |
        Create a new alert rule for a team. An alert rule automatically executes actions when incoming incidents match the specified conditions.
        
        **Request Body:**
        - `name` (required): A descriptive name for the rule.
        - `conditions` (required): A 2D array of condition objects. The outer array represents **OR** groups — if any group matches, the rule triggers. Each inner array contains conditions combined with **AND** logic — all must match.
        - `actions` (required): An array of action objects to execute when conditions are met.
        
        ---
        
        **Condition Types:**
        
        | `conditionType` | Description | Additional Fields |
        |---|---|---|
        | `allIncidents` | Matches every incident (wildcard) | — |
        | `incidentMessage` | Match on the incident title/message | `comparator`, `text` |
        | `incidentDetails` | Match on a specific key in the incident metadata | `comparator`, `text`, `keypair` |
        | `incidentOccurrence` | Match when total occurrences exceed a threshold | `occurrences` |
        | `incidentOccurrenceTimeframe` | Match when occurrences exceed a threshold within a time window | `occurrences`, `timeframe` (in minutes) |
        | `priority` | Match on incident priority | `priority` (one of `p1`, `p2`, `p3`, `p4`, `p5`) |
        | `severity` | Match on incident severity | `severity` (one of `sev1`, `sev2`, `sev3`) |
        | `regexMatch` | Match incident message against a regex pattern | `regex` |
        | `incidentTiming` | Match based on time of day the incident occurred | `start` (HH:mm), `end` (HH:mm), `timezone` (optional, e.g., `America/New_York`) |
        | `incidentDayOfWeek` | Match based on day of the week | `days` (array of day numbers: 0=Sunday, 6=Saturday), `timezone` (optional) |
        
        **Comparators** (for `incidentMessage` and `incidentDetails`):
        `contains`, `doesNotContain`, `equals`, `doesNotEqual`, `startsWith`, `endsWith`, `greaterThan`, `lessThan`, `greaterThanOrEqual`, `lessThanOrEqual`, `regexMatch`
        
        > **Note:** `greaterThan`, `lessThan`, `greaterThanOrEqual`, `lessThanOrEqual` are only available for `incidentDetails`.
        
        ---
        
        **Action Types:**
        
        | `actionType` | Description | Additional Fields |
        |---|---|---|
        | `reassignIncident` | Reassign the incident to a specific user | `user` (user ID) |
        | `suppressIncident` | Suppress the incident (do not create) | — |
        | `acknowledgeIncident` | Auto-acknowledge the incident | `sendAlert` (`\"true\"` or `\"false\"`) |
        | `resolveIncident` | Auto-resolve the incident | `sendAlert` (`\"true\"` or `\"false\"`) |
        | `changeEscalation` | Override the escalation policy | `escalation` (escalation policy ID) |
        | `priority` | Set incident priority | `priority` (one of `p1`, `p2`, `p3`, `p4`, `p5`) |
        | `severity` | Set incident severity | `severity` (one of `sev1`, `sev2`, `sev3`) |
        | `outboundWebhook` | Trigger an outbound webhook | `outboundWebhook` (webhook ID) |
        | `executePlaybook` | Execute a playbook | `playbook` (playbook ID) |
        | `timerResolve` | Auto-resolve after a timer | timer config |
        
        ---
        
        **Example:** The sample body creates a rule that matches all incidents whose message starts with \"test\" AND whose metadata key \"test\" has a value greater than 8, then reassigns the incident to a specific user.
      tags:
        - Alert Rules
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                conditions:
                  type: array
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        conditionType:
                          type: string
                        comparator:
                          type: string
                        text:
                          type: string
                actions:
                  type: array
                  items:
                    type: object
                    properties:
                      actionType:
                        type: string
                      user:
                        type: string
            example:
              name: Auto-reassign test incidents
              conditions:
                - - conditionType: incidentMessage
                    comparator: startsWith
                    text: test
                  - conditionType: incidentDetails
                    text: "8"
                    comparator: greaterThan
                    keypair: metric_value
                - - conditionType: priority
                    priority: p1
              actions:
                - actionType: reassignIncident
                  user: "<user-id>"
      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'
  /automation/rules/{ruleId}/update:
    put:
      summary: Update an alert rule
      description: |
        Update an existing alert rule by its ID. You must send the **complete rule** — partial updates are not supported. The existing rule will be fully replaced with the provided data.
        
        **Request Body:**
        - `name` (required): Updated rule name.
        - `conditions` (required): Full 2D array of condition groups (same format as Create).
        - `actions` (required): Full array of action objects (same format as Create).
        
        See *Create an alert rule* for all available `conditionType`, `comparator`, and `actionType` values.
      tags:
        - Alert Rules
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: ruleId
          in: path
          required: true
          schema:
            type: string
          description: ruleId parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                conditions:
                  type: array
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        conditionType:
                          type: string
                        comparator:
                          type: string
                        text:
                          type: string
                actions:
                  type: array
                  items:
                    type: object
                    properties:
                      actionType:
                        type: string
                      user:
                        type: string
            example:
              name: Updated auto-reassign rule
              conditions:
                - - conditionType: incidentMessage
                    comparator: startsWith
                    text: test
                  - conditionType: incidentDetails
                    text: "8"
                    comparator: greaterThan
                    keypair: metric_value
                - - conditionType: priority
                    priority: p1
              actions:
                - actionType: reassignIncident
                  user: "<user-id>"
      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'
  /automation/rules/{ruleId}/archive:
    delete:
      summary: Archive an alert rule
      description: |
        Archive (soft-delete) an alert rule by its ID. Archived rules will no longer evaluate against incoming incidents.
        
        Pass the alert rule `_id` as a path parameter. No request body is required.
      tags:
        - Alert Rules
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: ruleId
          in: path
          required: true
          schema:
            type: string
          description: ruleId 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'
  /services/create:
    post:
      summary: Creates a service
      description: "Creates a new service in a team. Learn more about [services](https://docs.spike.sh/services/introduction-to-services-on-spike)"
      tags:
        - Services
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                desc:
                  type: string
            example:
              name: from api
              desc: testing service create from api
      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'
  /services:
    get:
      summary: Fetch all services
      description: |
        Get list of services for a team. Services are scopes for multiple integrations and their incidents.
        Learn more about [services](https://docs.spike.sh/services/introduction-to-services-on-spike).
      tags:
        - Services
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /services/{counterId}/incidents:
    get:
      summary: Fetch incidents for a service
      description: |
        Get a list of incidents for a specific service.
        Returns a list of incidents for a service.
      tags:
        - Services
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId 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'
  /services/{counterId}/integrations:
    get:
      summary: Fetch integrations of a service
      description: |
        Get a list of integrations for a specific service.
        Includes all the integrations for a service with their details and webhook.
      tags:
        - Services
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId 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'
  /services/{counterId}:
    get:
      summary: Fetch service details with incidents
      description: |
        Get details of a service with it's incidents. Services are scopes for multiple integrations and their incidents.
        This route also returns the list of incidents for a service.
      tags:
        - Services
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId 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'
  /services/affected:
    get:
      summary: Fetch currently affected services
      tags:
        - Services
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /services/{counterId}/update:
    put:
      summary: Updates a service
      description: Update your service name and description only
      tags:
        - Services
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: counterId
          in: path
          required: true
          schema:
            type: string
          description: counterId parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                desc:
                  type: string
            example:
              name: updated from api
              desc: some desc
      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'
  /on-calls:
    get:
      summary: Fetch on-calls
      description: Get list of on-call schedules for a team
      tags:
        - On-Call
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /on-calls/{oncallId}:
    get:
      summary: Fetch an on-call
      description: "Get details about a specific on-call including layers, shifts and users"
      tags:
        - On-Call
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - name: oncallId
          in: path
          required: true
          schema:
            type: string
          description: oncallId parameter
        - name: from
          in: query
          required: true
          schema:
            type: string
          example: "2025-01-24T00:00:00.000Z"
      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'
  /oncalls/am-i-on-call:
    get:
      summary: "Is a user on-call?"
      description: Check whether a personal is currently oncall or not
      tags:
        - On-Call
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - 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'
  /oncalls/upcoming-shifts:
    get:
      summary: Fetch upcoming shifts from multiple schedules
      description: Fetch upcoming shifts from multiple schedules
      tags:
        - On-Call
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      parameters:
        - 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'
  /oncalls/all-active-on-call-shifts:
    get:
      summary: Fetch all currently active on-call shifts
      description: Get a list of users who are currently on call
      tags:
        - On-Call
      security:
        - ApiKeyAuth: []
          TeamIdHeader: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /oncalls/{oncall_id}/overrides:
    get:
      summary: Get all overrides
      tags:
        - On-call Overrides
      security:
        - ApiKeyAuth: []
      parameters:
        - name: oncall_id
          in: path
          required: true
          schema:
            type: string
          description: oncall_id parameter
        - name: from
          in: query
          required: true
          schema:
            type: string
          example: "<iso timestamp>"
        - name: to
          in: query
          required: true
          schema:
            type: string
          example: "<iso timestamp>"
      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'
  /on-calls/{oncall_id}/overrides/{override_id}/remove:
    delete:
      summary: Delete an override
      tags:
        - On-call Overrides
      security:
        - ApiKeyAuth: []
      parameters:
        - name: oncall_id
          in: path
          required: true
          schema:
            type: string
          description: oncall_id parameter
        - name: override_id
          in: path
          required: true
          schema:
            type: string
          description: override_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'
  /on-calls/{oncall_id}/overrides/add:
    post:
      summary: Add an override
      description: |
        Add a temporary override to an on-call schedule. Overrides allow you to temporarily assign a different user to cover an on-call shift.

        All timestamps should be in ISO 8601 format (e.g., `2025-01-24T00:00:00.000Z`).
      tags:
        - On-call Overrides
      security:
        - ApiKeyAuth: []
      parameters:
        - name: oncall_id
          in: path
          required: true
          schema:
            type: string
          description: oncall_id parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: string
                start:
                  type: string
                end:
                  type: string
                desc:
                  type: string
                timezone:
                  type: string
            example:
              user: "<user-id>"
              start: "2025-01-24T00:00:00.000Z"
              end: "2025-01-25T00:00:00.000Z"
              desc: "Covering for vacation"
              timezone: UTC
      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'
  /api/status-page/all:
    get:
      summary: Get a list of all status pages
      description: Gets list of all the status pages of an organisation.
      tags:
        - Status Pages
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/status-page/{status_page_id}:
    get:
      summary: Get details of a status page
      description: |
        Gets details of a status page
        
        Accepts parameter `id of status page`
      tags:
        - Status Pages
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
  /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
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
  /api/status-page/{status_page_id}/component/{component_id}:
    get:
      summary: Get a component
      description: Get Details of a status page component
      tags:
        - Components
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
  /api/status-page/{status_page_id}/component/create:
    post:
      summary: Create a component
      description: |
        Create a new component for a status page
        
        ```
        {
        	"components": [
        		{
        			"name": "title of the component",
        			"desc": "Description of hthe component",
        			"status": "degraded-performance",
        			"private": true
        		}
        	]
        }
        ```
        
        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
      tags:
        - Components
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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
            example:
              components:
                -
                  name: from API
                  desc: from API
      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'
  /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.
        
        ```
        {
        	"name": "title of the component",
        	"desc": "Description of hthe component",
        	"status": "degraded-performance",
        	"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
      tags:
        - Components
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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
            example:
              name: edited with api
              desc: edited with api
      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'
  /api/status-page/{status_page_id}/incidents:
    get:
      summary: Get all incidents
      description: Get a list of all the incidents
      tags:
        - Status Page Incidents
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
  /api/status-page/{status_page_id}/incident/{incident_id}:
    get:
      summary: Get an incident
      description: Gets a list of all the incidents occurred on a status page
      tags:
        - Status Page Incidents
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      parameters:
        - name: status_page_id
          in: path
          required: true
          schema:
            type: string
          description: status_page_id parameter
        - name: incident_id
          in: path
          required: true
          schema:
            type: string
          description: incident_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'
  /api/status-page/{status_page_id}/incident/new:
    post:
      summary: Create a new incident
      description: |
        Creates a new incident on a status page
        
        ``` json
        {
        	"title": "TITLE OF THE INCIDENT 4",
        	"desc": "description about the incident",
        	"severity": "degraded-performance",
        	"componentStatus": [{
        			"id": "{{ _.component_id }}",
        			"status": "critical-outage"
        		}],
        	"identifiedAt": "DD/MM/YYYY",
        	"identifiedAtTime": "05:00"
        }
        ```
        
        ### Params:
        
        ### \* ALL THE TIMESTAMPS SHOULD BE IN UTC
        
        
        `componentStatus *`: Accepts a collection of objects used to set status to multiple components at once. Accepted values of component status are `operational`, `degraded-performance`, `partial-outage`, `critical-outage`.
        
        `title *`: Title of the incident.
        
        `desc *`: Description of the incident
        
        `severity *`: Impact of incident on the status page. Possible values - `operational`, `degraded-performance`, `partial-outage`, `critical-outage`.
        
        `notify`: Specify if you want to notify subscribers about the incident. Defaults to `false`. `Type: Boolean`
        
        `identifiedAtTime`: Specify the time when the incident was triggered in 24 Hour format. `Default`: `Current time in UTC`
        
        `identifiedAt`: Specify the date of the incident in UTC. `Default`: `Current Date in UTC`
        
        \* Required
      tags:
        - Status Page Incidents
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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:
                title:
                  type: string
                desc:
                  type: string
                severity:
                  type: string
                componentStatus:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                identifiedAtTime:
                  type: string
                identifiedAt:
                  type: string
            example:
              title: TITLE OF THE INCIDENT 4
              desc: description about the incident
              severity: degraded-performance
              componentStatus:
                -
                  id: "<component-id>"
                  status: critical-outage
              identifiedAtTime: "05:00"
              identifiedAt: "10/03/2023"
      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'
  /api/status-page/{status_page_id}/incident/{incident_id}/edit:
    post:
      summary: Edit an incident
      description: |
        Edit an incident on a status page
        
        ```
        {
        	"title": "EDITED TITLE OF THE INCIDENT 4",
        	"desc": "edited description about the incident",
        	"severity": "degraded-performance",
        	"componentStatus": [{
        			"id": "{{ _.component_id }}",
        			"status": "critical-outage"
        		}]
        }
        ```
        
        ### Params:
        
        `componentStatus *`: Accepts a collection of objects used to set status to multiple components at once. Accepted values of component status are `operational`, `degraded-performance`, `partial-outage`, `critical-outage`.
        
        `title *`: Title of the incident.
        
        `desc *`: Description of the incident
        
        `severity *`: Impact of incident on the status page. Possible values - `operational`, `degraded-performance`, `partial-outage`, `critical-outage`.
        
        
        \* Required
      tags:
        - Status Page Incidents
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      parameters:
        - name: status_page_id
          in: path
          required: true
          schema:
            type: string
          description: status_page_id parameter
        - name: incident_id
          in: path
          required: true
          schema:
            type: string
          description: incident_id parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                desc:
                  type: string
                severity:
                  type: string
                componentStatus:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
            example:
              title: EDITED TITLE OF THE INCIDENT 4
              desc: edited description about the incident
              severity: degraded-performance
              componentStatus:
                -
                  id: "<component-id>"
                  status: critical-outage
      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'
  /api/status-page/{status_page_id}/incident/{incident_id}/add-status:
    post:
      summary: Add a status update to incident
      description: |
        Add a status update to a status page incident
        
        ```
        {
        	"componentStatus": [{
        		"id": "{{ _.component_id }}",
        		"status": "operational"
        	}],
        	"title": "this is a status update",
        	"status": "update",
        	"notify": true,
        	"time": "05:00",
        	"date": "10/07/2023"
        
        }
        ```
        
        ### Params:
        
        ### \* ALL THE TIMESTAMPS SHOULD BE IN UTC
        
        `componentStatus *`: Accepts a collection of objects used to set status to multiple components at once.. Accepted values of component status are `operational`, `degraded-performance`, `partial-outage`, `critical-outage`.
        
        `title *`: Title of the incident.
        
        `status *`: Type of the update. The value of the update can be any of the following - `investigating`, `identified`, `resolved`, `update`, `postmortem`.
        
        `notify`: Specify if you want to notify the subscribers of the page. default is `false`. `Type: Boolean`
        
        `date`: date of the update in `DD/MM/YYYY` format, otherwise defaults to current date in UTC. 
        
        `time`: time of the update, defaults to current time in UTC. 
        
        
        \* Required
      tags:
        - Status Page Incidents
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      parameters:
        - name: status_page_id
          in: path
          required: true
          schema:
            type: string
          description: status_page_id parameter
        - name: incident_id
          in: path
          required: true
          schema:
            type: string
          description: incident_id parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                componentStatus:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                title:
                  type: string
                status:
                  type: string
                time:
                  type: string
                date:
                  type: string
            example:
              componentStatus:
                -
                  id: "<component-id>"
                  status: operational
              title: this is a status update
              status: update
              time: "05:00"
              date: "10/07/2023"
      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'
  /api/status-page/{status_page_id}/planned-maintenance:
    get:
      summary: Get ongoing planned maintenances
      description: Get a list of ongoing maintenances
      tags:
        - Planned maintenances
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
  /api/status-page/{status_page_id}/planned-maintenance/upcoming:
    get:
      summary: Get upcoming planned maintenances
      description: Get a list of upcoming maintenances
      tags:
        - Planned maintenances
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
  /api/status-page/{status_page_id}/planned-maintenance/previous:
    get:
      summary: Get a list of previous maintenances
      description: Get a list of all the previous maintenanecs
      tags:
        - Planned maintenances
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
  /api/status-page/{status_page_id}/planned-maintenance/{pm_id}:
    get:
      summary: Get a planned maintenance
      description: Get a planned maintenance
      tags:
        - Planned maintenances
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      parameters:
        - name: status_page_id
          in: path
          required: true
          schema:
            type: string
          description: status_page_id parameter
        - name: pm_id
          in: path
          required: true
          schema:
            type: string
          description: pm_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'
  /api/status-page/{status_page_id}/planned-maintenance/create:
    post:
      summary: Create a new planned maintenance
      description: |
        Create a new planned maintenance
        ```
        {
        	"title": "planned maintenance title",
        	"desc": "Write a message to your subscribers.",
        	"startDate": "10/03/2023",
        	"endDate": "13/03/2023",
        	"startTime": "10:00",
        	"endTime": "05:00",
        	"notify": true,
        	"components": ["{{ _.component_id }}"],
        	"notifyNow": true,
        	"notifyOnEnd": true,
        	"reminders": [
        		{
        			"time": 2,
        			"unit": "days"
        		}
        	]
        }
        ```
        ### \* ALL THE TIMESTAMPS SHOULD BE IN UTC
        
        ### Params:
        `title`: Title of the planned maintenanace
        
        `desc`: Write a message to your subscribers.
        
        
        `startDate`: Start date is mandatory. Strict form is DD/MM/YYYY.
        
        `endDate`: End date is mandatory. Strict form is DD/MM/YYYY.
        
        `startTime`: Start time format is HH:MM in 24-hour format. Please do not add AM or PM.
        
        `endTime`: End time format is HH:MM in 24-hour format. Please do not add AM or PM.
        
        `notify`: You can specify to notify the subscribers about the planned maintenance when planned maintenance starts. `Type: Boolean`
        
        `components`: Components is the array of component ids which are going into planned maintenance.
        
        `notifyNow`: Send a notification to you subscribers about planned maintenance schedule. `Type: Boolean`
        
        `notifyOnEnd`: Send a notification on the end of planned maintenance. `Type: Boolean`
        
        `reminders`: You can provide a list of reminders that will be sent before the planned maintenance starts. you can choose to send reminder `days`, `hours` or `minutes` before planned maintenance starts. all the units have a max limit of 30 days.
      tags:
        - Planned maintenances
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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:
                title:
                  type: string
                desc:
                  type: string
                startDate:
                  type: string
                endDate:
                  type: string
                startTime:
                  type: string
                endTime:
                  type: string
                notify:
                  type: boolean
                components:
                  type: array
                  items:
                    type: string
                notifyNow:
                  type: boolean
                notifyOnEnd:
                  type: boolean
                reminders:
                  type: array
                  items:
                    type: object
                    properties:
                      time:
                        type: integer
                      unit:
                        type: string
            example:
              title: planned maintenance title edited
              desc: description of the maintenance
              startDate: "10/03/2023"
              endDate: "13/03/2023"
              startTime: "10:00"
              endTime: "05:00"
              notify: true
              components:
                - "<component-id>"
              notifyNow: true
              notifyOnEnd: true
              reminders:
                -
                  time: 2
                  unit: days
      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'
  /api/status-page/{status_page_id}/planned-maintenance/{pm_id}/update:
    post:
      summary: Edit a planned maintenance
      description: |
        Edit a planned maintenance
        ```
        {
        	"title": "planned maintenance title",
        	"desc": "Write a message to your subscribers.",
        	"startDate": "10/03/2023",
        	"endDate": "13/03/2023",
        	"startTime": "10:00",
        	"endTime": "05:00",
        	"notify": true,
        	"components": ["{{ _.component_id }}"],
        	"notifyNow": true,
        	"notifyOnEnd": true,
        	"reminders": [
        			{
        					"time": 2,
        					"unit": "days"
        			}
        	]
        }
        ```
        ### \* ALL THE TIMESTAMPS SHOULD BE IN UTC
        
        ### Params:
        `title`: Title of the planned maintenanace
        
        `desc`: Write a message to your subscribers.
        
        `startDate`: Start date is mandatory. Strict form is DD/MM/YYYY.
        
        `endDate`: End date is mandatory. Strict form is DD/MM/YYYY.
        
        `startTime`: Start time format is HH:MM in 24-hour format. Please do not add AM or PM.
        
        `endTime`: End time format is HH:MM in 24-hour format. Please do not add AM or PM.
        
        `notify`: You can specify to notify the subscribers about the planned maintenance when planned maintenance starts. `Type: Boolean`
        
        `components`: Components is the array of component ids which are going into planned maintenance.
        
        `notifyNow`: Send a notification to you subscribers about planned maintenance schedule. `Type: Boolean`
        
        `notifyOnEnd`: Send a notification on the end of planned maintenance. `Type: Boolean`
        
        `reminders`: You can provide a list of reminders that will be sent before the planned maintenance starts. you can choose to send reminder `days`, `hours` or `minutes` before planned maintenance starts. all the units have a max limit of 30 days.
      tags:
        - Planned maintenances
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      parameters:
        - name: status_page_id
          in: path
          required: true
          schema:
            type: string
          description: status_page_id parameter
        - name: pm_id
          in: path
          required: true
          schema:
            type: string
          description: pm_id parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                desc:
                  type: string
                startDate:
                  type: string
                endDate:
                  type: string
                startTime:
                  type: string
                endTime:
                  type: string
                notify:
                  type: boolean
                components:
                  type: array
                  items:
                    type: string
                notifyNow:
                  type: boolean
                notifyOnEnd:
                  type: boolean
                reminders:
                  type: array
                  items:
                    type: object
                    properties:
                      time:
                        type: integer
                      unit:
                        type: string
            example:
              title: planned maintenance edited title 2
              desc: description of the maintenance
              startDate: "12/03/2023"
              endDate: "15/03/2023"
              startTime: "10:00"
              endTime: "05:00"
              notify: true
              components:
                - "<component-id>"
              notifyNow: true
              notifyOnEnd: true
              reminders:
                -
                  time: 2
                  unit: days
      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'
  /api/status-page/{status_page_id}/subscribers:
    get:
      summary: Get a list of subscribers of a status page
      description: Get a list of all the subscribers of a status page
      tags:
        - Subscribers
      servers:
        - url: https://statuspage.spike.sh
          description: Status page server
      security:
        - ApiKeyAuth: []
      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'
