OpsGenie Incident API

Create and manage incidents programmatically. Supports defining responders, tags, custom details, priority levels, and impacted services for each incident. Available to Standard and Enterprise plan users with endpoints for creating, updating, closing, and resolving incidents in a structured response workflow.

OpenAPI Specification

opsgenie-incident-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpsGenie Incident API
  description: >-
    The OpsGenie Incident API enables developers to create and manage
    incidents programmatically. It supports defining responders, tags,
    custom details, priority levels, and impacted services for each
    incident. The Incident API is available to Standard and Enterprise
    plan users and provides endpoints for creating, updating, closing,
    and resolving incidents as part of a structured incident response
    workflow.
  version: '1.0.0'
  contact:
    name: Atlassian Support
    url: https://support.atlassian.com/opsgenie/
  termsOfService: https://www.atlassian.com/legal/cloud-terms-of-service
externalDocs:
  description: OpsGenie Incident API Documentation
  url: https://docs.opsgenie.com/docs/incident-api
servers:
  - url: https://api.opsgenie.com
    description: Production Server
  - url: https://api.eu.opsgenie.com
    description: EU Production Server
tags:
  - name: Incidents
    description: >-
      Operations for creating, retrieving, updating, closing, and resolving
      incidents within the OpsGenie platform.
security:
  - genieKey: []
paths:
  /v1/incidents/create:
    post:
      operationId: createIncident
      summary: Create incident
      description: >-
        Creates a new incident in OpsGenie. The request is processed
        asynchronously and returns a request ID that can be used to track
        the status of the incident creation. Available to Standard and
        Enterprise plan users.
      tags:
        - Incidents
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIncidentRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/incidents:
    get:
      operationId: listIncidents
      summary: List incidents
      description: >-
        Returns a list of incidents matching the specified search criteria.
      tags:
        - Incidents
      parameters:
        - name: query
          in: query
          required: true
          description: >-
            Search query to filter incidents using OpsGenie query language.
          schema:
            type: string
        - name: offset
          in: query
          description: >-
            Starting index for pagination.
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: limit
          in: query
          description: >-
            Maximum number of items to return.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: sort
          in: query
          description: >-
            Field to sort results by.
          schema:
            type: string
            enum:
              - createdAt
              - tinyId
              - message
              - status
              - isSeen
              - owner
        - name: order
          in: query
          description: >-
            Sort order for the results.
          schema:
            type: string
            enum:
              - desc
              - asc
            default: desc
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListIncidentsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/incidents/{identifier}:
    get:
      operationId: getIncident
      summary: Get incident
      description: >-
        Retrieves the details of a specific incident identified by its ID.
      tags:
        - Incidents
      parameters:
        - $ref: '#/components/parameters/IncidentIdentifier'
        - $ref: '#/components/parameters/IdentifierType'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIncidentResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      operationId: deleteIncident
      summary: Delete incident
      description: >-
        Deletes the specified incident. The request is processed asynchronously.
      tags:
        - Incidents
      parameters:
        - $ref: '#/components/parameters/IncidentIdentifier'
        - $ref: '#/components/parameters/IdentifierType'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/incidents/{identifier}/close:
    post:
      operationId: closeIncident
      summary: Close incident
      description: >-
        Closes the specified incident. The request is processed asynchronously.
      tags:
        - Incidents
      parameters:
        - $ref: '#/components/parameters/IncidentIdentifier'
        - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseIncidentRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/incidents/{identifier}/resolve:
    post:
      operationId: resolveIncident
      summary: Resolve incident
      description: >-
        Resolves the specified incident. The request is processed asynchronously.
      tags:
        - Incidents
      parameters:
        - $ref: '#/components/parameters/IncidentIdentifier'
        - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IncidentActionRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/incidents/requests/{requestId}:
    get:
      operationId: getIncidentRequestStatus
      summary: Get incident request status
      description: >-
        Retrieves the status and incident details of an asynchronous request
        using the request ID returned from incident action endpoints.
      tags:
        - Incidents
      parameters:
        - name: requestId
          in: path
          required: true
          description: >-
            The ID of the asynchronous request to check status for.
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestStatusResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    genieKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication using the GenieKey scheme. The value should
        be in the format 'GenieKey your-api-key'.
  parameters:
    IncidentIdentifier:
      name: identifier
      in: path
      required: true
      description: >-
        Identifier of the incident, which can be the incident ID or tiny ID.
      schema:
        type: string
    IdentifierType:
      name: identifierType
      in: query
      description: >-
        Type of the identifier. Possible values are id or tiny. Default is id.
      schema:
        type: string
        enum:
          - id
          - tiny
        default: id
  schemas:
    CreateIncidentRequest:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          maxLength: 130
          description: >-
            Message of the incident, limited to 130 characters.
        description:
          type: string
          maxLength: 10000
          description: >-
            A detailed description of the incident.
        responders:
          type: array
          description: >-
            Teams that the incident is routed to for response.
          items:
            type: object
            properties:
              id:
                type: string
                description: >-
                  ID of the responder team.
              name:
                type: string
                description: >-
                  Name of the responder team.
              type:
                type: string
                enum:
                  - team
                description: >-
                  Type of responder, must be team.
        tags:
          type: array
          description: >-
            Tags to attach to the incident.
          items:
            type: string
          maxItems: 20
        details:
          type: object
          description: >-
            Custom key-value pairs to attach to the incident.
          additionalProperties:
            type: string
        priority:
          type: string
          enum:
            - P1
            - P2
            - P3
            - P4
            - P5
          description: >-
            Priority level of the incident. P1 is the highest.
        impactedServices:
          type: array
          description: >-
            List of service IDs that are impacted by the incident.
          items:
            type: string
        statusPageEntry:
          type: object
          description: >-
            Status page entry to create with the incident.
          properties:
            title:
              type: string
              description: >-
                Title of the status page entry.
            detail:
              type: string
              description: >-
                Detail message for the status page entry.
        notifyStakeholders:
          type: boolean
          description: >-
            Whether to send notifications to stakeholders.
    CloseIncidentRequest:
      type: object
      properties:
        note:
          type: string
          description: >-
            Additional note to add when closing the incident.
    IncidentActionRequest:
      type: object
      properties:
        note:
          type: string
          description: >-
            Additional note to add with the action.
    Incident:
      type: object
      properties:
        id:
          type: string
          description: >-
            Unique identifier of the incident.
        tinyId:
          type: string
          description: >-
            Short, human-readable identifier of the incident.
        message:
          type: string
          description: >-
            Message of the incident.
        status:
          type: string
          enum:
            - open
            - resolved
            - closed
          description: >-
            Current status of the incident.
        tags:
          type: array
          items:
            type: string
          description: >-
            Tags attached to the incident.
        createdAt:
          type: string
          format: date-time
          description: >-
            Date and time when the incident was created.
        updatedAt:
          type: string
          format: date-time
          description: >-
            Date and time when the incident was last updated.
        priority:
          type: string
          enum:
            - P1
            - P2
            - P3
            - P4
            - P5
          description: >-
            Priority level of the incident.
        ownerTeam:
          type: string
          description: >-
            The owner team of the incident.
        responders:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: >-
                  Responder team ID.
              type:
                type: string
                description: >-
                  Responder type.
          description: >-
            Responders assigned to the incident.
        impactedServices:
          type: array
          items:
            type: string
          description: >-
            IDs of services impacted by the incident.
        description:
          type: string
          description: >-
            Detailed description of the incident.
        details:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom key-value pairs attached to the incident.
    AsyncRequestResponse:
      type: object
      properties:
        result:
          type: string
          description: >-
            Result message.
        took:
          type: number
          description: >-
            Time taken to process the request in seconds.
        requestId:
          type: string
          description: >-
            Unique identifier for the asynchronous request.
    RequestStatusResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            success:
              type: boolean
              description: >-
                Whether the request was successful.
            action:
              type: string
              description: >-
                The action that was performed.
            processedAt:
              type: string
              format: date-time
              description: >-
                Date and time when the request was processed.
            status:
              type: string
              description: >-
                Status of the request.
            incidentId:
              type: string
              description: >-
                ID of the incident created or affected.
        took:
          type: number
          description: >-
            Time taken in seconds.
        requestId:
          type: string
          description: >-
            Unique identifier for the request.
    ListIncidentsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Incident'
          description: >-
            List of incidents.
        paging:
          type: object
          properties:
            next:
              type: string
              description: >-
                URL for the next page of results.
            first:
              type: string
              description: >-
                URL for the first page of results.
        took:
          type: number
          description: >-
            Time taken in seconds.
        requestId:
          type: string
          description: >-
            Unique identifier for the request.
    GetIncidentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Incident'
        took:
          type: number
          description: >-
            Time taken in seconds.
        requestId:
          type: string
          description: >-
            Unique identifier for the request.
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: >-
            Error message describing what went wrong.
        took:
          type: number
          description: >-
            Time taken in seconds.
        requestId:
          type: string
          description: >-
            Unique identifier for the request.