Pass Delivery
Index
POST /api/v1/pass/{id}/distribute/sms- Send SMS for pass
Send SMS for pass
Sends an SMS for an existing pass.
This endpoint needs both the REST API and SMS add-ons; without the SMS add-on it answers 403 ADDON_REQUIRED .
Send a JSON body. An empty body {} sends the Pass Template’s SMS Template to the phone number on file. Use the returned id with Get SMS information to follow the delivery.
The SMS can be customized with your own content and sender name; each one you leave out is taken from the Pass Template’s SMS Template. The sender name must be registered and approved first in Settings → SMS Sender names.
See Template Tokens on SmartPages for a list of available tokens that you can use in the custom SMS content. Tokens are written as ${token} , e.g. ${url} , which is replaced with a short link to the pass delivery page.
Use E.164 format for the phone number, e.g. +3541234567 . A number without a country code is validated as an Icelandic number.
Request
POST https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms {
"phoneNumber": "+3541234567",
"content": {
"customContent": "Here is your pass! Click the link to add it to your wallet: ${url}",
"customSender": "MyCompany"
}
} Request fields
phoneNumber string Optional
content object Optional
sendCustomSms boolean Optional
customSender string Optional
customContent string Optional
Response
Example
{
"id": "19700910-7195-4d57-b402-886ff7439e44",
"phoneNumber": "+3541234567",
"messageParts": 1,
"messageLength": 75,
"whenQueued": "2025-07-15T12:00:00.000Z"
} Fields details
id UUID
phoneNumber string Optional
messageParts integer
messageLength integer
whenQueued timestampz
Code example
const myHeaders = new Headers();myHeaders.append("Content-Type", "application/json");myHeaders.append("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");
const raw = JSON.stringify({ "phoneNumber": "+3541234567", "content": { "customContent": "Here is your pass! Click the link to add it to your wallet: ${url}", "customSender": "MyCompany" }});
const requestOptions = { method: "POST", headers: myHeaders, body: raw, redirect: "follow"};
try { const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms", requestOptions); const result = await response.text(); console.log(result)} catch (error) { console.error(error);};const axios = require('axios');let data = JSON.stringify({ "phoneNumber": "+3541234567", "content": { "customContent": "Here is your pass! Click the link to add it to your wallet: ${url}", "customSender": "MyCompany" }});
let config = { method: 'post', maxBodyLength: Infinity, url: 'https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>' }, data : data};
async function makeRequest() { try { const response = await axios.request(config); console.log(JSON.stringify(response.data)); } catch (error) { console.log(error); }}
makeRequest();import requestsimport json
url = "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms"
payload = json.dumps({ "phoneNumber": "+3541234567", "content": { "customContent": "Here is your pass! Click the link to add it to your wallet: ${url}", "customSender": "MyCompany" }})headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)val client = OkHttpClient()val mediaType = "application/json".toMediaType()val body = "{\"phoneNumber\":\"+3541234567\",\"content\":{\"customContent\":\"Here is your pass! Click the link to add it to your wallet: ${url}\",\"customSender\":\"MyCompany\"}}".toRequestBody(mediaType)val request = Request.Builder() .url("https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms") .post(body) .addHeader("Content-Type", "application/json") .addHeader("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>") .build()val response = client.newCall(request).execute()var client = new HttpClient();var request = new HttpRequestMessage(HttpMethod.Post, "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms");request.Headers.Add("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");var content = new StringContent("{\"phoneNumber\":\"+3541234567\",\"content\":{\"customContent\":\"Here is your pass! Click the link to add it to your wallet: ${url}\",\"customSender\":\"MyCompany\"}}", null, "application/json");request.Content = content;var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = reqwest::Client::builder() .build()?;
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse()?); headers.insert("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>".parse()?);
let data = r#"{ "phoneNumber": "+3541234567", "content": { "customContent": "Here is your pass! Click the link to add it to your wallet: ${url}", "customSender": "MyCompany" }}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::POST, "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms") .headers(headers) .json(&json);
let response = request.send().await?; let body = response.text().await?;
println!("{}", body);
Ok(())}