SMS API for Denmark: send SMS from your own code in five minutes
A free-to-start REST SMS API: send SMS to Danish numbers with curl, Python or PHP, read the response, test without sending and pay only for what you use.
All you need is an API key and one HTTP call. Create a free account, make a key under API keys, and send:
curl
curl -X POST https://jasms.dk/api/v1/send \
-H "X-Api-Key: PUBLIC:SECRET" -H "Content-Type: application/json" \
-d '{"to": "+4512345678", "body": "Your code is 482913", "sender": "MyApp"}'
Python
import httpx
r = httpx.post("https://jasms.dk/api/v1/send",
headers={"X-Api-Key": "PUBLIC:SECRET"},
json={"to": "+4512345678", "body": "Hello from Python"})
print(r.json())
PHP
$ch = curl_init("https://jasms.dk/api/v1/send");
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: PUBLIC:SECRET", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["to" => "+4512345678", "body" => "Hello from PHP"])]);
echo curl_exec($ch);
The API response
The call answers with JSON including message_id, status (queued), parts (number of SMS parts), price and currency. Use message_id to fetch the status later, or let a webhook tell you when the SMS is delivered.
Test without sending
Add "dry_run": true to the body and we validate the number and text and work out the price without sending an SMS or charging anything. Ideal for your first tests.
What does an SMS API cost?
API access itself costs nothing extra: you pay per sent SMS only, and the price is in the response. The current Danish prices are in the guide on SMS prices.
Next steps
- Send an
Idempotency-Keyheader so a retried call never sends twice. - Subscribe to webhooks for
sms.deliveredandsms.received. - For login codes use
/api/v1/verify/startand/verify/check— we generate and check the code.
Create an account for free. You only pay when you send.