Go live
Your integration works with an sf_test_ key. Going live means real SIMs, real recipients and real costs on your carrier plan. Work through this list before you switch.
1. Prepare the phones
Section titled “1. Prepare the phones”- Pair at least two Android phones, so one can be offline without stopping your traffic (Pair a phone).
- Put them in a pool and send with
poolIdto get round robin and failover. - Keep them on a charger, on Wi-Fi or with good signal, and exclude the app from battery optimization (Battery).
- Check each SIM’s plan: SMS allowance, daily limits from the carrier, and international sending if you need it. Set a
dailyLimitper SIM withPATCH /v1/devices/:id/sims/:simIdto stay under the carrier’s limits. - Choose the default SIM with
POST /v1/devices/:id/sims/:simId/default, or in Devices.
2. Create a live key
Section titled “2. Create a live key”- Create a key with Live · real SMS as the Mode, and only the scopes the service needs (Authentication).
- Add an IP allowlist if your servers have fixed addresses, and an expiry if your rotation process allows it.
- Put the key in your secret manager as a new value, for example
SMSFABRIC_API_KEY. Keep the test key for staging and CI.
Nothing else changes in your code: the base URL, request bodies and responses are the same.
# A live smoke test to your own number. Check that it arrives.curl https://api.smsfabric.com/v1/messages \ -H "X-Api-Key: $SMSFABRIC_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: go-live-smoke-1" \ -d '{"to": "+201001234567", "body": "SMSFabric live test"}'import { SMSFabric } from '@smsfabric/sdk';
const sf = new SMSFabric({ apiKey: process.env.SMSFABRIC_API_KEY });
const [message] = await sf.messages.send( { to: '+201001234567', body: 'SMSFabric live test' }, { idempotencyKey: 'go-live-smoke-1' },);console.log(message.id, message.status);import osimport requests
res = requests.post( "https://api.smsfabric.com/v1/messages", headers={"X-Api-Key": os.environ["SMSFABRIC_API_KEY"], "Idempotency-Key": "go-live-smoke-1"}, json={"to": "+201001234567", "body": "SMSFabric live test"}, timeout=30,)res.raise_for_status()print(res.json()["data"][0]["id"])<?php$ch = curl_init('https://api.smsfabric.com/v1/messages');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode(['to' => '+201001234567', 'body' => 'SMSFabric live test']), CURLOPT_HTTPHEADER => [ 'X-Api-Key: ' . getenv('SMSFABRIC_API_KEY'), 'Content-Type: application/json', 'Idempotency-Key: go-live-smoke-1', ], CURLOPT_RETURNTRANSFER => true,]);echo curl_exec($ch) . "\n";3. Harden the integration
Section titled “3. Harden the integration”- Every send has an
Idempotency-Keyderived from your own data (Idempotency). - Network errors,
429and5xxare retried with backoff;4xxare not (Errors). - Your code handles
blockedin the send response andfailedlater. - Your webhook endpoint verifies signatures on the raw body and deduplicates on
SMSFabric-Event-Id(Webhooks). - The webhook endpoint answers within 10 seconds and is subscribed only to the events you use.
- Phone numbers are stored and sent in E.164.
- Logs don’t contain the API key, message bodies or full phone numbers.
4. Compliance
Section titled “4. Compliance”- Recipients agreed to receive your messages. Record it in each contact’s
consent. - Marketing messages say how to opt out (“Reply STOP to opt out”). SMSFabric honours STOP and START automatically (Receive messages).
- Your quiet hours and send window match local rules.
- For OTPs, Verify countries are limited to the ones you serve.
- Your SIMs’ terms allow the kind and volume of traffic you send.
5. Monitor
Section titled “5. Monitor”- Watch the portal’s Overview for failed messages and offline phones.
- Subscribe to
device.offlineand alert someone when a phone drops out. - Review failed webhook deliveries in Developers → Webhooks, and replay them after an outage.
- Check the audit log for key creation and role changes.
- Rotate the API key on a schedule with
POST /v1/api-keys/:id/rotate: the old secret keeps working for 24 hours while you deploy the new one.