trustmy

Developers

Send SMS from your own system.

Booking, web shop or login: one API key, and your system can send messages, reminders and one-time codes through trustmy. Replies and deliveries come back as webhooks.

Getting started

Make a key under Settings → API keys and send it as a Bearer token. Numbers work with or without +45.

Authorization: Bearer tmk_...
Base URL: https://api.trustmy.dk

Two ways to send

route: "phone"
From a phone. Free, a phone number as sender, 8-20 seconds between messages and not between 21:00 and 08:00.
route: "api"
With your company name as sender. At once and around the clock (marketing waits until 08:00). Costs credit.

Without route, the account's default sender is used. category: "marketing" adds an opt-out line and never goes out at night.

Send a message

Schedule it for later with sendAt.

curl https://api.trustmy.dk/v1/messages \
  -H "Authorization: Bearer tmk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": "20 12 34 56",
    "body": "Din tid i morgen kl. 10 er bekræftet.",
    "route": "api",
    "sendAt": "2026-11-09T08:00:00+01:00"
  }'

One-time login codes

trustmy makes the code, sends it and checks it. Valid 10 minutes, 5 tries, at most 5 codes an hour per number. Always sent with your company name, so it arrives in seconds, also at night.

# 1. Send a code
curl https://api.trustmy.dk/v1/verify -H "Authorization: Bearer tmk_..." \
  -H "Content-Type: application/json" -d '{ "to": "+4520123456" }'

# 2. Check what the user typed
curl https://api.trustmy.dk/v1/verify/check -H "Authorization: Bearer tmk_..." \
  -H "Content-Type: application/json" -d '{ "to": "+4520123456", "code": "482913" }'

→ { "valid": true, "reason": "ok" }

Send to many

Write the message once with fields like {{firstname}}. Send to everyone, a group (tag) or chosen contacts. Opted-out contacts are skipped.

curl https://api.trustmy.dk/v1/campaigns -H "Authorization: Bearer tmk_..." \
  -H "Content-Type: application/json" \
  -d '{ "template": "Hej {{fornavn}}, husk din tid i morgen.", "tag": "kunder", "route": "phone" }'

Webhooks

Set an https address under Settings → Webhook. We send message.status (sent, delivered, failed) and reply.received as JSON, signed with your secret.

POST https://your-site.dk/hooks/sms
X-Trustmy-Signature: t=1762600000,v1=5f2c…

{ "type": "reply.received",
  "data": { "id": "inb_…", "from": "+4520123456", "body": "Ja tak", "stop": false, … },
  "createdAt": "2026-11-08T14:00:00.000Z" }

Check the signature

import { createHmac, timingSafeEqual } from "node:crypto";

function isFromTrustmy(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
  return fresh && timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}

Errors

Every error has the same shape: { error: { code, message, requestId } }.

  • 402 insufficient_creditsNot enough credit. Top up under Credit.
  • 403 organization_pending_reviewThe account has no phone paired and is not approved yet.
  • 403 paid_tier_needs_approvalYour company name as sender needs approval.
  • 422 invalid_phone_numberThe number cannot be used.
  • 429 too_many_codesToo many codes to the same number. Wait a little.
Create an accountThe whole API as OpenAPI