PUT
/
v1
/
agents
/
{agentId}
curl --request PUT \
  --url https://api.contactship.ai/v1/agents/{agentId} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "name": "<string>",
  "person_name": "<string>",
  "voice_id": "<string>",
  "language": "<string>",
  "ambient_sound": "coffee-shop",
  "interruption_sensitivity": 123,
  "webhook_url": "<string>",
  "conversation_purpose": "<string>",
  "prompt": "<string>",
  "voice_speed": 123,
  "voice_temperature": 123,
  "volume": 123,
  "post_call_analysis_data": [
    {}
  ],
  "tools": [
    {}
  ]
}'
{
  "statusCode": 200,
  "data": {
    "id": "337a9eeb-3e16-4cc5-94ec-25fa159eb57a",
    "name": "Technical Support Specialist",
    "person_name": "Emily Parker",
    "language": "en-US",
    "webhook_url": "https://webhook.example.com/support-notifications",
    "conversation_purpose": "Provide technical support and troubleshooting assistance to customers",
    "prompt": "You are Emily Parker, an experienced technical support specialist. Your role is to help customers resolve technical issues efficiently and professionally.\n\nGuidelines:\n- Start by understanding the customer's issue clearly\n- Provide step-by-step solutions in a clear, natural way\n- Use simple language, avoiding technical jargon unless necessary\n- Create support tickets for complex issues\n- Follow up to ensure the solution worked\n\nMaintain a patient and helpful tone throughout the conversation.",
    "volume": 1.1,
    "voice_id": "custom_voice_emily_tech",
    "interruption_sensitivity": 0.7,
    "ambient_sound": "call-center",
    "voice_speed": 1,
    "voice_temperature": 0.8,
    "post_call_analysis_data": [
      {
        "name": "issue_resolved",
        "type": "boolean",
        "description": "Whether the technical issue was resolved"
      },
      {
        "name": "resolution_time",
        "type": "number",
        "description": "Time taken to resolve the issue (minutes)"
      },
      {
        "name": "ticket_created",
        "type": "boolean",
        "description": "Whether a support ticket was created"
      },
      {
        "name": "customer_satisfaction",
        "type": "number",
        "description": "Customer satisfaction score (1-10)"
      }
    ],
    "tools": [
      {
        "name": "create_ticket",
        "type": "function",
        "description": "Create a support ticket for unresolved issues"
      },
      {
        "name": "search_knowledge_base",
        "type": "function",
        "description": "Search technical documentation for solutions",
        "parameters": {
          "type": "object",
          "required": [
            "query"
          ],
          "properties": {
            "query": {
              "type": "string",
              "description": "Search query for technical documentation"
            }
          }
        }
      },
      {
        "name": "schedule_followup",
        "type": "function",
        "description": "Schedule a follow-up call for complex issues"
      }
    ],
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-03-20T15:45:00.000Z"
  }
}

Headers

x-api-key
string
required

API key for authentication

Path Parameters

agentId
string
required

The ID of the agent to update

Body

application/json
Update agent configuration
name
string

The name of the agent in our system. Only used for your own reference.

person_name
string

The name of the agent in the call.

voice_id
string

The ID of the voice to use [Still working on this]

language
string

Specifies what language (and dialect) the speech recognition will operate in. For instance, selecting en-GB optimizes speech recognition for British English. If unset, will use default value en-US. Select multi for multilingual support, currently this supports Spanish and English.

Available options: en-US, en-IN, en-GB, de-DE, es-ES, es-419, hi-IN, ja-JP, pt-PT, pt-BR, fr-FR, zh-CN, ru-RU, it-IT, ko-KR, nl-NL, pl-PL, tr-TR, vi-VN, multi

ambient_sound
enum<string> | null

If set, will add ambient environment sound to the call to make experience more realistic. Currently supports the following options:

Set to null to remove ambient sound from this agent.

Available options: coffee-shop, convention-hall, summer-outdoor, mountain-outdoor, static-noise, call-center

Available options:
coffee-shop,
convention-hall,
summer-outdoor,
mountain-outdoor,
static-noise,
call-center
interruption_sensitivity
number

Controls how sensitive the agent is to user interruptions. Value ranging from [0.1,1]. Lower value means it will take longer / more words for user to interrupt agent, while higher value means it's easier for user to interrupt agent.

If unset, default value 1 will apply. When this is set to 0.1, agent would never be interrupted.

webhook_url
string

URL for webhook notifications. They will be sent when the agent finishes a call, from API calls, Inbound calls, Campaigns calls or Widgets calls.

conversation_purpose
string

The purpose of conversations for this agent

prompt
string

The prompt template for the agent

voice_speed
number

Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower speech, while higher value means faster speech rate. If unset, default value 1 will apply.

voice_temperature
number

Controls how stable the voice is. Value ranging from [0,2]. Lower value means more stable, and higher value means more variant speech generation. If unset, default value 1 will apply.

volume
number

If set, will control the volume of the agent. Value ranging from [0,2]. Lower value means quieter agent speech, while higher value means louder agent speech. If unset, default value 1 will apply.

post_call_analysis_data
array

Configuration for post-call analysis

tools
array

List of tools available to the agent

Response

200
application/json
Agent updated successfully
statusCode
integer

HTTP status code

data
object