Real Messaging Engine

REST APIs

External systems send and query messages through the RME REST API, hosted inside Salesforce as Apex REST resources.

Base URL:

https://<my-domain>.my.salesforce.com/services/apexrest/rme/v1

Authentication

Use an OAuth 2.0 client-credentials or JWT-bearer flow against a Connected App with the api scope, running as a dedicated integration user with the RME_Integration_User permission set.

curl -X POST https://<my-domain>.my.salesforce.com/services/oauth2/token \
  -d grant_type=client_credentials \
  -d client_id=$CLIENT_ID \
  -d client_secret=$CLIENT_SECRET

POST /messages

curl -X POST "$BASE/messages" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-8815-confirmation" \
  -d '{
    "channel": "EMAIL",
    "category": "Transactional",
    "to": [{ "contactId": "0035f00000AbCdEAAV" }],
    "template": { "name": "Order_Confirmation", "language": "en_US" },
    "context": { "recordId": "8015f00000XyZAbAAL" },
    "from": { "domain": "example.com", "name": "Acme Support" },
    "schedule": { "mode": "LOCAL", "time": "09:00" }
  }'
{
  "messageId": "a0X5f000001AbCdEAK",
  "status": "SCHEDULED",
  "resolvedChannel": "EMAIL",
  "provider": "SENDGRID",
  "scheduledFor": "2026-08-04T13:00:00Z"
}

Idempotency-Key is honored for 24 hours: a repeated key returns the original result instead of sending twice.

GET /messages/{id}

{
  "messageId": "a0X5f000001AbCdEAK",
  "status": "DELIVERED",
  "channel": "EMAIL",
  "events": [
    { "type": "sent",      "at": "2026-08-04T13:00:02Z" },
    { "type": "delivered", "at": "2026-08-04T13:00:07Z" },
    { "type": "open",      "at": "2026-08-04T13:41:55Z" }
  ]
}

Other resources

MethodPathPurpose
POST/messages/bulkUp to 500 messages per request
DELETE/messages/{id}Cancel a scheduled message
GET/messages?contactId=&since=&status=Query history
GET/templates / POST /templates/{name}/renderList and preview templates
GET / POST/consentRead and record consent
GET / POST / DELETE/suppressionsManage suppression entries
POST/devicesRegister a push device
GET/healthProvider and configuration health

Errors

{
  "error": {
    "code": "NO_CONSENT",
    "message": "Recipient has opted out of MARKETING on EMAIL.",
    "messageId": null,
    "requestId": "5f0e2c1a-9b6e-4f3f-bb5a-8c1f2f4a6d21"
  }
}
CodeHTTPMeaning
INVALID_PAYLOAD400Schema validation failed
UNAUTHORIZED401Token missing, expired, or wrong scope
NO_CONSENT403Consent check blocked the send
SUPPRESSED403Recipient is on a suppression list
TEMPLATE_NOT_FOUND404No active template with that name and locale
RATE_LIMITED429Org or provider limit reached; retry after Retry-After
PROVIDER_ERROR502Provider rejected the send; failover exhausted

Rate limits

The API inherits Salesforce API limits and adds a per-org send ceiling configurable in RME Settings. Bulk endpoints count as one API call per request, not per message.

Continue to Webhooks.

Was this helpful?

Last updated 1 month ago