Skip to main content
POST
/
v1
/
senders
/
{senderId}
/
agent
Create agent
curl --request POST \
  --url https://api.zavu.dev/v1/senders/{senderId}/agent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Customer Support",
  "provider": "openai",
  "model": "gpt-4o-mini",
  "systemPrompt": "You are a helpful customer support agent. Be friendly and concise.",
  "apiKey": "sk-..."
}
'
{
  "agent": {
    "id": "agent_abc123",
    "senderId": "sender_12345",
    "name": "Customer Support Agent",
    "enabled": true,
    "provider": "openai",
    "model": "gpt-4o-mini",
    "systemPrompt": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "contextWindowMessages": 10,
    "includeContactMetadata": true,
    "maxTokens": 123,
    "temperature": 123,
    "triggerOnChannels": [
      "sms",
      "whatsapp"
    ],
    "triggerOnMessageTypes": [
      "text"
    ],
    "stats": {
      "totalInvocations": 123,
      "totalTokensUsed": 123,
      "totalCost": 123
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

senderId
string
required

Body

application/json
name
string
required
Maximum string length: 100
provider
enum<string>
required

LLM provider for the AI agent.

Available options:
openai,
anthropic,
google,
mistral,
zavu
model
string
required
systemPrompt
string
required
Maximum string length: 10000
apiKey
string

API key for the LLM provider. Required unless provider is 'zavu'.

contextWindowMessages
integer
default:10
Required range: 1 <= x <= 50
includeContactMetadata
boolean
default:true
maxTokens
integer
Required range: 1 <= x <= 4096
temperature
number
Required range: 0 <= x <= 2
triggerOnChannels
string[]
triggerOnMessageTypes
string[]

Response

Agent created.

agent
object
required

AI Agent configuration for a sender.