Send an email/SMS via this ecosystem's providers — freeform or template (owner/admin)

Authenticate every request with Authorization: Bearer <token> — a JWT or API token.

Download OpenAPI JSON
Overview
POST/messaging/ecosystems/{id}/sendmessaging

Send an email/SMS via this ecosystem's providers — freeform or template (owner/admin)

Create a record in send.

Auth: bearerAuth — calls run as the authenticated user.

Parameters
  • idpathstring
Request body

application/json · optional

  • userIdstring

    Target customer id (within this ecosystem)

  • channel"email" | "sms"
  • subjectoptionalstring

    Email subject (freeform)

  • bodyoptionalstring

    Freeform message body

  • templateIdoptionalstring

    Template id (alternative to body)

  • templateVarsoptionalobject

    Template placeholder values

  • recipientoptionalstring

    Override recipient; required for SMS, optional for email

Example
{
  "userId": "string",
  "channel": "email",
  "subject": "string",
  "body": "string",
  "templateId": "string",
  "templateVars": {},
  "recipient": "string"
}
Responses
200

Sent

  • status"sent" | "failed"
  • providerIdoptionalstring

    Provider message id (on success)

  • erroroptionalstring

    Failure reason (on failure)

Example
{
  "status": "sent",
  "providerId": "string",
  "error": "string"
}
400

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
401

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
403

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
404

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
422

Send failed (logged)

  • status"sent" | "failed"
  • providerIdoptionalstring

    Provider message id (on success)

  • erroroptionalstring

    Failure reason (on failure)

Example
{
  "status": "sent",
  "providerId": "string",
  "error": "string"
}
Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/messaging/ecosystems/{id}/send" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "userId": "string",
  "channel": "email",
  "subject": "string",
  "body": "string",
  "templateId": "string",
  "templateVars": {},
  "recipient": "string"
}'
JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/messaging/ecosystems/{id}/send", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: "{\n  \"userId\": \"string\",\n  \"channel\": \"email\",\n  \"subject\": \"string\",\n  \"body\": \"string\",\n  \"templateId\": \"string\",\n  \"templateVars\": {},\n  \"recipient\": \"string\"\n}",
});
const data = await res.json();