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

# Update Agent

> Update supported setup fields for an accessible agent.

Updates supported agent setup fields. The API key must belong to the supplied user, and that user must have access to the agent.

When updating `orgId`, the destination organization must be accessible to the user. Voice IDs and conversation styles are validated before the update is applied.


## OpenAPI

````yaml POST /update-agent
openapi: 3.0.1
info:
  title: Phonely API
  description: API for Phonely services including agent management and call summaries
  version: 1.0.0
servers:
  - url: https://app.phonely.ai/api
security: []
paths:
  /update-agent:
    post:
      summary: Update agent's setup
      description: Update the setup for a specific agent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentRequest'
      responses:
        '200':
          description: Agent updated successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    description: Indicates if the update was successful
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateAgentRequest:
      type: object
      required:
        - uid
        - agentId
      properties:
        uid:
          type: string
          description: User ID
        agentId:
          type: string
          description: Agent ID to update
        orgId:
          type: string
          description: Organization ID to update
        voiceId:
          type: string
          description: ID of the voice to assign to the agent
        agentName:
          type: string
          maxLength: 50
          description: Name of the agent, limited to 50 characters
        greetingMessage:
          type: string
          maxLength: 500
          description: >-
            Greeting message to be used when the agent is called, limited to 500
            characters
        humanizeConversation:
          type: boolean
          description: Set to true to add natural vocal fillers to the conversation
        conversationStyle:
          type: string
          enum:
            - Casual
            - Humorous
            - Direct
            - Formal
            - Persuasive
            - Friendly
          description: Conversation style
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code or identifier
        message:
          type: string
          description: Detailed error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.