Technical Reference

Developer-focused runbook for real integrations: endpoint, payload, response and operational behavior.

Integration TL;DR

  • Base URL: https://backend.sendeasy.app
  • Auth: Authorization: Bearer <token>
  • Formats: application/json and multipart/form-data
  • Many flows are queued asynchronously
  • Treat error as stable machine contract

Main send endpoint

POST /api/messages/send

curl --location 'https://backend.sendeasy.app/api/messages/send' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer CHANNEL_TOKEN' \
  --data '{
    "number": "5511999999999",
    "body": "Hello from integration"
  }'

Typical response:

{
  "message": "Message queued successfully"
}

WABA quick reference

Prefix:

/api/v1/waba/:whatsappId

Examples:

  • GET /templates
  • POST /send
  • POST /send-text
  • POST /send-image
  • POST /send-document
  • POST /marketing-lite/send

Email API quick reference

Transactional email from the email that owns the token (each project email has its own, in Channels → Email), 1 email credit per send:

  • POST /api/v1/email/send — body { to, subject, html | text, fromName? }
  • GET /api/v1/email/health — is the token's email verified? (no credit)

Full reference at /en/server/email.

Bots API quick reference

Text generation, PDF extraction and knowledge base search, 1 bot credit per generation (the same balance as the WhatsApp support bot). The prompt lives in the bot (botId); no credit without balance answers 402 ERR_NO_BOT_CREDITS:

  • POST /api/v1/ai/completion — body { prompt, botId | instructions, responseFormat? }
  • POST /api/v1/ai/extract — multipart, file field (PDF up to 25 MB)
  • POST /api/v1/ai/search — body { botId, query, topK? }; retrieval only (no credit)
  • GET /api/v1/ai/health — is the AI service up and is there balance? (no credit)

Full reference at /en/server/bots.

Webhook quick reference

Payload shape sent to your webhook URL:

{ event, channel, data, channelId }

Example:

{
  "event": "messages.upsert",
  "channel": "whatsapp",
  "data": {},
  "channelId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Error strategy

function normalizeApiError(status, body) {
  return {
    status,
    code: body?.error || 'UNKNOWN_ERROR',
    message: body?.message || null,
  }
}

Essa informação foi útil?