Skip to content

paramsSchema & agentParams

Each agent declares, in its paramsSchema, the information it needs about the person it calls: their name, an amount, a due date, and so on. When you create a campaign, you send that information for each recipient in agentParams. The agent then uses it in the conversation, for example “คุณสมชายมียอดค้างชำระ 1,500 บาทค่ะ”.

You read it from List agents. It is the schema of the agent’s published version. Each key is a parameter name:

{
"customer_name": { "type": "text", "required": true, "description": "Customer first name" },
"amount_due": { "type": "number", "required": true, "description": "Outstanding amount in baht" },
"is_vip": { "type": "boolean", "required": false }
}
Property Description
type text, number or boolean.
required If true, every recipient must include this key.
description What the value means.
default Optional. The value the agent uses when a recipient’s agentParams doesn’t have this key.

For the schema above:

✅ Valid
{ "tel": "0812345678", "customerName": "Somchai", "agentParams": { "customer_name": "Somchai", "amount_due": 1500 } }
❌ Invalid
{ "tel": "0812345678", "agentParams": { "customer_name": "Somchai", "amount_due": "1500" } }

The invalid example fails because amount_due is a string ("1500"), but the schema says number. The error is Field amount_due must be a number, got string.

type JSON you must send Example
text a string "Somchai", "2026-10-05"
number a number, not in quotes 1500, 12.5
boolean true or false, not in quotes true
  • Types are checked only for required keys. Optional keys (such as is_vip) aren’t checked, but send the right type anyway, or the agent may misread the value.
  • Extra keys that aren’t in the schema are allowed. They are stored and returned, but the agent may not use them.
  • If a recipient is invalid, the whole create request fails and nothing is created. See Create a campaign → Errors.