OpsGenie Alerts API

Operations for creating, retrieving, updating, and managing alerts within the OpsGenie platform.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

opsgenie-alerts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpsGenie Account Alerts API
  description: The OpsGenie Account API provides endpoints for retrieving account-level information and configuration settings. Developers can use this API to access details about their OpsGenie account, including plan information and account metadata. It serves as a foundational API for administrative operations and account management within the OpsGenie platform.
  version: 2.0.0
  contact:
    name: Atlassian Support
    url: https://support.atlassian.com/opsgenie/
  termsOfService: https://www.atlassian.com/legal/cloud-terms-of-service
servers:
- url: https://api.opsgenie.com
  description: Production Server
- url: https://api.eu.opsgenie.com
  description: EU Production Server
security:
- genieKey: []
tags:
- name: Alerts
  description: Operations for creating, retrieving, updating, and managing alerts within the OpsGenie platform.
paths:
  /v2/alerts:
    post:
      operationId: createAlert
      summary: Create alert
      description: Creates an alert in OpsGenie. The request is processed asynchronously and returns a request ID that can be used to track the status of the alert creation.
      tags:
      - Alerts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAlertRequest'
      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'
    get:
      operationId: listAlerts
      summary: List alerts
      description: Returns a list of alerts matching the specified search criteria. Alerts are returned in reverse chronological order by default.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertQuery'
      - $ref: '#/components/parameters/SearchIdentifier'
      - $ref: '#/components/parameters/SearchIdentifierType'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Sort'
      - $ref: '#/components/parameters/Order'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAlertsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}:
    get:
      operationId: getAlert
      summary: Get alert
      description: Retrieves the details of a specific alert identified by its ID, tiny ID, or alias.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAlertResponse'
        '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: deleteAlert
      summary: Delete alert
      description: Deletes the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $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'
  /v2/alerts/{identifier}/close:
    post:
      operationId: closeAlert
      summary: Close alert
      description: Closes the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseAlertRequest'
      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'
  /v2/alerts/{identifier}/acknowledge:
    post:
      operationId: acknowledgeAlert
      summary: Acknowledge alert
      description: Acknowledges the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertActionRequest'
      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'
  /v2/alerts/{identifier}/unacknowledge:
    post:
      operationId: unacknowledgeAlert
      summary: Unacknowledge alert
      description: Removes the acknowledgment from the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertActionRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/snooze:
    post:
      operationId: snoozeAlert
      summary: Snooze alert
      description: Snoozes the specified alert until the given end time. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SnoozeAlertRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/escalate:
    post:
      operationId: escalateAlert
      summary: Escalate alert
      description: Escalates the specified alert to the given escalation. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EscalateAlertRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/assign:
    post:
      operationId: assignAlert
      summary: Assign alert
      description: Assigns the specified alert to a user. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignAlertRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/tags:
    post:
      operationId: addTags
      summary: Add tags to alert
      description: Adds tags to the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddTagsRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      operationId: removeTags
      summary: Remove tags from alert
      description: Removes specified tags from the alert.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      - name: tags
        in: query
        required: true
        description: Comma-separated list of tags to remove from the alert.
        schema:
          type: string
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/notes:
    post:
      operationId: addNote
      summary: Add note to alert
      description: Adds a note to the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddNoteRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    get:
      operationId: listAlertNotes
      summary: List alert notes
      description: Lists the notes attached to the specified alert.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Order'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAlertNotesResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/details:
    post:
      operationId: addDetails
      summary: Add details to alert
      description: Adds custom key-value details to the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddDetailsRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/responders:
    post:
      operationId: addResponder
      summary: Add responder to alert
      description: Adds a responder (team, user, escalation, or schedule) to the specified alert. The request is processed asynchronously.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddResponderRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/attachments:
    post:
      operationId: addAttachment
      summary: Add attachment to alert
      description: Adds a file attachment to the specified alert.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to attach to the alert.
              required:
              - file
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    get:
      operationId: listAttachments
      summary: List alert attachments
      description: Lists the file attachments on the specified alert.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAttachmentsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/logs:
    get:
      operationId: listAlertLogs
      summary: List alert logs
      description: Lists the activity logs for the specified alert.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Order'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAlertLogsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/{identifier}/recipients:
    get:
      operationId: listAlertRecipients
      summary: List alert recipients
      description: Lists the recipients of the specified alert.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertIdentifier'
      - $ref: '#/components/parameters/IdentifierType'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAlertRecipientsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/count:
    get:
      operationId: countAlerts
      summary: Count alerts
      description: Returns the count of alerts matching the specified search criteria.
      tags:
      - Alerts
      parameters:
      - $ref: '#/components/parameters/AlertQuery'
      - $ref: '#/components/parameters/SearchIdentifier'
      - $ref: '#/components/parameters/SearchIdentifierType'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountAlertsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v2/alerts/requests/{requestId}:
    get:
      operationId: getRequestStatus
      summary: Get request status
      description: Retrieves the status and alert details of an asynchronous request using the request ID returned from alert action endpoints.
      tags:
      - Alerts
      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:
  schemas:
    GetAlertResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Alert'
        took:
          type: number
          description: Time taken to process the request in seconds.
        requestId:
          type: string
          description: Unique identifier for the request.
    ListAlertsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Alert'
          description: List of alerts.
        paging:
          $ref: '#/components/schemas/Paging'
        took:
          type: number
          description: Time taken to process the request in seconds.
        requestId:
          type: string
          description: Unique identifier for the request.
    Responder:
      type: object
      required:
      - type
      properties:
        id:
          type: string
          description: ID of the responder.
        name:
          type: string
          description: Name of the responder (for teams and schedules).
        username:
          type: string
          description: Username of the responder (for users).
        type:
          type: string
          enum:
          - team
          - user
          - escalation
          - schedule
          description: Type of the responder entity.
    AddDetailsRequest:
      type: object
      required:
      - details
      properties:
        details:
          type: object
          description: Key-value pairs to add to the alert details.
          additionalProperties:
            type: string
        user:
          type: string
          description: Display name of the request owner.
        source:
          type: string
          description: Source of the action.
        note:
          type: string
          description: Additional note to add with the details.
    SuccessResponse:
      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 request.
    AddNoteRequest:
      type: object
      required:
      - note
      properties:
        note:
          type: string
          maxLength: 25000
          description: The note text to add to the alert.
        user:
          type: string
          description: Display name of the request owner.
        source:
          type: string
          description: Source of the action.
    ListAlertRecipientsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              user:
                type: object
                properties:
                  id:
                    type: string
                    description: User ID.
                  username:
                    type: string
                    description: Username of the recipient.
              state:
                type: string
                description: State of the notification to the recipient.
              method:
                type: string
                description: Notification method used.
              createdAt:
                type: string
                format: date-time
                description: Date and time when the notification was created.
              updatedAt:
                type: string
                format: date-time
                description: Date and time when the notification was last updated.
        took:
          type: number
          description: Time taken to process the request in seconds.
        requestId:
          type: string
          description: Unique identifier for the request.
    ListAlertNotesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              note:
                type: string
                description: Text content of the note.
              owner:
                type: string
                description: User who created the note.
              createdAt:
                type: string
                format: date-time
                description: Date and time when the note was created.
              offset:
                type: string
                description: Offset value for pagination.
        paging:
          $ref: '#/components/schemas/Paging'
        took:
          type: number
          description: Time taken to process the request in seconds.
        requestId:
          type: string
          description: Unique identifier for the request.
    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.
        last:
          type: string
          description: URL for the last page of results.
    Alert:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the alert.
        tinyId:
          type: string
          description: Short, human-readable identifier of the alert.
        alias:
          type: string
          description: Client-defined identifier used for deduplication.
        message:
          type: string
          description: The message of the alert.
        status:
          type: string
          enum:
          - open
          - closed
          description: Current status of the alert.
        acknowledged:
          type: boolean
          description: Whether the alert has been acknowledged.
        isSeen:
          type: boolean
          description: Whether the alert has been seen.
        tags:
          type: array
          items:
            type: string
          description: Tags attached to the alert.
        snoozed:
          type: boolean
          description: Whether the alert is currently snoozed.
        snoozedUntil:
          type: string
          format: date-time
          description: The date and time when the snooze will end.
        lastOccurredAt:
          type: string
          format: date-time
          description: The last time the alert occurred.
        createdAt:
          type: string
          format: date-time
          description: The date and time when the alert was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time when the alert was last updated.
        count:
          type: integer
          description: The number of times the alert has occurred.
        source:
          type: string
          description: Source of the alert.
        owner:
          type: string
          description: The owner (assigned user) of the alert.
        priority:
          type: string
          enum:
          - P1
          - P2
          - P3
          - P4
          - P5
          description: Priority level of the alert.
        responders:
          type: array
          items:
            $ref: '#/components/schemas/Responder'
          description: Responders of the alert.
        integration:
          type: object
          properties:
            id:
              type: string
              description: Integration ID.
            name:
              type: string
              description: Integration name.
            type:
              type: string
              description: Integration type.
          description: Integration that created the alert.
        report:
          type: object
          properties:
            ackTime:
              type: integer
              description: Time in milliseconds to acknowledge the alert.
            closeTime:
              type: integer
              description: Time in milliseconds to close the alert.
            acknowledgedBy:
              type: string
              description: User who acknowledged the alert.
            closedBy:
              type: string
              description: User who closed the alert.
          description: Report with timing and actor information.
        actions:
          type: array
          items:
            type: string
          description: Custom actions available for the alert.
        entity:
          type: string
          description: Entity field of the alert.
        description:
          type: string
          description: Detailed description of the alert.
        details:
          type: object
          additionalProperties:
            type: string
          description: Custom key-value pairs attached to the alert.
    SnoozeAlertRequest:
      type: object
      required:
      - endTime
      properties:
        endTime:
          type: string
          format: date-time
          description: The date and time when the snooze will end, in ISO 8601 format.
        user:
          type: string
          description: Display name of the request owner.
        source:
          type: string
          description: Source of the snooze action.
        note:
          type: string
          description: Additional note to add with the snooze.
    AssignAlertRequest:
      type: object
      required:
      - owner
      properties:
        owner:
          type: object
          description: The user to assign the alert to.
          properties:
            id:
              type: string
              description: ID of the user.
            username:
              type: string
              description: Username (email) of the user.
        user:
          type: string
          description: Display name of the request owner.
        source:
          type: string
          description: Source of the assign action.
        note:
          type: string
          description: Additional note to add with the assignment.
    CountAlertsResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            count:
              type: integer
              description: Count of alerts matching the query.
        took:
          type: number
          description: Time taken to process the request in seconds.
        requestId:
          type: string
          description: Unique identifier for the 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: The date and time when the request was processed.
            integrationId:
              type: string
              description: ID of the integration.
            isSuccess:
              type: boolean
              description: Whether the operation succeeded.
            status:
              type: string
              description: Status of the request.
            alertId:
              type: string
              description

# --- truncated at 32 KB (41 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/opsgenie/refs/heads/main/openapi/opsgenie-alerts-api-openapi.yml