> ## Documentation Index
> Fetch the complete documentation index at: https://docs.warrn.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Close Alert

> Close (resolve) an alert using OpsGenie API v2 format. Supports lookup by alias.

Close an alert, setting its status to `resolved`. The most common pattern is to close by alias - pass `identifierType=alias` and use the same alias you set when creating the alert.

## Typical workflow

Create the alert with a stable alias, then close it by that alias when the issue resolves:

```bash theme={null}
# 1. Alert fires - create with alias
curl -X POST "https://api.warrn.io/v2/alerts/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer warrn_k8sM2vL9xQ7nP4wR..." \
  -d '{"message": "Disk full on db-01", "alias": "disk-full-db-01", "priority": "P2"}'

# 2. Issue resolved - close by alias
curl -X POST "https://api.warrn.io/v2/alerts/disk-full-db-01/close?identifierType=alias" \
  -H "Authorization: Bearer warrn_k8sM2vL9xQ7nP4wR..."
```

<Warning>
  Lookup by alias only matches alerts currently `open` or `acknowledged` (the same window during which a repeat create dedups). If the alias has no live alert, the endpoint returns an error response with the message `"No open alert found with alias: {your-alias}"`.
</Warning>


## OpenAPI

````yaml POST /v2/alerts/{identifier}/close
openapi: 3.0.3
info:
  title: Warrn API
  version: '1.0'
  description: |
    Public REST API for Warrn. All endpoints are authenticated with an API key
    issued from Settings → API Keys in the Warrn dashboard.
servers:
  - url: https://api.warrn.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Alerts
    description: Native Warrn alert endpoints.
  - name: OpsGenie Compatible
    description: Drop-in OpsGenie Alert API v2 compatibility layer.
paths:
  /v2/alerts/{identifier}/close:
    post:
      tags:
        - OpsGenie Compatible
      summary: Close Alert (OpsGenie)
      description: Close an alert (sets status to `resolved`). Supports lookup by alias.
      operationId: opsgenieCloseAlert
      parameters:
        - in: path
          name: identifier
          required: true
          schema:
            type: string
        - in: query
          name: identifierType
          schema:
            type: string
            enum:
              - id
              - alias
              - tiny
            default: id
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpsgenieAck'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    OpsgenieAck:
      type: object
      properties:
        result:
          type: string
          example: Request will be processed
        took:
          type: number
          example: 0
        requestId:
          type: string
          format: uuid
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Unauthorized
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: warrn_xxx
      description: Bearer token using your Warrn API key.

````