Quickstart

From zero to a sent SMS and a verified code, in sandbox.

1. Create an account and a project

Sign up, verify your email and create an organization. Then create a project with SMS and OTP verification turned on. New projects start in sandbox.

2. Create a sandbox key

In the dashboard open More → Developers → API keys and choose Create key with the Sandbox environment. Copy the key — it’s shown only once — and keep it on your server:

Shell
export NOPEXO_API_KEY=nxk_test_…

Keep keys secret

Never put an API key in a browser, a mobile app or a public repository. Call Nopexo from your server.

3. Send an SMS

Use the test number 0200000009. The response is 202 Accepted with status queued: the message has been accepted for sending, not delivered.

curl -X POST "https://api.nopexo.com/v1/sms/send" \
  -H "Authorization: Bearer $NOPEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "to": "0200000009",
    "from": "NOPEXO",
    "body": "Your order #1042 is ready for pickup."
  }'

4. Check delivery

A couple of seconds later the sandbox reports it delivered. Fetch it with the id from step 3 (or set up a webhook so Nopexo tells you):

curl -X GET "https://api.nopexo.com/v1/sms/msg_7kd2qm4x9t3c8f1v" \
  -H "Authorization: Bearer $NOPEXO_API_KEY"

5. Verify a phone number

Send a code. In sandbox the response includes testCode, and 0200000009 always gets 123456, so automated tests can run end to end.

curl -X POST "https://api.nopexo.com/v1/otp/send" \
  -H "Authorization: Bearer $NOPEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "to": "0200000009",
    "purpose": "login",
    "reference": "user_42"
  }'

Then check the code your user typed, with the requestId:

curl -X POST "https://api.nopexo.com/v1/otp/verify" \
  -H "Authorization: Bearer $NOPEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "requestId": "otp_5hj3k8m2n9p4q7r1",
    "code": "123456"
  }'

verified: true means the number is confirmed. A second check of the same code returns OTP_ALREADY_VERIFIED — codes are single use.

6. Go live

  1. Move the project to production (Project → Settings → Environment).
  2. Request a sender ID and wait for approval (SMS → Sender IDs).
  3. Add funds to your wallet.
  4. Create a production key (nxk_live_…) and swap it in. Your code doesn’t change.

Next: authentication, error handling and webhooks.