All guides

SMS WORKFLOWS

Shorten URLs before sending an SMS

Place URL shortening at the right point in a transactional or lifecycle messaging pipeline.

Outcome: A server-side flow that creates compact links without exposing API credentials to phones or browsers.
01

Put shortening between destination creation and delivery

Build the complete destination first, including the path and query parameters your application needs. Send that URL to URLMe from your server, then insert the returned short URL into the final message handed to your SMS provider.

  • Create the destination in your application
  • Call POST /v1/links from a trusted server
  • Insert shortUrl into the SMS template
  • Send through your existing provider
02

Keep the API key out of message clients

The URLMe key belongs in a server-side secret manager or protected environment variable. Never call the shortening endpoint from browser JavaScript, a mobile app, or a template that could expose the Bearer token.

curl --request POST "https://api.urlme.link/v1/links" \
  --header "Authorization: Bearer $URLME_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"url":"https://example.com/orders/8421/status?source=sms"}'
04

Use a recognizable hostname when trust matters

Starter can return urlme.link URLs immediately. Growth and Scale can use a verified custom hostname, which keeps the visible domain aligned with the sender customers already recognize.

Next guideUse short links in transactional email