API Reference v1.0

PeakCampaign
API Documentation

Integrate powerful SMS messaging, sender ID management, and delivery tracking directly into your applications.

RESTful API Bearer Auth 99.9% Uptime

Authentication

All API requests require a valid Bearer token in the Authorization header. You can generate API tokens from your Developer Tools dashboard after signing in.

Every request must include these headers:

Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Content-Type: application/json

Don't have an API key? Create a free account and generate one from the Developer Tools section.

Base URL

All API endpoints are relative to the following base URL:

https://paynex.org/api

Rate Limiting

API requests are rate-limited to ensure fair usage and platform stability.

Scope Limit Window
General API 60 requests Per minute
SMS Sending Tier-based Per account plan

Rate limit headers (X-RateLimit-Remaining, X-RateLimit-Limit) are included in every response.

Response Format

All responses follow a consistent JSON structure:

{
  "status": true,
  "message": "Descriptive success message",
  "data": { }
}

Standard HTTP status codes are used:

CodeMeaning
200Success
201Created
400Bad Request
401Unauthorized
404Not Found
422Validation Error
429Too Many Requests
500Server Error

Endpoint Reference

GET /balance Get Wallet Balance

Retrieve your current wallet balance across all channels.

Parameters

No parameters required.

Code Examples

curl -X GET "https://paynex.org/api/balance" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Example Response 200

{
  "status": true,
  "message": "Wallet balance retrieved successfully",
  "data": {
    "main_balance": "11,711.00",
    "sms_balance": "0.00",
    "email_balance": "0.00",
    "whatsapp_balance": "0.00",
    "total_balance": "11,711.00",
    "currency": "NGN"
  }
}
POST /sender-id Create Sender ID

Create a new Sender ID for SMS messages. Sender IDs are pending admin approval after creation.

Parameters

NameTypeRequiredDescription
sender_id string Yes Alphanumeric only, max 11 characters

Code Examples

curl -X POST "https://paynex.org/api/sender-id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"sender_id": "YourBrand"}'

Example Response 201

{
  "status": true,
  "message": "Sender ID created successfully and pending approval",
  "data": {
    "id": 1,
    "sender_id": "YOURBRAND",
    "status": "pending",
    "created_at": "2024-01-15 10:30:00"
  }
}
GET /sender-id List Sender IDs

Retrieve all sender IDs for the authenticated user.

Parameters

No parameters required.

Code Examples

curl -X GET "https://paynex.org/api/sender-id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Example Response 200

{
  "status": true,
  "message": "Sender IDs retrieved successfully",
  "data": [
    {
      "id": 1,
      "sender_id": "YOURBRAND",
      "status": "approved",
      "declined_reason": null,
      "approved_at": "2024-01-15 12:00:00",
      "declined_at": null,
      "created_at": "2024-01-15 10:30:00"
    },
    {
      "id": 2,
      "sender_id": "MYCOMPANY",
      "status": "pending",
      "declined_reason": null,
      "approved_at": null,
      "declined_at": null,
      "created_at": "2024-01-16 09:15:00"
    }
  ]
}
GET /sender-id/{senderId}/status Sender ID Status

Check the approval status of a specific sender ID.

Path Parameters

NameTypeRequiredDescription
senderId string Yes The sender ID name (e.g., YOURBRAND)

Code Examples

curl -X GET "https://paynex.org/api/sender-id/YOURBRAND/status" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Example Response 200

{
  "status": true,
  "message": "Sender ID status retrieved successfully",
  "data": {
    "id": 1,
    "sender_id": "YOURBRAND",
    "status": "approved",
    "declined_reason": null,
    "approved_at": "2024-01-15 12:00:00",
    "declined_at": null,
    "created_at": "2024-01-15 10:30:00"
  }
}

Ready to Send Your First SMS?

Create a free account, get your API key, and start integrating in minutes.

POST /sms/send Send SMS

Send SMS messages to one or multiple recipients.

Parameters

NameTypeRequiredDescription
sender_id string Yes Your approved sender ID
recipients string Yes Comma-separated phone numbers (e.g., "08012345678,08087654321")
message string Yes Message content (max: 1000 characters)
route_id integer No SMS route ID (uses default route if not provided)

Code Examples

curl -X POST "https://paynex.org/api/sms/send" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "sender_id": "YourBrand",
    "recipients": "08012345678,08087654321",
    "message": "Hello from PeakCampaign API!"
  }'

Example Response 201

{
  "status": true,
  "message": "SMS request submitted successfully",
  "data": {
    "request_id": 123,
    "reference": "SMS-123",
    "recipients_count": 2,
    "cost": "10.00",
    "status": "pending"
  }
}
GET /sms/history Message History

Retrieve paginated SMS message history with optional filtering.

Query Parameters

NameTypeRequiredDescription
page integer No Page number (default: 1)
per_page integer No Items per page (default: 20, max: 100)
status string No Filter by: pending, processing, completed, partially_completed, failed
from_date date No Start date filter (YYYY-MM-DD)
to_date date No End date filter (YYYY-MM-DD)

Code Examples

curl -X GET "https://paynex.org/api/sms/history?page=1&per_page=20&status=completed" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Example Response 200

{
  "status": true,
  "message": "Message history retrieved successfully",
  "data": [
    {
      "id": 123,
      "reference": "SMS-123",
      "message": "Your message content",
      "recipients_count": 2,
      "status": "completed",
      "cost": "10.00",
      "created_at": "2024-01-15 10:30:00"
    }
  ],
  "pagination": {
    "total": 50,
    "per_page": 20,
    "current_page": 1,
    "last_page": 3,
    "from": 1,
    "to": 20
  }
}
GET /sms/status/{reference} Message Status

Get detailed delivery status for a specific message by its reference.

Path Parameters

NameTypeRequiredDescription
reference string Yes Message reference (format: SMS-{id})

Code Examples

curl -X GET "https://paynex.org/api/sms/status/SMS-123" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Example Response 200

{
  "status": true,
  "message": "Message status retrieved successfully",
  "data": {
    "id": 123,
    "reference": "SMS-123",
    "message": "Your message content",
    "status": "completed",
    "total_recipients": 2,
    "delivery_stats": {
      "delivered": 2,
      "failed": 0,
      "pending": 0
    },
    "created_at": "2024-01-15 10:30:00"
  }
}

Error Codes

When an error occurs, the API returns a JSON response with status: false and a descriptive error message.

Status CodeTypeDescription
400 Bad Request The request was malformed or missing required fields
401 Unauthorized Invalid or missing API token
404 Not Found The requested resource does not exist
422 Validation Error Request body failed validation rules
429 Too Many Requests Rate limit exceeded — slow down and retry
500 Server Error An unexpected error occurred on our end

Example Error Responses

401 Unauthorized

{
  "message": "Unauthenticated."
}

422 Validation Error

{
  "status": false,
  "message": "Sender ID is required",
  "errors": {
    "sender_id": [
      "Sender ID is required"
    ]
  }
}

404 Not Found

{
  "status": false,
  "message": "Resource not found"
}

500 Server Error

{
  "status": false,
  "message": "An error occurred. Please try again."
}

Ready to Start Building?

Create a free account, generate your API key, and start sending SMS messages programmatically.

No credit card required · Instant activation · Developer-friendly