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

# Resolve Queue Item Endpoint

> Resolve a pending review queue item.

Atomic 3-step inside ``cas_resolve_queue_item`` (migration 151):
  1. CAS queue row pending -> resolved.
  2. Conditional campaign_leads transition keyed on resolution_action.
  3. Emit one engagement_log state_transition row.

For ``stop_and_suppress`` only: a second RPC call writes the
suppression row via ``cas_create_suppression``. The queue resolve
itself does not roll back when the suppression write fails (the
queue state is already correct; operator can retry via the
suppression CRUD endpoint).

Returns:
    200 + ``QueueResolveResponse`` on success.
    404 when the queue item is absent (or cross-tenant).
    409 when the queue item was already in a terminal state
        (resolved, auto_resolved, expired) or when the idempotency
        key already reserved a duplicate-in-flight resolve.
    422 when ``resolution_action_params`` is malformed (caught at
        the pydantic layer for the pause_* branches).



## OpenAPI

````yaml https://api.bavlio.com/openapi.json post /api/v1/queue/{item_id}/resolve
openapi: 3.1.0
info:
  title: Bavlio API
  description: >-
    Outreach automation API — lead enrichment, email campaigns, LinkedIn
    automation, and AI agent. Full docs at https://docs.bavlio.com.
  version: 1.0.0
  x-guidance:
    product: Bavlio Data API
    protocols:
      - x402
    description: >-
      Pay-per-call B2B data endpoints for AI agents. USDC on Base mainnet via
      x402 v2. See /openapi.json for pricing. Landing page + marketing details:
      https://bavlio.com/developers
    network: eip155:8453
    docs_url: https://docs.bavlio.com
  x-payment-merchant-address: '0xcca4725e0e931982830bff523b141e1a7a58d3e7'
servers: []
security: []
tags:
  - name: API Keys
    description: >-
      Create, list, and revoke API keys for programmatic access. JWT
      authentication required.
  - name: credits
    description: Credit balance, cost estimates, and transaction history.
  - name: campaigns
    description: Create, manage, launch, and monitor email campaigns.
  - name: campaign-personalization
    description: AI-powered email subject and body personalization for campaigns.
  - name: email-finder
    description: Find and verify email addresses for prospects.
  - name: sender-profiles
    description: Manage sender identity profiles for outreach.
  - name: sender-profile-chat
    description: Interactive chat for building sender profiles.
  - name: templates
    description: Email template CRUD.
  - name: suppression
    description: Do-not-contact suppression list management.
  - name: datasets
    description: Lead dataset listing, download, and updates.
  - name: user-extractions
    description: Uploaded lead file management and processing.
  - name: enrichment-chat
    description: Interactive chat for data enrichment sessions.
  - name: enrichment-processing
    description: Batch lead enrichment processing.
  - name: File Upload (CSV/Excel)
    description: Upload and preview CSV/Excel lead files.
  - name: connected-accounts
    description: LinkedIn account connections via Unipile.
  - name: linkedin-content
    description: LinkedIn post creation, scheduling, and management.
  - name: linkedin-playground
    description: Direct LinkedIn actions (profile lookup, messaging, engagement).
  - name: bavimail-proxy
    description: BaviMail domain, alias, and email management.
  - name: agent
    description: Bavi AI agent chat with SSE streaming.
  - name: notifications
    description: Notification preferences and delivery.
  - name: referral
    description: Referral code management and stats.
  - name: feedback
    description: User feedback submission.
  - name: authentication
    description: JWT token verification and user info.
  - name: users
    description: User quota and usage information.
  - name: Health
    description: Health checks and system status.
  - name: Personalization
    description: Core lead personalization engine.
  - name: Session Management
    description: Enrichment session lifecycle.
  - name: Session Processing
    description: Session data processing.
  - name: webhooks
    description: Inbound webhook handlers (Stripe, BaviMail, Unipile).
paths:
  /api/v1/queue/{item_id}/resolve:
    post:
      tags:
        - review_queue
      summary: Resolve Queue Item Endpoint
      description: |-
        Resolve a pending review queue item.

        Atomic 3-step inside ``cas_resolve_queue_item`` (migration 151):
          1. CAS queue row pending -> resolved.
          2. Conditional campaign_leads transition keyed on resolution_action.
          3. Emit one engagement_log state_transition row.

        For ``stop_and_suppress`` only: a second RPC call writes the
        suppression row via ``cas_create_suppression``. The queue resolve
        itself does not roll back when the suppression write fails (the
        queue state is already correct; operator can retry via the
        suppression CRUD endpoint).

        Returns:
            200 + ``QueueResolveResponse`` on success.
            404 when the queue item is absent (or cross-tenant).
            409 when the queue item was already in a terminal state
                (resolved, auto_resolved, expired) or when the idempotency
                key already reserved a duplicate-in-flight resolve.
            422 when ``resolution_action_params`` is malformed (caught at
                the pydantic layer for the pause_* branches).
      operationId: resolve_queue_item_endpoint_api_v1_queue__item_id__resolve_post
      parameters:
        - name: item_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Item Id
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueueResolveRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueueResolveResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    QueueResolveRequest:
      properties:
        resolution_action:
          type: string
          enum:
            - continue
            - stop
            - stop_and_suppress
            - reply_manually
            - pause_n_days
            - pause_until_date
            - switch_channel
          title: Resolution Action
          description: >-
            One of the seven actions from review_queue_items.resolution_action
            CHECK (migration 149).
        resolution_action_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Resolution Action Params
          description: >-
            Per-action params. pause_n_days requires {'days': <positive int>};
            pause_until_date requires {'until': <ISO timestamptz>}; other
            actions ignore.
        resolution_note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Resolution Note
          description: Optional operator note (audit trail).
      type: object
      required:
        - resolution_action
      title: QueueResolveRequest
      description: Body for POST /api/v1/queue/{item_id}/resolve.
    QueueResolveResponse:
      properties:
        queue_item_id:
          type: string
          format: uuid
          title: Queue Item Id
        resolved:
          type: boolean
          title: Resolved
        current_status:
          type: string
          title: Current Status
        resolution_action:
          type: string
          title: Resolution Action
        suppressed:
          type: boolean
          title: Suppressed
          description: >-
            True only when resolution_action='stop_and_suppress' AND the
            suppression row was written (or already existed).
      type: object
      required:
        - queue_item_id
        - resolved
        - current_status
        - resolution_action
        - suppressed
      title: QueueResolveResponse
      description: Body for POST /api/v1/queue/{item_id}/resolve happy path.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.