List Campaigns
GET /sms/campaigns
Responses
- 200 list[CampaignOut]
- 401 no key, or a key that was revoked
- 403 the key lacks the permission
Example request
curl -X GET "$API/sms/campaigns" \
-H "Authorization: Bearer $LH_API_KEY"
Every call needs Authorization: Bearer lh_… unless marked No key needed; the example uses $API for https://api.localhost.co.zw and $LH_API_KEY for your key. A * marks a required field.
GET /sms/campaigns
curl -X GET "$API/sms/campaigns" \
-H "Authorization: Bearer $LH_API_KEY"
POST /sms/campaigns
Send a campaign. Every https link in the message becomes a tracked short link, one per recipient.
| Name | Type | Notes |
|---|---|---|
| to * | list[string] | string | |
| sender * | string | |
| message * | string | |
| name | string | default "" |
curl -X POST "$API/sms/campaigns" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Idempotency-Key: <a fresh unique string>" \
-H "Content-Type: application/json" \
-d '{
"to": [
"<to>"
],
"sender": "<sender>",
"message": "<message>"
}'
POST /sms/messages
Send one message to one or many numbers (up to 200).
| Name | Type | Notes |
|---|---|---|
| phone * | string | |
| app | string | default "" |
| reference | string | default "" |
curl -X POST "$API/sms/messages" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Idempotency-Key: <a fresh unique string>" \
-H "Content-Type: application/json" \
-d '{
"phone": "<phone>"
}'
GET /sms/senders
The names this account can send from right now: its approved own names, then the shared one.
curl -X GET "$API/sms/senders" \
-H "Authorization: Bearer $LH_API_KEY"
GET /sms/campaigns/{campaign_id}
| Name | Type | Notes |
|---|---|---|
| campaign_id * in path | integer |
curl -X GET "$API/sms/campaigns/<campaign_id>" \
-H "Authorization: Bearer $LH_API_KEY"
POST /sms/otp/send
Text a 6-digit code to a Zimbabwe mobile number. One per number per minute; valid 5 minutes, 5 tries, used once.
| Name | Type | Notes |
|---|---|---|
| phone * | string | |
| reference | string | default "" |
curl -X POST "$API/sms/otp/send" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Idempotency-Key: <a fresh unique string>" \
-H "Content-Type: application/json" \
-d '{
"phone": "<phone>"
}'
POST /sms/otp/verify
Is this the code we sent? Give the id from /otp/send, or the phone number (the latest code to it).
| Name | Type | Notes |
|---|---|---|
| code * | string | |
| id | string | default "" |
| phone | string | default "" |
curl -X POST "$API/sms/otp/verify" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "<code>"
}'
The objects these endpoints send and receive.
| Name | Type | Notes |
|---|---|---|
| to * | list[string] | string | |
| sender * | string | |
| message * | string | |
| name | string | default "" |
| Name | Type | Notes |
|---|---|---|
| id * | integer | |
| name * | string | |
| sender * | string | |
| created_at * | datetime | |
| total * | integer | |
| delivered * | integer | |
| sending * | integer | |
| failed * | integer | |
| credits * | integer | |
| clicked_people * | integer | |
| links * | list[LinkOut] |
| Name | Type | Notes |
|---|---|---|
| url * | string | |
| clicks * | integer | |
| people * | integer |
| Name | Type | Notes |
|---|---|---|
| phone * | string | |
| reference | string | default "" |
| Name | Type | Notes |
|---|---|---|
| id * | string | |
| to * | string | |
| expires_in * | integer |
| Name | Type | Notes |
|---|---|---|
| code * | string | |
| id | string | default "" |
| phone | string | default "" |
| Name | Type | Notes |
|---|---|---|
| valid * | boolean | |
| reason | string | default "" |
| Name | Type | Notes |
|---|---|---|
| phone * | string | |
| app | string | default "" |
| reference | string | default "" |
| Name | Type | Notes |
|---|---|---|
| id * | string | |
| to * | string | |
| sender * | string | |
| expires_in * | integer |