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

# Confirm (approve) a link request (owner-only)

> Approves a pending link request.

Requirements:
- `x-discord-actor` must match the `owner_discord_id` on the request.
- Request must be in the same `x-discord-guild` context.

State behavior:
- If expired, returns **410** and marks the request as `expired`.
- If already `approved`, returns **200** with `{ already: true }`.
- If `denied`, returns **409** (cannot approve a denied request).




## OpenAPI

````yaml /openapi.yaml post /link-requests/{id}/confirm
openapi: 3.1.0
info:
  title: Northca Partner API
  version: 1.1.0
  description: >-
    Partner-facing REST API for ER:LC and MC communities using Northca MDT.

    ## Response format

    All endpoints return JSON wrapped as:

    **Success**: `{ "ok": true, "data": ... }` **Error**: `{ "ok": false,
    "error": "..." }` 
servers:
  - url: https://api.northca.dev/v1
    description: Production (v1)
security:
  - PartnerKey: []
tags:
  - name: Link Requests
    description: >-
      Request and manage linking a Northca MDT to your ER:LC partner
      integration.
  - name: MDT Links
    description: List linked MDTs and unlink (owner-only) in a guild.
  - name: MDT Info
    description: Read public MDT configuration/info (map, departments, settings).
  - name: Calls
    description: Create, list, and update dispatch calls (CAD).
  - name: Scene Reports
    description: Create and list scene reports (incident summaries).
  - name: Shifts
    description: Create and list shifts (duty sessions).
  - name: Tickets
    description: Create and list unit tickets (tasks/citations/notes).
  - name: Active Units
    description: Upsert, list, delete active units, and trigger panic events (10-33).
paths:
  /link-requests/{id}/confirm:
    post:
      tags:
        - Link Requests
      summary: Confirm (approve) a link request (owner-only)
      description: |
        Approves a pending link request.

        Requirements:
        - `x-discord-actor` must match the `owner_discord_id` on the request.
        - Request must be in the same `x-discord-guild` context.

        State behavior:
        - If expired, returns **410** and marks the request as `expired`.
        - If already `approved`, returns **200** with `{ already: true }`.
        - If `denied`, returns **409** (cannot approve a denied request).
      parameters:
        - $ref: '#/components/parameters/LinkRequestId'
        - $ref: '#/components/parameters/XDiscordGuild'
        - $ref: '#/components/parameters/XDiscordActor'
      responses:
        '200':
          description: Approved (or already approved).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/OkEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        additionalProperties: false
                        required:
                          - status
                        properties:
                          status:
                            type: string
                            enum:
                              - approved
                          already:
                            type: boolean
                            description: Present when the request was already approved.
              examples:
                approved:
                  value:
                    ok: true
                    data:
                      status: approved
                alreadyApproved:
                  value:
                    ok: true
                    data:
                      status: approved
                      already: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Guild mismatch or owner mismatch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                guildMismatch:
                  value:
                    ok: false
                    error: Guild mismatch
                ownerMismatch:
                  value:
                    ok: false
                    error: Owner mismatch
        '404':
          description: Link request not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                ok: false
                error: Link request not found
        '409':
          description: State conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                denied:
                  value:
                    ok: false
                    error: Link request was denied
                alreadyDecided:
                  value:
                    ok: false
                    error: Link request already decided
                raced:
                  value:
                    ok: false
                    error: Link request status changed by another request
        '410':
          $ref: '#/components/responses/Gone'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    LinkRequestId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Link request ID.
      example: 4a15f77b-1b4d-41c5-9b4b-3b60e3b2d8d0
    XDiscordGuild:
      name: x-discord-guild
      in: header
      required: true
      schema:
        type: string
      description: Discord Guild ID (server/guild context for the request).
      example: '123456789012345678'
    XDiscordActor:
      name: x-discord-actor
      in: header
      required: false
      schema:
        type: string
      description: Discord User ID for the acting user (optional; used for audit fields).
      example: '222222222222222222'
  schemas:
    OkEnvelope:
      type: object
      required:
        - ok
        - data
      properties:
        ok:
          type: boolean
          const: true
        data:
          description: Response payload.
          nullable: false
          type: object
          additionalProperties: true
    ErrorEnvelope:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          const: false
        error:
          type: string
      additionalProperties: true
      example:
        ok: false
        error: Unauthorized
  responses:
    Unauthorized:
      description: Missing/invalid authentication or required headers.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error: Unauthorized
    Gone:
      description: Resource has expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error: Link request expired
    ServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    PartnerKey:
      type: apiKey
      in: header
      name: x-partner-key
      description: Partner API key provided by Northca.

````