Galadri

Communications API

Direct email, SMS, and phone-call endpoints.

Use the Communications API when your application already knows it wants to send an email, text a user, or place a phone call. These endpoints are useful for server-side orchestration, background jobs, and provider-triggered workflows that do not need the full Chat API.

Provider setup still matters

These endpoints still use the selected agent's communication credentials. Your organization must have working SendGrid and Twilio setup before direct sends can succeed, and the selected agent must have the matching built-in tool enabled:send-email-invite, send-sms, or place-call.

Endpoints

POST/v1/emails
POST/v1/sms
POST/v1/calls

Shared Context

FieldTypeDescription
agent_idstringRequired. Agent slug or ID used for credential resolution, policy, and billing.
end_user_idUUIDGaladri's internal end-user UUID. Optional for email. Required for SMS and calls unless session_id already resolves to an end user. If you only have your own user ID, resolve it through the Users API first.
session_idUUIDOptional. Useful for continuity, audit linkage, and resolving end-user context from an existing session.

POST /v1/emails

Send direct emails and calendar invites through the selected agent's email credential.

Supported actions

FieldTypeDescription
send_emailactionSend a plain email. Requires to, subject, and body_html or body_text.
send_inviteactionSend a calendar invite email. Requires to, title, and start_datetime.
cancel_inviteactionCancel a previously sent invite by schedule_id.

Email request fields

ParameterTypeDescription
agent_idrequiredstringAgent slug or ID.
actionrequired"send_email" | "send_invite" | "cancel_invite"Email action to execute.
tostringRecipient email address.
subjectstringSubject line for send_email.
body_htmlstringHTML body for send_email.
body_textstringPlain-text body for send_email.
titlestringEvent title for send_invite.
start_datetimestringISO 8601 with timezone offset for send_invite.
duration_minutesintegerOptional duration for send_invite.
locationstringOptional location for send_invite.
descriptionstringOptional event description for send_invite.
schedule_idstringRequired for cancel_invite.
end_user_idUUIDOptional internal Galadri end-user UUID for email workflows.
session_idUUIDOptional session context.
Direct email send
curl -X POST https://api.galadri.com/v1/emails \
  -H "Authorization: Bearer gld_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "main-agent",
    "action": "send_email",
    "to": "rob@example.com",
    "subject": "Service update",
    "body_text": "Your appointment is confirmed for tomorrow at 10:00 AM."
  }'
Email response
{
  "status": "success",
  "data": {
    "sent": true,
    "to": "rob@example.com",
    "subject": "Service update",
    "thread_id": null
  }
}

Email responses include a thread ID when the request includes end_user_id or a session_id that resolves to an end user.

POST /v1/sms

Send SMS or MMS directly through the selected agent's Twilio credential.

SMS request fields

ParameterTypeDescription
agent_idrequiredstringAgent slug or ID.
torequiredstringRecipient phone number. E.164 format preferred (for example "+15551234567").
messagerequiredstringMessage text.
media_urlstringOptional image URL for MMS.
thread_idstringOptional existing SMS thread ID.
end_user_idUUIDInternal Galadri end-user UUID. Required unless session_id resolves to an end user.
session_idUUIDOptional session context.
Direct SMS send
curl -X POST https://api.galadri.com/v1/sms \
  -H "Authorization: Bearer gld_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "main-agent",
    "end_user_id": "5361a22a-d4a9-4c57-b98b-c70c72f5865f",
    "to": "+15551234567",
    "message": "Your vehicle is ready for pickup."
  }'
SMS response
{
  "status": "success",
  "data": {
    "sent": true,
    "thread_id": "550e8400-e29b-41d4-a716-446655440000",
    "segments": 1,
    "has_media": false
  }
}

SMS and call context

Direct SMS and call requests require end-user context. Provide end_user_id directly or provide a session_id that already belongs to the end user.

POST /v1/calls

Initiate an outbound AI phone call through the selected agent's Twilio credential.

Call request fields

ParameterTypeDescription
agent_idrequiredstringAgent slug or ID.
torequiredstringRecipient phone number. E.164 format preferred (for example "+15551234567").
purposerequiredstringWhat the AI should discuss or accomplish on the call.
promptstringOptional call-specific prompt override.
toolsstring[]Optional subset of tool slugs the voice agent can use on this call.
end_user_idUUIDInternal Galadri end-user UUID. Required unless session_id resolves to an end user.
session_idUUIDOptional session context.
Direct call initiation
curl -X POST https://api.galadri.com/v1/calls \
  -H "Authorization: Bearer gld_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "main-agent",
    "end_user_id": "5361a22a-d4a9-4c57-b98b-c70c72f5865f",
    "to": "+15551234567",
    "purpose": "Confirm tomorrow's appointment",
    "prompt": "Your mission is to confirm the appointment and answer any follow-up questions briefly.",
    "tools": ["google-maps-search", "send-sms"]
  }'
Call response
{
  "status": "success",
  "data": {
    "initiated": true,
    "call_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Errors

Validation, missing-tool, provider, and internal errors use the standard error envelope when possible. A 402 insufficient-credit response may return a plain string error for compatibility with the chat endpoint.

Error response
{
  "error": {
    "code": "validation_error",
    "message": "Tool \"send-sms\" is not available for this agent"
  }
}

For channel behavior, inbound setup, and credential ownership, see Communications. For the main conversational entry point, see Chat API.