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

# Update ElevenLabs voice setting

> Updates the `elevenlabs_voice_id` meta for a council sage.
If the selected voice does not support the current language,
the language is automatically updated to the first supported
language of the voice.

Requires `ss_council_admin` capability.

Registered as `wp_ajax_sagescreen_update_sage_voice` — **login required**.




## OpenAPI

````yaml /openapi/private/specs/wp/sage-internal.yml post /wp-admin/admin-ajax.php?action=sagescreen_update_sage_voice
openapi: 3.1.0
info:
  title: SageScreen — Sage Module
  description: >
    Council sage management. Sages are AI screening assistants customized

    per council. Each council can have system sages (non-customizable,

    auto-attached) and custom sages (built through a multi-step workflow).


    **CPT:** `ss_council_sage`

    **Custom statuses:** `ss_draft`, `ss_building`, `ss_active`, `ss_inactive`,
    `ss_paused`


    ## Build Workflow


    Custom sages go through a 6-step creation workflow:

    1. **Context** — Define role, level, and job description

    2. **Culture** — Configure tone, scoring, intro question, evaluation
    guidelines

    3. **Build** — Automated build via Python service (8 sub-steps)

    4. **Test** — Optional test screen to verify sage behavior

    5. **Finalize** — Review and confirm build

    6. **Deploy** — Set email config and activate sage


    Build sub-steps (step 3) run sequentially in the Python service:

    `starting` → `creating_sage` → `sage_generation` → `test_shu` →

    `test_ha` → `test_ri` → `transcending_training` → `enlightenment`
  version: 1.0.0
servers:
  - url: https://{domain}/wp-json/sagescreen/v1
    description: WordPress REST API
    variables:
      domain:
        default: api.sagescreen.app
security: []
tags:
  - name: Sage – REST
    description: REST API endpoints for sage operations and Python callbacks
  - name: Sage – CRUD
    description: AJAX endpoints for sage creation, editing, and status management
  - name: Sage – Build Workflow
    description: AJAX endpoints for the multi-step sage build process
paths:
  /wp-admin/admin-ajax.php?action=sagescreen_update_sage_voice:
    post:
      tags:
        - Sage – CRUD
      summary: Update ElevenLabs voice setting
      description: >
        Updates the `elevenlabs_voice_id` meta for a council sage.

        If the selected voice does not support the current language,

        the language is automatically updated to the first supported

        language of the voice.


        Requires `ss_council_admin` capability.


        Registered as `wp_ajax_sagescreen_update_sage_voice` — **login
        required**.
      operationId: ajaxUpdateSageVoice
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateSageVoiceRequest'
      responses:
        '200':
          description: Voice update result
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UpdateSageVoiceSuccess'
                  - $ref: '#/components/schemas/AjaxErrorResponse'
              examples:
                sameLanguage:
                  summary: Voice updated, language unchanged
                  value:
                    success: true
                    data:
                      message: Voice updated successfully
                      voice_id: EXAVITQu4vr4xnSDxMaL
                      voice_display: Sarah
                      language_updated: false
                languageChanged:
                  summary: Voice updated with language auto-change
                  value:
                    success: true
                    data:
                      message: Voice updated successfully
                      voice_id: EXAVITQu4vr4xnSDxMaL
                      voice_display: Maria
                      language_updated: true
                      new_language: es
                      new_language_flag: 🇪🇸
                      new_language_name: Spanish
                noPermission:
                  summary: Insufficient permissions
                  value:
                    success: false
                    data:
                      message: Insufficient permissions
      security:
        - wpAjaxNonce: []
components:
  schemas:
    UpdateSageVoiceRequest:
      type: object
      required:
        - action
        - nonce
        - sage_id
        - voice_id
      properties:
        action:
          type: string
          const: sagescreen_update_sage_voice
        nonce:
          type: string
          description: WP nonce for `sagescreen_frontend_nonce`
          examples:
            - abc123def456
        sage_id:
          type: integer
          description: WordPress post ID of the council sage
          examples:
            - 1234
        voice_id:
          type: string
          description: ElevenLabs voice ID (or "none" to clear)
          examples:
            - EXAVITQu4vr4xnSDxMaL
        current_language:
          type: string
          description: Current sage language code for compatibility check
          examples:
            - en
    UpdateSageVoiceSuccess:
      type: object
      properties:
        success:
          type: boolean
          const: true
          examples:
            - true
        data:
          type: object
          required:
            - message
            - voice_id
            - voice_display
            - language_updated
          properties:
            message:
              type: string
              examples:
                - Voice updated successfully
            voice_id:
              type: string
              description: The saved voice ID
              examples:
                - EXAVITQu4vr4xnSDxMaL
            voice_display:
              type: string
              description: Human-readable voice name
              examples:
                - Sarah
            language_updated:
              type: boolean
              description: true if language was auto-changed for voice compatibility
              examples:
                - false
            new_language:
              type: string
              description: New language code (only present if language_updated is true)
              examples:
                - es
            new_language_flag:
              type: string
              description: Emoji flag for the new language
              examples:
                - 🇪🇸
            new_language_name:
              type: string
              description: Human-readable language name
              examples:
                - Spanish
    AjaxErrorResponse:
      type: object
      description: |
        Standard AJAX error. The `data` field is either a plain string
        (from `wp_send_json_error`) or absent when using `wp_send_json`
        directly with `success: false`.
      properties:
        success:
          type: boolean
          const: false
          examples:
            - false
        message:
          type: string
          description: Error message (when using wp_send_json directly)
          examples:
            - Security check failed
        data:
          oneOf:
            - type: string
              examples:
                - Security check failed
            - type: object
              properties:
                message:
                  type: string
                  examples:
                    - Insufficient permissions
  securitySchemes:
    wpAjaxNonce:
      type: apiKey
      in: query
      name: nonce
      description: WordPress AJAX nonce (passed as form field, verified per-action)

````