Messages

These endpoints let you send SMS messages and read the inbound messages received on your Guava numbers — for example, to poll your own inbox for replies.

All requests require an Authorization: Bearer YOUR_GUAVA_API_KEY header. See the API Overview for details.

Send an SMS

POST /v1/send-sms

Send a single SMS from one of your Guava numbers.

Request body

A JSON object with the following fields:

NameTypeRequiredDescription
from_numberstringYesOne of your Guava numbers, in E.164 format. Must have SMS enabled.
to_numberstringYesThe recipient's number, in E.164 format.
messagestringYesThe message body to send.

Response

On success, returns 201 Created:

{
  "status": "sent"
}

Errors

StatusDescription
400The from_number isn't owned by your organization, or doesn't have SMS configured.
401Invalid authentication
500The upstream carrier failed to accept the message.

Example

curl -X POST https://api.goguava.ai/v1/send-sms \
  -H 'Authorization: Bearer YOUR_GUAVA_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"from_number": "+15551230001", "to_number": "+15551234567", "message": "Hello from Guava!"}'

Sending SMS requires your organization to complete SMS brand and campaign registration. See Outbound & SMS Permissions.


List inbound messages

GET /v1/messages

List the inbound messages received on one of your Guava numbers, oldest first. Poll this endpoint to watch for replies.

Parameters

NameTypeRequiredDescription
to_numberstringYesThe Guava number whose inbox you want to read, in E.164 format. Must be owned by your organization.
startstringNoOnly return messages received at or after this time (ISO 8601, e.g. 2026-06-09T00:00:00Z).
from_numberstringNoOnly return messages sent from this number, in E.164 format.
modalitystringNoOnly return messages on this channel. Currently "sms".
limitintegerNoMaximum number of messages to return, between 1 and 100. Defaults to 50.

Response

A JSON object with the following fields:

FieldTypeDescription
messagesarrayThe matching messages, oldest first.
has_morebooleantrue if more messages match than were returned in this response.

Each message has the following fields:

FieldTypeDescription
idstringUnique ID of the message
from_numberstringThe number that sent the message
to_numberstringYour Guava number that received the message
contentstringThe message body
received_atstringWhen the message was received, in ISO 8601 format
modalitystringThe channel the message arrived on. Currently "sms".
directionstringAlways "inbound"

Pagination

Messages are returned oldest first. When has_more is true, request the next page by calling again with start set to the received_at of the last message you received. Because start is inclusive, that boundary message — and any others sharing its exact timestamp — will be returned again, so dedupe by id.

Errors

StatusDescription
400Invalid start timestamp or limit value
401Invalid authentication
404The to_number isn't owned by your organization

Example

curl -G https://api.goguava.ai/v1/messages \
  -H 'Authorization: Bearer YOUR_GUAVA_API_KEY' \
  --data-urlencode 'to_number=+15551230001' \
  --data-urlencode 'start=2026-06-09T00:00:00Z'

Sample response:

{
  "messages": [
    {
      "id": "6064ab9663dc4eb0",
      "from_number": "+15551234567",
      "to_number": "+15551230001",
      "content": "YES, see you then!",
      "received_at": "2026-06-09T00:12:04.518000+00:00",
      "modality": "sms",
      "direction": "inbound"
    }
  ],
  "has_more": false
}

The + in a phone number must be URL-encoded as %2B in query strings. The curl -G --data-urlencode form above handles this for you.

Questions? hi@goguava.ai