[POST] Create
Gera uma nova mensagem.
Requisição
curl --location 'https://api.zaia.app/v1.1/api/external-generative-message/create' \
--header 'Authorization: Bearer <your_api_key_here>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": 123,
"externalGenerativeChatId": 12345,
"externalGenerativeChatExternalId": "zaiaChat777",
"prompt": "Hi! I need help...",
"streaming": false,
"asMarkdown": false,
"custom": {
"whatsapp": "11999999999"
}
}'
Headers (Cabeçalhos)
Chave
Tipo
Exemplo
Obrigatório
Authorization
String
Bearer <sua chave aqui>
✓
Body (Corpo)
Chave
Tipo
Exemplo
Obrigatório
prompt
String
Hi! I need help...
✓
externalGenerativeChatId
Number
123
externalGenerativeChatExternalId
String
zaiaChat777
streaming
Boolean
true
agentId
Number
456
✓
asMarkdown
Boolean
false
custom
Record<string, string | number | boolean>
{"whatsapp": "11999999999"}
Respostas:
{
"createdAt": "2024-02-05T20:46:29.125Z",
"externalGenerativeChatId": 123,
"id": 123,
"text": "Hi! I am the Zaian Assistant! How can I help?",
"chatStage": {
"condition": "user expresses interest in learning about artificial intelligence",
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "AI Introduction",
"objective": "provide a brief overview of artificial intelligence and its applications"
},
"extractedData": {
"userEmail": "hi@zaia.app"
},
"files": [{
"data": "base64 here!",
"name": "file name",
"type": "image/png"
}]
}
Atualizado