Create agent
Creates a new AI agent. Costs 10 credits per agent and includes initial website training when companyUrl or companyInfo.domain is provided.
The first agent created becomes the default agent automatically.
Calendar booking settings and selected page controls are not public API fields. Add booking links or other scheduling context to persona.customInstructions; website page discovery is automatic.
curl -X POST "https://api.sendkit.ai/v1/agents" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"name": "Sales Agent"
}'
import requests
import json
url = "https://api.sendkit.ai/v1/agents"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
data = {
"name": "Sales Agent"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.sendkit.ai/v1/agents", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"name": "Sales Agent"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "Sales Agent"
}`)
req, err := http.NewRequest("POST", "https://api.sendkit.ai/v1/agents", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
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')
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.body = '{
"name": "Sales Agent"
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"_id": "664a1b2c3d4e5f6a7b8c9d10",
"name": "Enterprise Sales Agent",
"userId": "user_123",
"workspaceId": "ws_123",
"companyInfo": {
"name": "Acme Inc",
"description": "B2B SaaS platform for sales automation"
},
"persona": {
"tone": "professional",
"role": "senior account executive",
"communicationStyle": "concise",
"customInstructions": "Always mention our free trial. Focus on ROI and time savings."
},
"isDefault": false,
"isActive": true,
"createdAt": "2024-06-05T10:00:00.000Z",
"updatedAt": "2024-06-05T10:00:00.000Z"
}
}
{
"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 (agent creation costs 10 credits)",
"code": 402
}
/v1/agents
Target server for requests. Edit to use your own host.
Platform API key (sk_user_...) or Workspace API key (sk_...)
The media type of the request body
Agent name (required, trimmed)
Company context for the agent
Company website URL or domain used for automatic website training
Agent personality configuration
Set the new agent as the workspace default
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_...)
Body
Agent name (required, trimmed)
Company context for the agent
Company website URL or domain used for automatic website training
Agent personality configuration
Set the new agent as the workspace default