Send and receive SMS programmatically through your Pairfon-connected devices.
All API requests require authentication via an API key sent as a Bearer token.
Get your API key from your Pairfon dashboard under API & Webhooks.
Include it in the Authorization header of every request.
Authorization: Bearer YOUR_API_KEY
Send and retrieve SMS messages through your connected devices.
Queue an SMS message to be sent through one of your connected devices.
| Parameter | Type | Description |
|---|---|---|
| device_fingerprintrequired | string | The unique identifier of the device to send from |
| phonerequired | string | Recipient phone number (e.g., +1234567890) |
| messagerequired | string | The SMS message text |
| sim_slotrequired | string | SIM slot to send from: SIM1 or SIM2 |
curl -X POST https://api.pairfon.com/chat/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"device_fingerprint": "abc123",
"phone": "+1234567890",
"message": "Hello from Pairfon!",
"sim_slot": "SIM1"
}'
{
"message": "SMS queued.",
"queueId": "msg_abc123"
}
Retrieve paginated message history between a device and a phone number.
| Parameter | Type | Description |
|---|---|---|
| device_fingerprintrequired | string | Device identifier |
| phonerequired | string | Contact phone number |
| pageoptional | integer | Page number (default: 1) |
| limitoptional | integer | Messages per page (default: 50, max: 100) |
curl "https://api.pairfon.com/chat/messages?device_fingerprint=abc123&phone=%2B1234567890" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"messages": [
{
"id": 1,
"direction": "outbound",
"message": "Hello from Pairfon!",
"phone": "+1234567890",
"sim_slot": "SIM1",
"status": "delivered",
"created_at": "2025-01-15T10:30:00Z"
}
],
"total": 42,
"page": 1,
"pages": 1
}
Get a list of unique conversations (phone numbers) for a device, with the latest message in each.
| Parameter | Type | Description |
|---|---|---|
| device_fingerprintrequired | string | Device identifier |
curl "https://api.pairfon.com/chat/conversations?device_fingerprint=abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"conversations": [
{
"phone": "+1234567890",
"lastMessage": "Hello!",
"lastMessageAt": "2025-01-15T10:30:00Z",
"direction": "inbound",
"messageCount": 15
}
]
}
Retrieve the latest inbound SMS messages. Designed for polling-based integrations (Zapier, Make, Pabbly).
| Parameter | Type | Description |
|---|---|---|
| device_fingerprintoptional | string | Filter by specific device |
| sim_slotoptional | string | Filter by SIM slot (SIM1 or SIM2) |
curl "https://api.pairfon.com/zapier/inbound-sms?device_fingerprint=abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
[
{
"id": 101,
"phone": "+1987654321",
"message": "Hey, got your text!",
"sim_slot": "SIM1",
"device_fingerprint": "abc123",
"received_at": "2025-01-15T10:35:00Z"
}
]
Retrieve the most recent inbound SMS message. Returns a single object instead of an array.
| Parameter | Type | Description |
|---|---|---|
| device_fingerprintoptional | string | Filter by specific device |
| sim_slotoptional | string | Filter by SIM slot (SIM1 or SIM2) |
curl "https://api.pairfon.com/zapier/latest-sms?device_fingerprint=abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"id": "33fec033-1019-43f6-92bb-ed9d5f72f74a",
"phone": "+1987654321",
"message": "Hey, got your text!",
"sim_slot": "SIM1",
"device_fingerprint": "abc123",
"received_at": "2025-01-15T10:35:00Z"
}
Send an SMS through a Pairfon device. Designed for automation platforms (Zapier, Make, Pabbly).
| Parameter | Type | Description |
|---|---|---|
| device_fingerprintrequired | string | Device to send from |
| phonerequired | string | Recipient phone number |
| messagerequired | string | SMS message text |
| sim_slotoptional | string | SIM1 or SIM2 (defaults to SIM1) |
curl -X POST https://api.pairfon.com/zapier/send-sms \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"device_fingerprint": "abc123",
"phone": "+1234567890",
"message": "Automated message via Pairfon",
"sim_slot": "SIM1"
}'
{
"id": 42,
"message": "SMS queued successfully.",
"phone": "+1234567890",
"device_fingerprint": "abc123",
"sim_slot": "SIM1"
}
Manage and retrieve information about your connected devices.
Retrieve all devices linked to your account.
curl "https://api.pairfon.com/chat/devices" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"devices": [
{
"device_fingerprint": "abc123",
"device_name": "Samsung Galaxy S24",
"status": "active",
"selected_sim": "BOTH"
}
]
}
Retrieve a detailed list of devices with admin-level information.
curl "https://api.pairfon.com/device/list" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"devices": [
{
"device_fingerprint": "abc123",
"device_name": "Samsung Galaxy S24",
"status": "active",
"selected_sim": "BOTH",
"user_id": 5,
"fcm_token": "fcm_token_value"
}
]
}
Remove a device from your account.
| Parameter | Type | Description |
|---|---|---|
| device_fingerprintrequired | string | The device identifier to delete |
curl -X DELETE "https://api.pairfon.com/device/delete/abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"message": "Device deleted successfully."
}
Configure webhook URLs to receive real-time notifications when SMS messages arrive.
Retrieve your current inbound SMS webhook configuration.
curl "https://api.pairfon.com/webhooks/inbound-sms" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"webhooks": [
{
"id": 1,
"url": "https://example.com/webhook",
"active": true
}
]
}
Set up or update your inbound SMS webhook URLs.
| Parameter | Type | Description |
|---|---|---|
| webhooksrequired | array | Array of webhook objects with url and active fields |
curl -X PUT https://api.pairfon.com/webhooks/inbound-sms \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"webhooks": [
{
"url": "https://example.com/webhook",
"active": true
}
]
}'
{
"message": "Webhook settings saved",
"webhooks": [
{
"id": 1,
"url": "https://example.com/webhook",
"active": true
}
]
}
The API uses standard HTTP status codes to indicate success or failure.
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad request - missing or invalid parameters |
| 401 | Unauthorized - invalid or missing API key |
| 403 | Forbidden - insufficient permissions (e.g., wrong SIM slot) |
| 404 | Not found - resource does not exist |
| 429 | Rate limited - too many requests (100/min general, 15/15min auth) |
| 500 | Server error |
| Scope | Limit | Window |
|---|---|---|
| General API | 100 requests | 1 minute |
| Authentication | 15 requests | 15 minutes |
RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset) are included in every response.