OTP Verification in n8n
n8n runs as a server, so it reaches otp.com through the REST API. Two HTTP Request nodes and an IF node give you a full verification step in a workflow.
- Header Auth credential Authorization: Bearer otp_test_…
- HTTP Request · send POST /otp/send
- HTTP Request · verify POST /otp/verify
- IF node status equals "approved"
Set up otp.com in n8n
Create a Header Auth credential: name Authorization, value Bearer otp_live_your_key_here (use an otp_test_ key while you build). Add an HTTP Request node: POST https://api.otp.com/api/v1/otp/send with a JSON body of recipient, locale and client_ip (the end user’s IP, not the server’s). Add a second HTTP Request node: POST https://api.otp.com/api/v1/otp/verify with a JSON body of otp_id (from the send node) and code (what the user entered). Add an IF node that checks status equals "approved" to branch between verified and not verified.
API docsTry the two calls
curl -X POST https://api.otp.com/api/v1/otp/send \
-H "Authorization: Bearer otp_test_your_key_here" \
-H "Content-Type: application/json" \
-d '{"recipient":"+14155552671","locale":"en","client_ip":"<end_user_ip>"}' curl -X POST https://api.otp.com/api/v1/otp/verify \
-H "Authorization: Bearer otp_test_your_key_here" \
-H "Content-Type: application/json" \
-d '{"otp_id":"9f3c1b2a-…","code":"123456"}' Building it with an AI assistant?
If an AI assistant builds the workflow for you, give it this prompt: it carries the endpoints, request shapes and sandbox rules.
Integrate otp.com OTP verification into this project.
API docs: https://otp.com/docs
Base URL: https://api.otp.com/api/v1
Auth: Bearer token in the Authorization header
## Step 1: Send a code
POST /otp/send
Body: { "recipient": "+14155552671", "locale": "en", "client_ip": "<end user's IP>" }
→ Returns { "otp_id": "9f3c1b2a-…", "status": "pending", "channel": "sms" }
## Step 2: Verify the code the user entered
POST /otp/verify
Body: { "otp_id": "9f3c1b2a-…", "code": "123456" }
→ Returns { "otp_id": "9f3c1b2a-…", "status": "approved", "matched": true }
Notes:
- recipient is a phone number (E.164) or an email; your account routing picks the channel.
- client_ip is the END USER's IP from the request context (e.g. req.ip), never the server's own; requests without it share a much tighter rate limit.
- The code is never returned by the API.
Sandbox test keys (otp_test_…) accept the fixed code 123456 on the default 6-digit length. Frequently Asked Questions
Is my API key safe?
Keep it in an n8n credential, not typed into node fields or workflow JSON you export and share. Use a test key while you build, and swap in the live key when the workflow works.
Can I test without sending real messages?
Yes. A test key (otp_test_) runs in the sandbox: send returns a real otp_id and a pending status, but nothing is delivered and nothing is charged. Verify accepts the fixed code 123456 on the default 6-digit length.
How is it billed?
Per verification sent: one charge per code, at the published per-country rate. Verifying is free, and a resend counts as a new verification. Test keys are never charged.