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

# Withdraw a dispute

> Withdraw a dispute — terminal. Only the ORIGINAL OPENER may withdraw; pass `actor` matching the dispute's `openedBy` (an actor mismatch returns 412). Legal from any non-terminal state. Requires scope `settlement:write`.



## OpenAPI

````yaml /openapi-v1.yaml post /v1/disputes/{disputeId}/withdraw
openapi: 3.1.0
info:
  title: EnfinitOS API
  version: v1.0
  description: >-
    The governed-execution `/v1` developer API for EnfinitOS — rights, delivery,
    proof, and settlement.


    Use this API to register the legal **bases** a right rests on, **issue** and
    lifecycle-manage rights across delivery substrates (DOOH, CTV, spatial/AR,
    mobile, audio, and more), negotiate **offers**, raise and resolve
    **challenges**, observe constraint-gated **deliveries**, seal signed **proof
    packs**, read **metering** + **settlement** projections, configure
    settlement **rules** and **counterparties**, fulfil GDPR **compliance**
    requests, and subscribe to **webhooks**.


    Every state-changing action is appended to an immutable, signable audit log;
    delivery and proof artefacts are Ed25519-signed so a downstream auditor can
    verify them offline.


    ## Response envelope

    Every response wraps its payload in a canonical envelope.


    Success (HTTP 200):

    ```json { "ok": true, "data": { ... }, "contractVersion": "v1.0" } ```


    Error (4xx / 5xx):

    ```json { "ok": false, "error": "VALIDATION_FAILED", "message": "human
    text", "contractVersion": "v1.0" } ```

    Some error responses carry additional context fields alongside `error` and
    `message` (for example `field`, `validationErrors`, `requiredScopes`,
    `keyScopes`).


    ## Authentication

    All endpoints except `GET /v1` and `GET /v1/healthz` require an API key sent
    as `Authorization: Bearer <api-key>`. Keys carry a set of named scopes; each
    operation documents the scope it requires. A key carrying the `*` wildcard
    scope passes every scope check.

    Pre-launch, sandbox keys are issued through the apply flow: request access
    at `/apply`, receive an activation email on approval, and exchange it for a
    `/v1` sandbox key in the integration playground at `/developers/playground`.
    Self-service key issuance from the developer dashboard at
    `/developers/dashboard` lands at the April 2027 production launch.


    ## Identifiers

    Resource ids are prefixed: bases `bas_…`, rights `rgh_…`, offers `ofr_…`
    (passed as `rightId`/`offerId`), settlement rules `rule_…`, counterparties
    `cp_…`, webhook subscriptions, and webhook deliveries `dlv_…`. All
    timestamps are ISO-8601 strings.
  contact:
    name: EnfinitOS Developer Support
    url: https://docs.enfinitos.com
    email: developers@enfinitos.com
servers:
  - url: https://sandbox.api.enfinitos.com
    description: Sandbox — live today
  - url: https://api.enfinitos.com
    description: Production — at the April 2027 launch
security:
  - bearerAuth: []
tags:
  - name: Discovery
    description: Unauthenticated contract + health probes.
  - name: Tenant
    description: Read the caller's sandbox tenant snapshot.
  - name: Rights
    description: Bases and the right lifecycle (issue, suspend, resume, revoke).
  - name: Offers
    description: Propose, accept, reject, counter, and withdraw offers.
  - name: Challenges
    description: Open, resolve, and withdraw challenges against rights.
  - name: Delivery
    description: Observe constraint-gated delivery events.
  - name: Audit
    description: The append-only event log.
  - name: Proof
    description: Signed proof packs.
  - name: Metering & Settlement
    description: Metering and settlement projections.
  - name: Settlement config
    description: Settlement rules and counterparties.
  - name: Compliance
    description: GDPR Article 15 export and Article 17 erasure.
  - name: Webhooks
    description: Webhook subscriptions and delivery history.
  - name: Disputes
    description: Delivery disputes — open, investigate, respond, resolve.
paths:
  /v1/disputes/{disputeId}/withdraw:
    post:
      tags:
        - Disputes
      summary: Withdraw a dispute
      description: >-
        Withdraw a dispute — terminal. Only the ORIGINAL OPENER may withdraw;
        pass `actor` matching the dispute's `openedBy` (an actor mismatch
        returns 412). Legal from any non-terminal state. Requires scope
        `settlement:write`.
      operationId: withdrawDispute
      parameters:
        - $ref: '#/components/parameters/DisputeId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                actor:
                  type: string
                  description: >-
                    Defaults to the key's developerId. Must match the dispute's
                    `openedBy`.
                notes:
                  type:
                    - string
                    - 'null'
      responses:
        '200':
          description: The withdrawn dispute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DisputeResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/StateConflict'
        '412':
          $ref: '#/components/responses/PreconditionFailed'
components:
  parameters:
    DisputeId:
      name: disputeId
      in: path
      required: true
      description: Delivery dispute id (prefixed `dispute:`).
      schema:
        type: string
  schemas:
    DisputeResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            data:
              type: object
              properties:
                dispute:
                  $ref: '#/components/schemas/DeliveryDispute'
    SuccessEnvelope:
      type: object
      required:
        - ok
        - data
        - contractVersion
      properties:
        ok:
          type: boolean
          const: true
        data:
          description: Route-specific payload. Operation responses refine this.
          type: object
        contractVersion:
          type: string
          const: v1.0
    DeliveryDispute:
      type: object
      description: >-
        A delivery dispute — an advertiser/operator claim that delivery fell
        short of contract. Evidence is frozen at open time; the timeline records
        every transition.
      properties:
        id:
          type: string
          description: Prefixed `dispute:`.
        orgId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        state:
          $ref: '#/components/schemas/DisputeState'
        openedBy:
          type: string
        openedByRole:
          type: string
          enum:
            - advertiser
            - operator
        openedAt:
          type: string
          format: date-time
        disputedPeriod:
          type: object
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        affectedSurface:
          type: object
          properties:
            campaignId:
              type: string
            screenIds:
              type: array
              items:
                type: string
            substrateId:
              type: string
        affectedPartyRole:
          oneOf:
            - $ref: '#/components/schemas/SettlementPartyRole'
            - type: 'null'
        claimedShortfall:
          $ref: '#/components/schemas/ClaimedShortfall'
        evidenceBundle:
          $ref: '#/components/schemas/DisputeEvidenceBundle'
        operatorResponse:
          oneOf:
            - $ref: '#/components/schemas/DisputeOperatorResponse'
            - type: 'null'
        advertiserResponse:
          oneOf:
            - $ref: '#/components/schemas/DisputeAdvertiserResponse'
            - type: 'null'
        resolution:
          oneOf:
            - $ref: '#/components/schemas/DisputeResolution'
            - type: 'null'
        timeline:
          type: array
          items:
            $ref: '#/components/schemas/DisputeTimelineEntry'
    ErrorEnvelope:
      type: object
      required:
        - ok
        - error
        - message
      properties:
        ok:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Human-readable explanation.
        contractVersion:
          type: string
          const: v1.0
        field:
          type: string
          description: Present on some VALIDATION_FAILED errors — the offending field.
        validationErrors:
          type: array
          description: Present on settlement-rule / counterparty validation failures.
          items:
            type: object
            additionalProperties: true
        requiredScopes:
          type: array
          description: Present on SCOPE_MISSING — the scopes the operation needs.
          items:
            type: string
        keyScopes:
          type: array
          description: Present on SCOPE_MISSING — the scopes the presented key carries.
          items:
            type: string
      additionalProperties: true
    DisputeState:
      type: string
      description: >-
        Delivery-dispute lifecycle. RESOLVED and WITHDRAWN are terminal;
        ESCALATED is not (it can later resolve, withdraw, or rejoin
        negotiation).
      enum:
        - OPENED
        - INVESTIGATING
        - EVIDENCE_GATHERED
        - OPERATOR_RESPONDED
        - ADVERTISER_RESPONDED
        - RESOLVED
        - WITHDRAWN
        - ESCALATED
    SettlementPartyRole:
      type: string
      enum:
        - TENANT
        - VENUE
        - CUSTOMER
        - PLATFORM
        - AGENCY
        - AFFILIATE
        - RESELLER
        - TAX_AUTHORITY
    ClaimedShortfall:
      type: object
      description: The shortfall the advertiser is claiming. Decimal as string.
      required:
        - unit
        - amount
      properties:
        unit:
          type: string
          description: e.g. "IMPRESSIONS", "DWELL_SECONDS".
        amount:
          type: string
          description: Positive decimal string — the total claimed missing.
    DisputeEvidenceBundle:
      type: object
      description: >-
        Per-dispute evidence, frozen at open time. At least one of the three id
        arrays must be populated.
      properties:
        proofPackIds:
          type: array
          items:
            type: string
        meteringSnapshotIds:
          type: array
          items:
            type: string
        settlementApplicationIds:
          type: array
          items:
            type: string
        attachmentRefs:
          type: array
          items:
            type: string
        auditorReportRef:
          type:
            - string
            - 'null'
          description: Optional auditor-SDK run id over the disputed period.
    DisputeOperatorResponse:
      type: object
      properties:
        at:
          type: string
          format: date-time
        by:
          type: string
        stance:
          type: string
          enum:
            - ACKNOWLEDGE
            - DISPUTE
            - PARTIAL_ACKNOWLEDGE
        notes:
          type:
            - string
            - 'null'
        proposedRemedy:
          type: object
          properties:
            kind:
              type: string
              enum:
                - CREDIT
                - MAKEGOOD
                - NONE
            amount:
              type:
                - string
                - 'null'
              description: Decimal string; null when kind is NONE.
            makegoodWindow:
              oneOf:
                - type: object
                  properties:
                    start:
                      type: string
                      format: date-time
                    end:
                      type: string
                      format: date-time
                - type: 'null'
    DisputeAdvertiserResponse:
      type: object
      properties:
        at:
          type: string
          format: date-time
        by:
          type: string
        stance:
          type: string
          enum:
            - ACCEPT
            - REJECT
            - NEGOTIATE
        notes:
          type:
            - string
            - 'null'
    DisputeResolution:
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/DisputeResolutionKind'
        creditNoteId:
          type:
            - string
            - 'null'
          description: Set when kind is CREDIT_ISSUED.
        makegoodCampaignId:
          type:
            - string
            - 'null'
          description: Set when kind is MAKEGOOD_DELIVERED.
        settlementAdjustmentId:
          type:
            - string
            - 'null'
          description: >-
            Set when kind is SETTLEMENT_ADJUSTMENT — the id of the
            settlement-application override the engine produced. When the
            override could not be applied, carries an
            `unapplied:<reason>:<disputeId>` sentinel.
        resolvedAt:
          type: string
          format: date-time
        resolvedBy:
          type: string
        notes:
          type:
            - string
            - 'null'
    DisputeTimelineEntry:
      type: object
      description: One append-only entry on the dispute's transition timeline.
      properties:
        at:
          type: string
          format: date-time
        actor:
          type: string
        fromState:
          $ref: '#/components/schemas/DisputeState'
        toState:
          $ref: '#/components/schemas/DisputeState'
        notes:
          type:
            - string
            - 'null'
    ErrorCode:
      type: string
      description: Machine-readable error code. Drives the HTTP status.
      enum:
        - AUTH_REQUIRED
        - AUTH_INVALID
        - SCOPE_MISSING
        - BAD_REQUEST
        - VALIDATION_FAILED
        - RESOURCE_NOT_FOUND
        - STATE_CONFLICT
        - PRECONDITION_FAILED
        - RATE_LIMITED
        - INTERNAL_ERROR
    DisputeResolutionKind:
      type: string
      enum:
        - CREDIT_ISSUED
        - MAKEGOOD_DELIVERED
        - SETTLEMENT_ADJUSTMENT
        - NO_CREDIT
        - OTHER
  responses:
    Unauthorized:
      description: >-
        Missing/malformed Authorization header (AUTH_REQUIRED) or an invalid key
        (AUTH_INVALID).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: >-
        The key is valid but missing one or more required scopes
        (SCOPE_MISSING).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: >-
        The referenced resource does not exist in this tenant
        (RESOURCE_NOT_FOUND).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    StateConflict:
      description: >-
        The resource is in a state that forbids this transition, or a concurrent
        write lost (STATE_CONFLICT).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    PreconditionFailed:
      description: >-
        A precondition failed — a constraint violation or a missing confirmation
        token (PRECONDITION_FAILED).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key sent as `Authorization: Bearer <api-key>`.'

````