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

# Process File Enrichment

> Process file enrichment request from the agent.

This endpoint is called by the agent's process_file_enrichment tool
to trigger background processing of LinkedIn URLs with comprehensive
validation and error handling.

Features:
- Input validation for LinkedIn URLs and session parameters
- Credit checking and quota verification
- Optimized Arq job enqueueing with proper resource management
- Comprehensive error handling and status reporting
- Job priority and duration estimation

Args:
    request: File processing request details with validation
    current_user: Authenticated user with credit information
    redis_cache: Redis cache instance for session management
    supabase_service: Supabase service instance for job tracking

Returns:
    ProcessFileResponse with comprehensive job details

Raises:
    HTTPException: For validation errors, insufficient credits, or processing failures



## OpenAPI

````yaml https://api.bavlio.com/openapi.json post /api/v1/enrichment/process-file
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/enrichment/process-file:
    post:
      tags:
        - enrichment-processing
      summary: Process File Enrichment
      description: |-
        Process file enrichment request from the agent.

        This endpoint is called by the agent's process_file_enrichment tool
        to trigger background processing of LinkedIn URLs with comprehensive
        validation and error handling.

        Features:
        - Input validation for LinkedIn URLs and session parameters
        - Credit checking and quota verification
        - Optimized Arq job enqueueing with proper resource management
        - Comprehensive error handling and status reporting
        - Job priority and duration estimation

        Args:
            request: File processing request details with validation
            current_user: Authenticated user with credit information
            redis_cache: Redis cache instance for session management
            supabase_service: Supabase service instance for job tracking

        Returns:
            ProcessFileResponse with comprehensive job details

        Raises:
            HTTPException: For validation errors, insufficient credits, or processing failures
      operationId: process_file_enrichment_api_v1_enrichment_process_file_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessFileRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessFileResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ProcessFileRequest:
      properties:
        session_id:
          type: string
          minLength: 1
          title: Session Id
          description: Processing session ID
        linkedin_urls:
          items:
            type: string
          type: array
          maxItems: 1000
          minItems: 1
          title: Linkedin Urls
          description: List of LinkedIn URLs to enrich
        source_column:
          type: string
          minLength: 1
          title: Source Column
          description: Name of the source column
      type: object
      required:
        - session_id
        - linkedin_urls
        - source_column
      title: ProcessFileRequest
      description: Request model for file enrichment processing.
    ProcessFileResponse:
      properties:
        job_id:
          type: string
          title: Job Id
          description: Background job ID
        session_id:
          type: string
          title: Session Id
          description: Processing session ID
        status:
          type: string
          pattern: ^(queued|processing|completed|failed)$
          title: Status
          description: Processing status
        message:
          type: string
          title: Message
          description: Status message
        urls_to_process:
          type: integer
          minimum: 0
          title: Urls To Process
          description: Number of URLs to process
        estimated_duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Estimated Duration Minutes
          description: Estimated processing duration in minutes
        credits_required:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credits Required
          description: Credits required for this operation
        priority:
          anyOf:
            - type: string
            - type: 'null'
          title: Priority
          description: Job priority level
          default: normal
      type: object
      required:
        - job_id
        - session_id
        - status
        - message
        - urls_to_process
      title: ProcessFileResponse
      description: Response model for file enrichment processing.
    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

````