Skip to content

Pass Delivery

Index

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
The phone number to send the SMS to. Use E.164 format, e.g. +3541234567; a number without a country code is validated as an Icelandic number. If not provided, a membership pass is texted at the member's phone number, and any other pass (or a member without a phone number) at the phone number stored on the Pass. When provided, the Pass Template needs a phone number input field, and the number is stored on the Pass, not on the member.
content object Optional
Custom SMS content. customContent and customSender each fall back to the Pass Template's SMS Template when left out; the request fails with 400 "Pass is not assigned SMS Template" when a value is missing and there is no SMS Template.
sendCustomSms boolean Optional
Ignored by this endpoint: customContent and customSender are used whenever they are set.
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. Must be registered and approved in Settings → SMS Sender names on SmartPages. When left out, the sender of the Pass Template's SMS Template is used.
customContent string Optional
The content of the SMS message. When left out, the content of the Pass Template's SMS Template is used. Can include the template token ${url}, which is replaced with a short link (without https://) to the pass delivery page; a text without ${url} is sent without a link. Tokens SmartPages does not know are replaced with nothing. 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": {
"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);
};