Create Agent
Create a new agent in your workspace.
POST https://api.platica.mx/v1/agents Request body
{
"name": "Mi Asistente",
"channel": "whatsapp",
"systemPrompt": "Eres un asistente especializado en atención al cliente...",
"channelId": ["channel-123"],
"phoneNumber": ["+1234567890"],
"imageUrl": "/images/mi-asistente.png",
"status": "active",
"owners": ["soporte@miempresa.com"],
"supportInformation": {
"supportPhone": "+1234567890",
"supportEmail": "soporte@miempresa.com",
"supportAddress": "Calle Principal #123",
"outOfServiceBehavior": "limited",
"serviceHours": {
"monday": {
"availability": "Abierto",
"start": "9:00am",
"end": "5:00pm"
},
"tuesday": {
"availability": "Abierto",
"start": "9:00am",
"end": "5:00pm"
},
"saturday": {
"availability": "Cerrado",
"start": "Cerrado",
"end": "Cerrado"
},
"sunday": {
"availability": "Cerrado",
"start": "Cerrado",
"end": "Cerrado"
}
}
},
"assistanceTriggers": "",
"assistanceEnabled": true,
"recallLastConversation": false,
"enableFileAttachments": true,
"workingMessage": {
"enabled": true,
"trigger": {
"type": "toolCallCount",
"minToolCalls": 2
},
"message": {
"enabled": true,
"mode": "fixed",
"fixedText": "Dame un momento, estoy procesando tu solicitud…"
},
"sticker": {
"enabled": false
}
}
} Body parameters
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
name | string | Agent name (1-100 characters) | ✓ | — |
channel | string | Agent platform | — | "whatsapp" |
systemPrompt | string | System prompt. If not empty, the version history is initialized and activePromptId is set. | — | "" |
channelId | string | array | Communication channel ID(s). May be a single internal ID or an array of IDs. | — | null |
phoneNumber | string | array | Phone number(s) in international format, or an array of numbers. | — | null |
imageUrl | string | Agent image URL | — | "/images/campaignCreator.png" |
status | string | Agent state | — | "inactive" |
supportInformation | object | Support information and hours. Details below. | — | Default configuration (see below) |
assistanceTriggers | string | Human-assist triggers | — | "" |
waitMessage | string | Wait message | — | "" |
assistanceEnabled | boolean | Whether human assistance is enabled | — | true |
recallLastConversation | boolean | Memory across conversations: injects the summary of the last conversation into the prompt | — | false |
enableFileAttachments | boolean | File reading: the agent accepts and processes attachments (images, audios, documents) | — | — |
disableContextSummarization | boolean | Keep full history: skips automatic context compaction | — | — |
workingMessage | object | "Working" message sent to the customer when the agent is busy calling tools. See the full shape below. | — | — |
owners | array | List of responsible-user emails | — | [] |
{
"supportAddress": "",
"supportEmail": null,
"supportPhone": null,
"outOfServiceBehavior": "limited",
"serviceHours": {
"monday": { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
"tuesday": { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
"wednesday": { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
"thursday": { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
"friday": { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
"saturday": { "availability": "Cerrado", "start": "Cerrado", "end": "Cerrado" },
"sunday": { "availability": "Cerrado", "start": "Cerrado", "end": "Cerrado" }
}
} | Value | Description |
|---|---|
whatsapp | WhatsApp Business channel |
telegram | Telegram channel |
instagram | Instagram Direct channel |
facebook | Facebook Messenger channel |
sms | SMS messaging channel |
Configuration of the wait message sent to the customer when the agent is processing a tool sequence that may take a while.
{
"enabled": true,
"trigger": {
"type": "toolCallCount",
"minToolCalls": 2
},
"message": {
"enabled": true,
"mode": "fixed",
"fixedText": "Dame un momento, estoy procesando tu solicitud…"
},
"sticker": {
"enabled": false
}
} enabled (boolean)
Turns the wait-message delivery on or off.
trigger (object) — when it fires
| Field | Type | Description |
|---|---|---|
type | "toolCallCount" \| "toolName" \| "any" | Trigger mode. See table below. |
minToolCalls | integer (1-10) | Only applies when type is "toolCallCount" or "any". How many tools the agent must have called before sending the message. |
toolNames | string[] | Only applies when type is "toolName" or "any". Tool names that trigger the message as soon as they are invoked. |
match | "exact" \| "prefix" | How to compare against toolNames. Default "exact". With "prefix", e.g. "api_" activates for api_get_orders, api_search, etc. |
type | Meaning |
|---|---|
toolCallCount | Fires after N tool calls (uses minToolCalls). |
toolName | Fires when the agent calls a tool whose name is in toolNames. |
any | Fires on either of the two conditions above. |
message (object) — what is sent
| Field | Type | Description |
|---|---|---|
enabled | boolean | Whether to send a text message (you can disable it and send only a sticker). |
mode | "fixed" \| "ai" | "fixed" sends literal text; "ai" generates it with AI based on a prompt. |
fixedText | string | Literal text to send (when mode is "fixed"). |
aiPrompt | string | Instruction for the AI that generates the message (when mode is "ai"). |
sticker (object) — optional sticker
| Field | Type | Description |
|---|---|---|
enabled | boolean | Whether a sticker is sent alongside the message. |
url | string | Sticker URL (when enabled is true). |
Response
{
"status": "success",
"message": "Agent created successfully",
"data": {
"id": "agent_abc123"
}
} Notes
channelIdandphoneNumbercan be sent as a string or an array- in the agent response they are always returned inside
comunicationChannelas arrays ownersmust be sent as valid emails of users belonging to the workspace