Generate AI reply
Uses the agent's persona, knowledge base, and the full conversation thread to generate a ready-to-send reply via Claude. Costs 3 credits per call.
The agent's role, tone, communication style, company description, and custom instructions are combined with the lead's context and conversation history to produce a natural reply optimized for cold email sales psychology.
curl -X POST "https://api.sendkit.ai/v1/agents/example_string/generate-reply" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"conversationId": "664a1b2c3d4e5f6a7b8c9d20"
}'
import requests
import json
url = "https://api.sendkit.ai/v1/agents/example_string/generate-reply"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"conversationId": "664a1b2c3d4e5f6a7b8c9d20"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.sendkit.ai/v1/agents/example_string/generate-reply", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"conversationId": "664a1b2c3d4e5f6a7b8c9d20"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"conversationId": "664a1b2c3d4e5f6a7b8c9d20"
}`)
req, err := http.NewRequest("POST", "https://api.sendkit.ai/v1/agents/example_string/generate-reply", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.sendkit.ai/v1/agents/example_string/generate-reply')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-Api-Key'] = 'YOUR_API_KEY'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"conversationId": "664a1b2c3d4e5f6a7b8c9d20"
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"response": "Hey Jane - saw Example Corp just opened a second office in Austin. When companies scale that fast, outbound usually becomes a bottleneck.
We helped Acme's SDR team 3x their pipeline in 6 weeks without adding headcount.
Worth a 15-min call to see if it fits?
John
AE at SendKit",
"agentUsed": {
"id": "664a1b2c3d4e5f6a7b8c9d0e",
"name": "Sales Agent"
},
"debug": {
"model": "claude-sonnet-4-5-20250929",
"inputTokens": 1250,
"outputTokens": 89,
"cost": "$0.001710",
"creditsCharged": 3
}
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Error",
"message": "Insufficient credits",
"code": 402
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
/v1/agents/{id}/generate-replyPlatform API key (sk_user_...) or Workspace API key (sk_...)
Resource ID
The media type of the request body
ID of the inbox conversation to generate a reply for
Additional context or instructions for the reply (e.g. "They asked about pricing — mention the 30-day trial")
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)
Bearer token. API key as Bearer token
Path Parameters
Resource ID
Body
ID of the inbox conversation to generate a reply for
Additional context or instructions for the reply (e.g. "They asked about pricing — mention the 30-day trial")
Responses
Last updated today
Built with Documentation.AI