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

# Update a persona

> Change project model settings or the current custom behavior. Behavior edits require expectedVersionId and create a version when changed. Model settings and display labels create no version. Egma-owned behavior is read-only; its project settings are editable.



## OpenAPI

````yaml openapi.json PATCH /v1/personas/{personaId}
openapi: 3.1.0
info:
  title: Egma Platform API
  version: 1.0.0
  description: >-
    The customer-facing HTTP interface used by Egma's web app, CLI, and outside
    clients.
servers:
  - url: https://app.egma.ai
security: []
paths:
  /v1/personas/{personaId}:
    patch:
      tags:
        - Personas
      summary: Update a persona
      description: >-
        Change project model settings or the current custom behavior. Behavior
        edits require expectedVersionId and create a version when changed. Model
        settings and display labels create no version. Egma-owned behavior is
        read-only; its project settings are editable.
      operationId: updatePersona
      parameters:
        - name: personaId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  minLength: 1
                name:
                  type: string
                  description: >-
                    Your team's label in the persona library. The caller does
                    not speak this label.
                description:
                  anyOf:
                    - type: string
                    - type: 'null'
                identityName:
                  type: string
                  description: >-
                    The human name the caller gives the agent, separate from the
                    library name.
                personality:
                  type: string
                  description: >-
                    How the caller behaves and speaks. Put the situation and
                    goal in the test scenario.
                language:
                  type: string
                  description: The caller's language, such as en-US.
                models:
                  type: object
                  description: >-
                    The complete language, speech recognition, and speech
                    synthesis selections. Read /v1/persona-form for available
                    choices and recommendations.
                  properties:
                    llm:
                      type: object
                      properties:
                        provider:
                          type: string
                        model:
                          type: string
                      required:
                        - provider
                        - model
                      additionalProperties: false
                    stt:
                      type: object
                      properties:
                        provider:
                          type: string
                        model:
                          type: string
                      required:
                        - provider
                        - model
                      additionalProperties: false
                    tts:
                      type: object
                      properties:
                        provider:
                          type: string
                        model:
                          type: string
                        voiceId:
                          type: string
                          description: >-
                            A voice identifier supported by the selected
                            text-to-speech provider.
                        speed:
                          type: number
                          description: >-
                            Speech rate from 0.6 through 1.5. Use 1 for the
                            normal rate.
                      required:
                        - provider
                        - model
                        - voiceId
                        - speed
                      additionalProperties: false
                  required:
                    - llm
                    - stt
                    - tts
                  additionalProperties: false
                expectedVersionId:
                  type: string
                  minLength: 1
                  description: >-
                    The current versionId from Get a persona. Required when
                    editing identityName, personality, or language. A stale
                    value returns 409 version_conflict.
              additionalProperties: false
      responses:
        '200':
          description: The updated persona.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  projectId:
                    anyOf:
                      - type: string
                        minLength: 1
                      - type: 'null'
                  name:
                    type: string
                  description:
                    anyOf:
                      - type: string
                      - type: 'null'
                  version:
                    type: integer
                    minimum: 1
                  versionId:
                    type: string
                    minLength: 1
                  identityName:
                    type: string
                    description: >-
                      The human name the caller gives the agent, separate from
                      the library name.
                  personality:
                    type: string
                    description: >-
                      How the caller behaves and speaks. Put the situation and
                      goal in the test scenario.
                  language:
                    type: string
                    description: The caller's language, such as en-US.
                  parameterContract:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                        label:
                          type: string
                        valueType:
                          type: string
                          enum:
                            - integer
                            - number
                            - string
                        defaultValue:
                          oneOf:
                            - type: number
                            - type: string
                        unit:
                          anyOf:
                            - type: string
                            - type: 'null'
                        minimum:
                          anyOf:
                            - type: number
                            - type: 'null'
                        maximum:
                          anyOf:
                            - type: number
                            - type: 'null'
                      required:
                        - key
                        - label
                        - valueType
                        - defaultValue
                        - unit
                        - minimum
                        - maximum
                      additionalProperties: false
                  settings:
                    anyOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          models:
                            type: object
                            description: >-
                              The complete language, speech recognition, and
                              speech synthesis selections. Read /v1/persona-form
                              for available choices and recommendations.
                            properties:
                              llm:
                                type: object
                                properties:
                                  provider:
                                    type: string
                                  model:
                                    type: string
                                required:
                                  - provider
                                  - model
                                additionalProperties: false
                              stt:
                                type: object
                                properties:
                                  provider:
                                    type: string
                                  model:
                                    type: string
                                required:
                                  - provider
                                  - model
                                additionalProperties: false
                              tts:
                                type: object
                                properties:
                                  provider:
                                    type: string
                                  model:
                                    type: string
                                  voiceId:
                                    type: string
                                    description: >-
                                      A voice identifier supported by the
                                      selected text-to-speech provider.
                                  speed:
                                    type: number
                                    description: >-
                                      Speech rate from 0.6 through 1.5. Use 1
                                      for the normal rate.
                                required:
                                  - provider
                                  - model
                                  - voiceId
                                  - speed
                                additionalProperties: false
                            required:
                              - llm
                              - stt
                              - tts
                            additionalProperties: false
                          createdAt:
                            type: string
                            format: date-time
                          updatedAt:
                            type: string
                            format: date-time
                        required:
                          - id
                          - models
                          - createdAt
                          - updatedAt
                        additionalProperties: false
                      - type: 'null'
                    description: >-
                      This project's saved model and voice settings. Null before
                      first use. Settings changes do not create a behavior
                      version.
                  owner:
                    type: string
                    enum:
                      - egma
                      - organization
                  archivedAt:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: 'null'
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                required:
                  - id
                  - projectId
                  - name
                  - description
                  - version
                  - versionId
                  - identityName
                  - personality
                  - language
                  - parameterContract
                  - settings
                  - owner
                  - archivedAt
                  - createdAt
                  - updatedAt
                additionalProperties: false
        '400':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '401':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '403':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '404':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '409':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '422':
          description: The request was refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
        '429':
          description: The request rate limit was reached.
          headers:
            Retry-After:
              description: Seconds to wait before trying again.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refusal'
      security:
        - bearerAuth: []
        - sessionCookie: []
components:
  schemas:
    Refusal:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
      required:
        - error
        - message
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Egma API key.
    sessionCookie:
      type: apiKey
      in: cookie
      name: egma.session_token
      description: >-
        The browser session cookie issued by Egma. HTTPS deployments add the
        standard __Secure- prefix.

````