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

# Auto Derive And Save Person Voice

> Auto-build (or re-derive) AND PERSIST the authenticated user's person voice.

The time-to-value auto-build the FE Voice page calls when no voice exists. Flow:

1. NO-CLOBBER pre-check: if a row already exists with ``manually_edited_at`` set (the
   user edited it), a NORMAL call returns the EXISTING row untouched with
   ``skipped_user_edited=true``. ``?force=true`` overrides and re-derives.
2. Derive the draft via ``ContentVoiceAutoDeriveService`` (V2.1a, READ-ONLY +
   fail-soft: never raises; each arm carries its own rich status).
3. MAP the rich arm statuses to the migration-249 CHECK vocabulary before persisting:
   LinkedIn is already ok/absent/error (pass-through); X collapses derived->ok,
   {no_connection,empty_timeline,unavailable}->absent, needs_reauth->error. The
   ORIGINAL rich reason is preserved in ``*_arm_detail`` so the FE keeps the nuance.
4. Upsert the voice fields + MAPPED arm statuses + ``derived_at=now()`` + a bumped
   ``derivation_version``. ``manually_edited_at`` is NOT set (a derive is not a user
   edit). FAIL-SOFT: the derive never raises; an upsert failure surfaces a clear 502
   (from the service) rather than a cryptic 500.

The response body echoes the RICH X status (the FE keeps the nuance) while the column
stores the mapped CHECK value; ``voice`` carries the persisted (mapped) row.

``user_id`` is the authenticated actor (``org_context.user_id``), never a client
param -- a caller can only ever derive/persist their OWN voice.



## OpenAPI

````yaml https://api.bavlio.com/openapi.json post /api/v1/content/person-voice/auto-derive
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/content/person-voice/auto-derive:
    post:
      tags:
        - content
      summary: Auto Derive And Save Person Voice
      description: >-
        Auto-build (or re-derive) AND PERSIST the authenticated user's person
        voice.


        The time-to-value auto-build the FE Voice page calls when no voice
        exists. Flow:


        1. NO-CLOBBER pre-check: if a row already exists with
        ``manually_edited_at`` set (the
           user edited it), a NORMAL call returns the EXISTING row untouched with
           ``skipped_user_edited=true``. ``?force=true`` overrides and re-derives.
        2. Derive the draft via ``ContentVoiceAutoDeriveService`` (V2.1a,
        READ-ONLY +
           fail-soft: never raises; each arm carries its own rich status).
        3. MAP the rich arm statuses to the migration-249 CHECK vocabulary
        before persisting:
           LinkedIn is already ok/absent/error (pass-through); X collapses derived->ok,
           {no_connection,empty_timeline,unavailable}->absent, needs_reauth->error. The
           ORIGINAL rich reason is preserved in ``*_arm_detail`` so the FE keeps the nuance.
        4. Upsert the voice fields + MAPPED arm statuses + ``derived_at=now()``
        + a bumped
           ``derivation_version``. ``manually_edited_at`` is NOT set (a derive is not a user
           edit). FAIL-SOFT: the derive never raises; an upsert failure surfaces a clear 502
           (from the service) rather than a cryptic 500.

        The response body echoes the RICH X status (the FE keeps the nuance)
        while the column

        stores the mapped CHECK value; ``voice`` carries the persisted (mapped)
        row.


        ``user_id`` is the authenticated actor (``org_context.user_id``), never
        a client

        param -- a caller can only ever derive/persist their OWN voice.
      operationId: >-
        auto_derive_and_save_person_voice_api_v1_content_person_voice_auto_derive_post
      parameters:
        - name: force
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Re-derive and overwrite even a manually-edited voice. Default
              false no-clobbers a user-edited voice (returns it untouched).
            default: false
            title: Force
          description: >-
            Re-derive and overwrite even a manually-edited voice. Default false
            no-clobbers a user-edited voice (returns it untouched).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonVoiceDeriveResponse'
        '401':
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    PersonVoiceDeriveResponse:
      properties:
        voice:
          $ref: '#/components/schemas/PersonVoiceResponse'
        skipped_user_edited:
          type: boolean
          title: Skipped User Edited
          default: false
        linkedin_arm_status:
          type: string
          title: Linkedin Arm Status
        linkedin_arm_detail:
          type: string
          title: Linkedin Arm Detail
          default: ''
        x_arm_status:
          type: string
          title: X Arm Status
        x_arm_detail:
          type: string
          title: X Arm Detail
          default: ''
      type: object
      required:
        - voice
        - linkedin_arm_status
        - x_arm_status
      title: PersonVoiceDeriveResponse
      description: >-
        Result of the auto-derive-and-save (POST). ``voice`` is the persisted
        row (or, on

        a no-clobber skip, the EXISTING user-edited row).
        ``skipped_user_edited`` is true when

        a normal call left a manually-edited voice untouched. The per-arm status
        echoes the

        RICH X status (derived / no_connection / needs_reauth / empty_timeline /
        unavailable)

        + the collapsed LinkedIn status (ok / absent / error) so the FE keeps
        the nuance even

        though the persisted column stores the mapped CHECK value.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PersonVoiceResponse:
      properties:
        tone:
          type: string
          title: Tone
          default: ''
        style:
          type: string
          title: Style
          default: ''
        topics:
          items:
            type: string
          type: array
          title: Topics
        do_guidelines:
          items:
            type: string
          type: array
          title: Do Guidelines
        dont_guidelines:
          items:
            type: string
          type: array
          title: Dont Guidelines
        sample_snippets:
          items:
            type: string
          type: array
          title: Sample Snippets
        linkedin_arm_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedin Arm Status
        linkedin_arm_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedin Arm Detail
        x_arm_status:
          anyOf:
            - type: string
            - type: 'null'
          title: X Arm Status
        x_arm_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: X Arm Detail
        derived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Derived At
        manually_edited_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Manually Edited At
        derivation_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Derivation Version
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      title: PersonVoiceResponse
      description: >-
        The persisted PERSON voice (+ per-arm status + provenance).
        ``updated_at`` null

        means no row yet -- the FE auto-derive-and-saves on first load. The
        arm-status

        columns are the migration-249 CHECK vocabulary ('ok'/'absent'/'error')
        and may be

        null until a derive has run; the ``*_arm_detail`` carry the original
        rich reason.
    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.