Skip to main content
POST
/
messages
Send Message
curl --request POST \
  --url https://api.revring.ai/v1/messages \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "to": "<string>",
  "from": "<string>",
  "agentId": "<string>",
  "messagingConnectionId": "<string>",
  "body": "<string>",
  "generate": true,
  "messages": [
    {
      "content": "<string>"
    }
  ],
  "smsPrompt": "<string>"
}
'
{
  "data": {
    "id": "<string>",
    "agentId": "<string>",
    "messagingConnectionId": "<string>",
    "callId": "<string>",
    "conversationId": "<string>",
    "channel": "sms",
    "fromNumber": "<string>",
    "toNumber": "<string>",
    "body": "<string>",
    "status": "<string>",
    "providerMessageId": "<string>",
    "generatedByLlm": true,
    "errorMessage": "<string>",
    "createdAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

x-api-key
string
header
required

API key for authentication. Generate API keys from the RevRing dashboard.

Body

application/json

Send a text. Provide exactly one of body (raw) or generate: true (AI-composed).

to
string
required

Recipient phone number in E.164, e.g. +12025550123

from
string

Optional sender number in E.164. Defaults to the agent's send-from number, or the connection's Messaging Service.

agentId
string

Agent to attribute the message to. For generation, its SMS prompt and connection are used.

messagingConnectionId
string

Connection to send through. Required if no agentId is given or the agent has no connection.

body
string

Raw message text. Use this OR generate.

Required string length: 1 - 1600
generate
boolean

If true, compose the message with AI from the SMS prompt and optional messages history.

messages
object[]

Optional inline conversation history for generation (stateless; you own the memory).

smsPrompt
string

Optional prompt override for generation. Defaults to the agent's SMS prompt.

Response

Message accepted and sent

data
object

A logged text message (sent or received).