curl --request POST \
--url https://apiweb.mile.app/api/v3/sms-gateway \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Main SMS provider",
"endpoint": "https://sms.example.com/api/send",
"httpMethod": "POST",
"headers": {},
"bodyParams": [
{
"key": "to",
"value": "{recipient}"
},
{
"key": "text",
"value": "{message}"
}
],
"successMatch": {
"jsonPath": "status",
"equals": "queued"
},
"testRecipient": "+6281234567890"
}
'import requests
url = "https://apiweb.mile.app/api/v3/sms-gateway"
payload = {
"label": "Main SMS provider",
"endpoint": "https://sms.example.com/api/send",
"httpMethod": "POST",
"headers": {},
"bodyParams": [
{
"key": "to",
"value": "{recipient}"
},
{
"key": "text",
"value": "{message}"
}
],
"successMatch": {
"jsonPath": "status",
"equals": "queued"
},
"testRecipient": "+6281234567890"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Main SMS provider',
endpoint: 'https://sms.example.com/api/send',
httpMethod: 'POST',
headers: {},
bodyParams: [{key: 'to', value: '{recipient}'}, {key: 'text', value: '{message}'}],
successMatch: {jsonPath: 'status', equals: 'queued'},
testRecipient: '+6281234567890'
})
};
fetch('https://apiweb.mile.app/api/v3/sms-gateway', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/sms-gateway",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'label' => 'Main SMS provider',
'endpoint' => 'https://sms.example.com/api/send',
'httpMethod' => 'POST',
'headers' => [
],
'bodyParams' => [
[
'key' => 'to',
'value' => '{recipient}'
],
[
'key' => 'text',
'value' => '{message}'
]
],
'successMatch' => [
'jsonPath' => 'status',
'equals' => 'queued'
],
'testRecipient' => '+6281234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/sms-gateway"
payload := strings.NewReader("{\n \"label\": \"Main SMS provider\",\n \"endpoint\": \"https://sms.example.com/api/send\",\n \"httpMethod\": \"POST\",\n \"headers\": {},\n \"bodyParams\": [\n {\n \"key\": \"to\",\n \"value\": \"{recipient}\"\n },\n {\n \"key\": \"text\",\n \"value\": \"{message}\"\n }\n ],\n \"successMatch\": {\n \"jsonPath\": \"status\",\n \"equals\": \"queued\"\n },\n \"testRecipient\": \"+6281234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/sms-gateway")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Main SMS provider\",\n \"endpoint\": \"https://sms.example.com/api/send\",\n \"httpMethod\": \"POST\",\n \"headers\": {},\n \"bodyParams\": [\n {\n \"key\": \"to\",\n \"value\": \"{recipient}\"\n },\n {\n \"key\": \"text\",\n \"value\": \"{message}\"\n }\n ],\n \"successMatch\": {\n \"jsonPath\": \"status\",\n \"equals\": \"queued\"\n },\n \"testRecipient\": \"+6281234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/sms-gateway")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Main SMS provider\",\n \"endpoint\": \"https://sms.example.com/api/send\",\n \"httpMethod\": \"POST\",\n \"headers\": {},\n \"bodyParams\": [\n {\n \"key\": \"to\",\n \"value\": \"{recipient}\"\n },\n {\n \"key\": \"text\",\n \"value\": \"{message}\"\n }\n ],\n \"successMatch\": {\n \"jsonPath\": \"status\",\n \"equals\": \"queued\"\n },\n \"testRecipient\": \"+6281234567890\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"id": "6710a2c4e4b0a91d2c3f5b21",
"integrationType": "sms_gateway",
"label": "Main SMS provider",
"endpoint": "https://sms.example.com/api/send",
"httpMethod": "POST",
"headers": {},
"bodyParams": [
{
"key": "to",
"value": "{recipient}",
"secret": false
},
{
"key": "text",
"value": "{message}",
"secret": false
}
],
"successMatch": {
"jsonPath": "status",
"equals": "queued"
},
"status": "connected",
"validatedAt": "2026-10-16T03:00:00+00:00",
"isActive": true
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Create SMS gateway
Saves your organization’s SMS gateway. An organization has one gateway, so calling this again replaces it. Rules for the gateway settings:
endpointmust be a publichttp/httpsURL (no localhost or private addresses).{recipient}and{message}must both appear in the endpoint or in a body parameter value. No other{placeholder}is allowed.- Header names and body keys must be unique.
- Values marked
secretare stored encrypted and shown as••••. Send••••or an empty value to keep the stored secret. successMatch(optional) is{jsonPath, equals}: the send counts as accepted only when the provider response has that value.
[!warning] This call sends a real SMS to
testRecipientthrough your gateway to verify it. Nothing is saved if the provider rejects it. Limited to 6 requests per minute per user. Requires permissionadd/appIntegration.
curl --request POST \
--url https://apiweb.mile.app/api/v3/sms-gateway \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Main SMS provider",
"endpoint": "https://sms.example.com/api/send",
"httpMethod": "POST",
"headers": {},
"bodyParams": [
{
"key": "to",
"value": "{recipient}"
},
{
"key": "text",
"value": "{message}"
}
],
"successMatch": {
"jsonPath": "status",
"equals": "queued"
},
"testRecipient": "+6281234567890"
}
'import requests
url = "https://apiweb.mile.app/api/v3/sms-gateway"
payload = {
"label": "Main SMS provider",
"endpoint": "https://sms.example.com/api/send",
"httpMethod": "POST",
"headers": {},
"bodyParams": [
{
"key": "to",
"value": "{recipient}"
},
{
"key": "text",
"value": "{message}"
}
],
"successMatch": {
"jsonPath": "status",
"equals": "queued"
},
"testRecipient": "+6281234567890"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Main SMS provider',
endpoint: 'https://sms.example.com/api/send',
httpMethod: 'POST',
headers: {},
bodyParams: [{key: 'to', value: '{recipient}'}, {key: 'text', value: '{message}'}],
successMatch: {jsonPath: 'status', equals: 'queued'},
testRecipient: '+6281234567890'
})
};
fetch('https://apiweb.mile.app/api/v3/sms-gateway', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/sms-gateway",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'label' => 'Main SMS provider',
'endpoint' => 'https://sms.example.com/api/send',
'httpMethod' => 'POST',
'headers' => [
],
'bodyParams' => [
[
'key' => 'to',
'value' => '{recipient}'
],
[
'key' => 'text',
'value' => '{message}'
]
],
'successMatch' => [
'jsonPath' => 'status',
'equals' => 'queued'
],
'testRecipient' => '+6281234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/sms-gateway"
payload := strings.NewReader("{\n \"label\": \"Main SMS provider\",\n \"endpoint\": \"https://sms.example.com/api/send\",\n \"httpMethod\": \"POST\",\n \"headers\": {},\n \"bodyParams\": [\n {\n \"key\": \"to\",\n \"value\": \"{recipient}\"\n },\n {\n \"key\": \"text\",\n \"value\": \"{message}\"\n }\n ],\n \"successMatch\": {\n \"jsonPath\": \"status\",\n \"equals\": \"queued\"\n },\n \"testRecipient\": \"+6281234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/sms-gateway")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Main SMS provider\",\n \"endpoint\": \"https://sms.example.com/api/send\",\n \"httpMethod\": \"POST\",\n \"headers\": {},\n \"bodyParams\": [\n {\n \"key\": \"to\",\n \"value\": \"{recipient}\"\n },\n {\n \"key\": \"text\",\n \"value\": \"{message}\"\n }\n ],\n \"successMatch\": {\n \"jsonPath\": \"status\",\n \"equals\": \"queued\"\n },\n \"testRecipient\": \"+6281234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/sms-gateway")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Main SMS provider\",\n \"endpoint\": \"https://sms.example.com/api/send\",\n \"httpMethod\": \"POST\",\n \"headers\": {},\n \"bodyParams\": [\n {\n \"key\": \"to\",\n \"value\": \"{recipient}\"\n },\n {\n \"key\": \"text\",\n \"value\": \"{message}\"\n }\n ],\n \"successMatch\": {\n \"jsonPath\": \"status\",\n \"equals\": \"queued\"\n },\n \"testRecipient\": \"+6281234567890\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"id": "6710a2c4e4b0a91d2c3f5b21",
"integrationType": "sms_gateway",
"label": "Main SMS provider",
"endpoint": "https://sms.example.com/api/send",
"httpMethod": "POST",
"headers": {},
"bodyParams": [
{
"key": "to",
"value": "{recipient}",
"secret": false
},
{
"key": "text",
"value": "{message}",
"secret": false
}
],
"successMatch": {
"jsonPath": "status",
"equals": "queued"
},
"status": "connected",
"validatedAt": "2026-10-16T03:00:00+00:00",
"isActive": true
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Authorizations
Use a valid Bearer token to authenticate.
Body
Name for this gateway.
Example: Main SMS provider
200Provider URL. May contain {recipient} and {message}.
Example: https://sms.example.com/api/send
2000HTTP method used to call the provider.
Example: POST
POST, GET Body parameters (query parameters for GET).
Show child attributes
Show child attributes
Phone number that receives the verification SMS, international format with 7-15 digits.
Example: +6281234567890
Request headers.
Show child attributes
Show child attributes
Optional check on the provider response.
Example: {"jsonPath": "status", "equals": "queued"}
Show child attributes
Show child attributes
Whether the gateway is used for sending. Defaults to true on create.