Back to Documentation

API Reference

Complete REST API documentation for the Inbox messaging platform.

Authentication

All API requests require authentication using your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Base URL: https://api.getinbox.app/v1

Send Message

POST /send

Send a message to one or more recipients. Supports various message types including OTP, delivery notifications, transactions, and events.

Request Body

{
  "to": "+15551234567",
  "type": "otp",
  "body": {
    "code": "123456",
    "purpose": "signin",
    "expires_at": "2025-01-15T10:30:00Z"
  }
}

Parameters

ParameterTypeRequiredDescription
tostringYesRecipient phone number in E.164 format
typestringYesMessage type: otp, delivery, transaction, event
bodyobjectYesMessage content (varies by type)

Response

{
  "id": "msg_1234567890",
  "status": "sent",
  "to": "+15551234567",
  "created_at": "2025-01-15T10:25:00Z"
}

Bulk Send

POST /send/bulk

Send messages to multiple recipients in a single request. Maximum 1000 recipients per request.

Request Body

[
  {
    "to": "+15551234567",
    "type": "otp",
    "body": {
      "code": "123456",
      "purpose": "signin",
      "expires_at": "2025-01-15T10:30:00Z"
    }
  },
  {
    "to": "+15559876543",
    "type": "delivery",
    "body": {
      "order_id": "A-123",
      "status": "shipped",
      "tracking_url": "https://fedex.com/track/123456"
    }
  }
]

Response

{
  "batch_id": "batch_1234567890",
  "total": 2,
  "accepted": 2,
  "rejected": 0,
  "messages": [
    {
      "id": "msg_1234567890",
      "status": "sent",
      "to": "+15551234567"
    },
    {
      "id": "msg_1234567891",
      "status": "sent",
      "to": "+15559876543"
    }
  ]
}

Get Message

GET /messages/{id}

Retrieve details about a specific message, including delivery status and read receipts.

Response

{
  "id": "msg_1234567890",
  "to": "+15551234567",
  "type": "otp",
  "status": "delivered",
  "body": {
    "code": "123456",
    "purpose": "signin",
    "expires_at": "2025-01-15T10:30:00Z"
  },
  "created_at": "2025-01-15T10:25:00Z",
  "delivered_at": "2025-01-15T10:25:03Z",
  "read_at": "2025-01-15T10:25:15Z"
}

List Messages

GET /messages

Retrieve a paginated list of messages with optional filtering.

Query Parameters

ParameterTypeDescription
limitintegerNumber of messages to return (1-100, default: 20)
offsetintegerNumber of messages to skip (default: 0)
typestringFilter by message type
statusstringFilter by status: sent, delivered, read, failed

Response

{
  "messages": [
    {
      "id": "msg_1234567890",
      "to": "+15551234567",
      "type": "otp",
      "status": "delivered",
      "created_at": "2025-01-15T10:25:00Z"
    }
  ],
  "total": 1,
  "limit": 20,
  "offset": 0,
  "has_more": false
}

Error Codes

CodeStatusDescription
400Bad RequestInvalid request format or missing required fields
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions or rate limit exceeded
404Not FoundMessage or resource not found
422Unprocessable EntityInvalid phone number or message content
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error, please try again

Rate Limits

Default Limits

  • 5,000 messages/month - Free tier
  • 1000 requests/minute - API calls
  • 10 requests/second - Per endpoint

Rate limit headers are included in all responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Official SDKs

Node.js

npm install @inbox/node
View on GitHub

Python

pip install inbox-python
View on GitHub

Go

go get github.com/inbox/inbox-go
View on GitHub

C#

dotnet add package Inbox.Net
View on GitHub