SMS Nexus API Documentation

Integrate SMS messaging into your applications with our simple, powerful REST API.

REST API JSON Bearer Auth

Authentication

All API requests require authentication using a Bearer token. You can generate API tokens from your dashboard under the API Keys section.

Include your token in the Authorization header of every request:

Header
Authorization: Bearer your-api-token-here

Base URL

All API endpoints are relative to the following base URL:

https://www.smsnexus.net/api
POST

/api/sms/send

Send an SMS or MMS message to a recipient. Requires a valid phone number in your account and sufficient credit balance.

Request Body

Parameter Type Required Description
from string Yes Your phone number (E.164 format)
to string Yes Recipient phone number (E.164 format)
message string Yes Message content (max 1600 characters)
media_url string No URL of media attachment for MMS

Example Request

curl
curl -X POST https://www.smsnexus.net/api/sms/send \
  -H "Authorization: Bearer your-api-token" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "from": "+15551234567",
    "to": "+15559876543",
    "message": "Hello from SMS Nexus!"
  }'

Example Response

200 OK
{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "id": 12345,
    "from": "+15551234567",
    "to": "+15559876543",
    "body": "Hello from SMS Nexus!",
    "status": "queued",
    "credits_used": 1,
    "created_at": "2026-03-08T12:00:00Z"
  }
}
GET

/api/balance

Retrieve your current credit balance.

Example Request

curl
curl -X GET https://www.smsnexus.net/api/balance \
  -H "Authorization: Bearer your-api-token" \
  -H "Accept: application/json"

Example Response

200 OK
{
  "success": true,
  "data": {
    "credits": 5000,
    "currency": "credits",
    "plan": "Professional",
    "credits_used_today": 127
  }
}
GET

/api/messages

Retrieve a paginated list of messages. Supports filtering by status, direction, and date range.

Query Parameters

Parameter Type Description
page integer Page number (default: 1)
per_page integer Items per page (default: 25, max: 100)
status string Filter by status: queued, sent, delivered, failed
direction string Filter by direction: outbound, inbound

Example Request

curl
curl -X GET "https://www.smsnexus.net/api/messages?page=1&per_page=25&status=delivered" \
  -H "Authorization: Bearer your-api-token" \
  -H "Accept: application/json"

Example Response

200 OK
{
  "success": true,
  "data": [
    {
      "id": 12345,
      "from": "+15551234567",
      "to": "+15559876543",
      "body": "Hello!",
      "direction": "outbound",
      "status": "delivered",
      "credits_used": 1,
      "created_at": "2026-03-08T12:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 10,
    "per_page": 25,
    "total": 250
  }
}
GET

/api/phone-numbers

List all phone numbers associated with your account, including their status and capabilities.

Example Request

curl
curl -X GET https://www.smsnexus.net/api/phone-numbers \
  -H "Authorization: Bearer your-api-token" \
  -H "Accept: application/json"

Example Response

200 OK
{
  "success": true,
  "data": [
    {
      "id": 1,
      "number": "+15551234567",
      "carrier": "bulkvs",
      "capabilities": ["sms", "mms"],
      "status": "active",
      "created_at": "2026-01-15T10:30:00Z"
    }
  ]
}
GET

/api/conversations

List all conversations (message threads) in your account. Each conversation represents a unique pair of sender and recipient numbers.

Example Request

curl
curl -X GET https://www.smsnexus.net/api/conversations \
  -H "Authorization: Bearer your-api-token" \
  -H "Accept: application/json"

Example Response

200 OK
{
  "success": true,
  "data": [
    {
      "id": 42,
      "phone_number": "+15551234567",
      "contact_number": "+15559876543",
      "last_message": "Thanks for your order!",
      "last_message_at": "2026-03-08T11:45:00Z",
      "unread_count": 0,
      "message_count": 15
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 3,
    "per_page": 25,
    "total": 67
  }
}

Webhooks

Register webhook URLs to receive real-time notifications for incoming messages, delivery status updates, and other events.

POST

/api/webhooks

Register a new webhook endpoint.

Request Body

Parameter Type Description
url string The webhook endpoint URL (must be HTTPS)
events array Events to subscribe to: message.received, message.delivered, message.failed

Example Request

curl
curl -X POST https://www.smsnexus.net/api/webhooks \
  -H "Authorization: Bearer your-api-token" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "url": "https://yourapp.com/webhooks/sms",
    "events": ["message.received", "message.delivered"]
  }'

Example Response

201 Created
{
  "success": true,
  "data": {
    "id": 5,
    "url": "https://yourapp.com/webhooks/sms",
    "events": ["message.received", "message.delivered"],
    "active": true,
    "created_at": "2026-03-08T12:00:00Z"
  }
}
GET

/api/webhooks

List all registered webhooks.

Example Request

curl
curl -X GET https://www.smsnexus.net/api/webhooks \
  -H "Authorization: Bearer your-api-token" \
  -H "Accept: application/json"

Example Response

200 OK
{
  "success": true,
  "data": [
    {
      "id": 5,
      "url": "https://yourapp.com/webhooks/sms",
      "events": ["message.received", "message.delivered"],
      "active": true,
      "created_at": "2026-03-08T12:00:00Z"
    }
  ]
}
DELETE

/api/webhooks/{id}

Delete a registered webhook by its ID.

Example Request

curl
curl -X DELETE https://www.smsnexus.net/api/webhooks/5 \
  -H "Authorization: Bearer your-api-token" \
  -H "Accept: application/json"

Example Response

200 OK
{
  "success": true,
  "message": "Webhook deleted successfully"
}

Rate Limits

API requests are rate-limited to ensure fair usage and platform stability. Rate limit information is included in response headers.

Endpoint Type Limit Window
General endpoints (GET requests) 60 requests Per minute
Message sending (POST /api/sms/send) 30 requests Per minute

Rate Limit Headers

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1709892000

Error Codes

The API uses standard HTTP status codes to indicate success or failure. Error responses include a JSON body with details.

Code Status Description
401 Unauthorized Missing or invalid API token. Ensure you include a valid Bearer token in the Authorization header.
403 Forbidden You do not have permission to access this resource. This may occur if your account is suspended or the resource belongs to another tenant.
404 Not Found The requested resource does not exist. Verify the endpoint URL and resource ID.
422 Validation Error The request body contains invalid data. Check the errors object in the response for specific field-level validation messages.
429 Too Many Requests Rate limit exceeded. Wait for the rate limit window to reset. Check the X-RateLimit-Reset header for the reset timestamp.

Error Response Format

422 Validation Error
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "to": ["The to field is required."],
    "message": ["The message field is required."]
  }
}

Need Help with Integration?

Our team is here to help you get started with the API.