Complete REST API documentation for sending and receiving SMS messages
https://mainlinetext.com/api
All protected endpoints require a Bearer token in the Authorization header:
Authorization: Bearer your_token_here
POST /api/register
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com",
"password": "password123",
"password_confirmation": "password123",
"company_name": "Acme Corp",
"package_type": "bronze"
}
POST /api/login
Content-Type: application/json
{
"email": "john@example.com",
"password": "password123"
}
POST /api/logout
Authorization: Bearer your_token_here
POST /api/sms/send
Authorization: Bearer your_token_here
Content-Type: application/json
{
"to": "+1234567890",
"message": "Hello from SMS API!",
"from_number": "+1987654321"
}
GET /api/sms
Authorization: Bearer your_token_here
GET /api/sms/phone-numbers
Authorization: Bearer your_token_here
GET /api/contacts
Authorization: Bearer your_token_here
POST /api/contacts
Authorization: Bearer your_token_here
Content-Type: application/json
{
"name": "John Doe",
"phone": "+1234567890",
"email": "john@example.com"
}
POST /api/billing/payment-intent
Authorization: Bearer your_token_here
Content-Type: application/json
{
"package_type": "bronze"
}
POST /api/billing/subscription
Authorization: Bearer your_token_here
Content-Type: application/json
{
"payment_method_id": "pm_1234567890",
"package_type": "bronze"
}
Configure these URLs in your SMS provider dashboard:
https://mainlinetext.com/api/webhooks/flowroute
https://mainlinetext.com/api/webhooks/twilio
https://mainlinetext.com/api/webhooks/vonage
https://mainlinetext.com/api/webhooks/stripe
{
"success": true,
"data": {
"id": 1,
"message": "SMS sent successfully",
"status": "sent"
}
}
{
"success": false,
"error": "Invalid phone number format",
"message": "Please provide a valid phone number"
}
API Rate Limit: 100 requests per minute per tenant
SMS Rate Limit: Based on your subscription plan (Bronze: 100/month, Silver: 1000/month, Gold: Unlimited)
Need help with the API? Contact our support team or check the documentation.