> ## 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.

# Playground Status

> Aggregate generation_job state per lead for the optional batch_id.



## OpenAPI

````yaml https://api.bavlio.com/openapi.json get /api/v1/campaigns/{campaign_id}/playground/status
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
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: email-verification
    description: Validate email addresses and prune invalid entries from datasets.
  - 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: Google OAuth
    description: Google OAuth login flow and access tokens.
  - name: Google Sheets OAuth
    description: Google Sheets import and access management.
  - name: stripe
    description: Stripe checkout, billing portal, and subscription status. JWT only.
  - 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/campaigns/{campaign_id}/playground/status:
    get:
      tags:
        - playground
      summary: Playground Status
      description: Aggregate generation_job state per lead for the optional batch_id.
      operationId: playground_status_api_v1_campaigns__campaign_id__playground_status_get
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Campaign Id
        - name: batch_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Filter to a specific batch (optional).
            title: Batch Id
          description: Filter to a specific batch (optional).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaygroundBatchStatus'
        '401':
          description: Unauthorized
        '404':
          description: Campaign or lead not found
        '409':
          description: Concurrent edit conflict
        '422':
          description: Validation failure
      security:
        - HTTPBearer: []
components:
  schemas:
    PlaygroundBatchStatus:
      properties:
        campaign_id:
          type: string
          format: uuid
          title: Campaign Id
        batch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Batch Id
        overall:
          additionalProperties:
            type: integer
          type: object
          title: Overall
        per_lead:
          items:
            $ref: '#/components/schemas/PlaygroundGenerationJobState'
          type: array
          title: Per Lead
      type: object
      required:
        - campaign_id
        - overall
      title: PlaygroundBatchStatus
      description: Overall + per-lead batch progress. Returned by GET /playground/status.
    PlaygroundGenerationJobState:
      properties:
        campaign_lead_id:
          type: string
          format: uuid
          title: Campaign Lead Id
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        batch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Batch Id
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        has_draft:
          type: boolean
          title: Has Draft
          default: false
        subject_preview:
          anyOf:
            - type: string
              maxLength: 80
            - type: 'null'
          title: Subject Preview
          description: First 80 chars of the generated subject (server-truncated).
      type: object
      required:
        - campaign_lead_id
      title: PlaygroundGenerationJobState
      description: |-
        Per-lead generation state snapshot for the polling endpoint.

        R2 (RAC-11) adds `has_draft` + `subject_preview` so the polling client
        can render a per-row "ready to review" indicator + a short subject
        teaser without pulling the full body on every poll. Full bodies are
        fetched once from the dedicated `GET /playground/drafts` endpoint.

        Polling-payload scale assertion: at 50 leads × any subject_preview
        length capped at 80 chars, a status response stays under ~200KB even
        with error strings populated.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````