Skip to content

Pass Delivery

Index

Send SMS for pass

Sends an SMS for an existing pass.

The SMS can be customized with your own content and sender name.

See Template Tokens on SmartPages for a list of available tokens that you can use in the custom SMS content.

The Phone number must be in E.164 format, e.g. +3541234567 .

Request
POST https://smartpages-api.smartsolutions.is/api/v1/pass/{id}/distribute/sms { "phoneNumber": "+3541234567", "content": { "sendCustomSms": true, "customContent": "Here is your pass! Click the link to add it to your wallet: ${url}", "customSender": "MyCompany" } }
Request fields
phoneNumber string Optional
The phone number to which the pass should be sent. Should be in E.164 format. If not provided, the SMS will be sent to the number registered on the Pass. Will update the phone number stored on the Pass.
content object Optional
Custom SMS content, if not included we'll use the SMS Template as designed for the Pass Template, fails if both are missing.
sendCustomSms boolean Optional
Wether to use the Custom SMS content
customSender string Optional
The sender of the SMS message, e.g. your brand name. Will show up as the sender on the customer's device. Approval of the sender name beforehand is required.
customContent string Optional
The content of the SMS message that will be sent to the customer. Can include a placeholder {url} that will be replaced with the actual pass download link. Full list of template tokens can be found on SmartPages
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
ID of the SMS
phoneNumber string Optional
The Phone Number the SMS was sent to.
messageParts integer
How many parts the message was split into, as per carrier requirements.
messageLength integer
How long the message is in characters.
whenQueued timestampz
When the SMS message was queued for delivery.
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": {
"sendCustomSms": true,
"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);
};