Messaging
Let your agent send a text message or an email with one call. Autessa sends it from your company's phone number or email setup, and keeps a record.
Agents built in Autessa can already send SMS and email with tools.
When to use it
- Your agent confirms an appointment or sends a link by text.
- Your agent emails a summary or a receipt after a conversation.
- You want SMS without signing up for a separate carrier account.
Quickstart
- Get a free API key. New accounts get $100 of free credits for your first month, no card needed. This developer key works for this feature; see Keys.
- Set up a phone number for SMS in the Builder.
- Call the built-in
send_smsorsend_emailtool.
- curl
- Python
- TypeScript
- Java
curl -X POST https://api.autessa.com/clients/agent-tools/send_sms/invoke \
-H "Authorization: $AUTESSA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {"to": "+12065550100", "body": "Your appointment is confirmed for 3 PM tomorrow."}}'
import os
import requests
res = requests.post(
"https://api.autessa.com/clients/agent-tools/send_email/invoke",
headers={"Authorization": os.environ["AUTESSA_API_KEY"]},
json={"input": {"to": "customer@example.com", "subject": "Your receipt", "body": "Thanks for your order."}},
timeout=30,
)
print(res.json()) # {"output": ..., "isError": false}
const res = await fetch("https://api.autessa.com/clients/agent-tools/send_sms/invoke", {
method: "POST",
headers: { Authorization: process.env.AUTESSA_API_KEY!, "Content-Type": "application/json" },
body: JSON.stringify({ input: { to: "+12065550100", body: "Your order has shipped." } }),
});
console.log(await res.json());
var body = """
{"input": {"to": "+12065550100", "body": "Your order has shipped."}}
""";
var req = java.net.http.HttpRequest.newBuilder(java.net.URI.create(
"https://api.autessa.com/clients/agent-tools/send_sms/invoke"))
.header("Authorization", System.getenv("AUTESSA_API_KEY"))
.header("Content-Type", "application/json")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString(body))
.build();
System.out.println(java.net.http.HttpClient.newHttpClient()
.send(req, java.net.http.HttpResponse.BodyHandlers.ofString()).body());
How it works
| Tool | Input |
|---|---|
send_sms | to (E.164 number), body, optional from (defaults to your company's number). |
send_email | to, subject, body, optional html (true when body is HTML). |
- Messages go through your company's tools, so consent rules and opt-outs you set up still apply. See SMS consent.
- When your firewall policy checks tool calls, it checks these too. New email domains can be held for approval.
- The response is
outputplusisError.
Libraries
| Language | Package | Call |
|---|---|---|
| Python | autessa-messaging | Messaging().send_sms(to, body, from_=None), send_email(to, subject, body, html=False) |
| TypeScript | @autessa/messaging | new Messaging().sendSms({ to, body, from? }), sendEmail({ to, subject, body, html? }) |
| Java | com.autessa:autessa-messaging | Messaging.fromEnv().sendSms(to, body), sendEmail(to, subject, body) |
from autessa.messaging import Messaging
messaging = Messaging() # reads AUTESSA_API_KEY
messaging.send_sms(to="+12065550100", body="Your appointment is confirmed for 3 PM tomorrow.")
Each call takes an optional session ID (session_id in Python, { sessionId } in TypeScript) to tie the message to a conversation. If the message tool reports a problem, such as no SMS number set up, the call raises an error with the reason: AgentToolError in Python, ToolError in TypeScript, ToolInvocationException in Java.
The libraries are in private preview and not yet on PyPI, npm, or Maven Central. Install from GitHub as each library's README describes, for example:
pip install "autessa-core @ git+https://github.com/Autessa-Inc/autessa-python#subdirectory=packages/autessa-core"
pip install "autessa-messaging @ git+https://github.com/Autessa-Inc/autessa-python#subdirectory=packages/autessa-messaging"
Limits
- SMS needs a number with SMS turned on, and US numbers need carrier registration. See SMS setup.
- Messages are billed to your company. See Billing.
API reference
Benchmarks
None for messaging. See Benchmarks.
Example
- Spring AI bank assistant: a Spring AI assistant that can send SMS and email with the built-in tools.
- Vercel AI chat: a Next.js chat that sends email with the built-in
send_emailtool.