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

# Resolve an emergency

> **Required permission:** `write`. Creates the resolution sub-resource.

A second call on an already-resolved emergency returns 409. Idempotency-Key
support is on the roadmap — until then partners should treat a 5xx as
"unknown outcome" and check `GET /emergencies/{id}` before retrying.



## OpenAPI

````yaml https://api.rescue-serverless.dev.back2back.team/api/public/v1/openapi.json post /orgs/{org_id}/emergencies/{emergency_id}/resolutions
openapi: 3.1.0
info:
  title: Rescue Public API v1
  description: >-
    Stable public API for partner integrations.


    **Authentication:** `Authorization: Bearer rk_live_<8 hex><64 hex>`. Tokens
    are minted via `POST /api/v1/api-keys` (internal admin) and shown exactly
    once at creation. The same plaintext is required for every public-v1 request
    — store it securely.


    **Permissions:** v1 vocabulary is `read` | `write`. Future versions may
    introduce granular `<resource>:<action>` permissions additively.


    **Idempotency:** retries on a 5xx must be assumed to have unknown outcomes —
    check `GET /emergencies/{id}` (optionally via `externalId`) before retrying.
    An `Idempotency-Key` header will be supported in a future revision.


    **Webhook delivery:** payloads may be duplicated and out-of-order. Dedup on
    `eventId`; order events per emergency on `(emergencyId, sequence)`.
  version: 1.0.0
servers:
  - url: https://api.punchrescue.com/api/public/v1
security:
  - BearerAuth: []
paths:
  /orgs/{org_id}/emergencies/{emergency_id}/resolutions:
    post:
      tags:
        - Emergencies
      summary: Resolve an emergency
      description: >-
        **Required permission:** `write`. Creates the resolution sub-resource.


        A second call on an already-resolved emergency returns 409.
        Idempotency-Key

        support is on the roadmap — until then partners should treat a 5xx as

        "unknown outcome" and check `GET /emergencies/{id}` before retrying.
      operationId: emergencies.resolve
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            description: Target organization id (from the route path)
            title: Org Id
          description: Target organization id (from the route path)
        - name: emergency_id
          in: path
          required: true
          schema:
            type: string
            description: Emergency id
            title: Emergency Id
          description: Emergency id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResolutionRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicResolutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateResolutionRequest:
      properties:
        resolutionNote:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Resolutionnote
        resolvedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolvedat
        resolvedBy:
          anyOf:
            - $ref: '#/components/schemas/ResolveEmergencyResolvedBy'
            - type: 'null'
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      additionalProperties: false
      type: object
      title: CreateResolutionRequest
    PublicResolutionResponse:
      properties:
        emergencyId:
          type: string
          title: Emergencyid
        status:
          type: string
          title: Status
        resolvedAt:
          type: string
          title: Resolvedat
        resolvedBy:
          $ref: '#/components/schemas/PublicActorRef'
        resolutionNote:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolutionnote
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - emergencyId
        - status
        - resolvedAt
        - resolvedBy
      title: PublicResolutionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResolveEmergencyResolvedBy:
      properties:
        id:
          type: string
          title: Id
          description: Partner-supplied user id from the caller's own system
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Display name fallback
      additionalProperties: false
      type: object
      required:
        - id
      title: ResolveEmergencyResolvedBy
    PublicActorRef:
      properties:
        type:
          type: string
          title: Type
          description: user | api_key | system
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - type
        - id
      title: PublicActorRef
      description: >-
        Unified actor shape (declaredBy / resolvedBy) for both user and api_key
        attribution.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: rk_live_<8hex><64hex>

````