Send an OTP code
sendkuy_send_verificationSends a one-time verification code to a phone number or email address, tries the listed channels in order, and returns a verification ID for checking the submitted code.
Instructions
Send a one-time code to a phone number or email address and get a verification id (vrf_...). SendKuy generates the code, sends it, and falls back through the channels you list in order. Check what the user typed with sendkuy_check_verification. This really sends and spends SendKuy credit. Pass dedupe_key so a retried step does not send a second code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | E.164 phone number with the leading +, for WhatsApp and SMS. | |
| ttl | No | Seconds the code stays valid. | |
| brand | No | Name shown in the message. | |
| No | Email address, for the email channel. | ||
| locale | No | ||
| channels | No | Channels to try, in order. | |
| dedupe_key | No | A key derived from the event this call reports, such as "order-1234-shipped" or "daily-revenue-2026-10-29". Calling again with the same key and the same input returns the first answer instead of sending twice. The same key with different input is refused with idempotency_key_reused, so keep changing values such as the time out of a deduplicated message. A refusal (for example insufficient_credits or a bad number) is remembered under the key too: after fixing it, retry with a new key. Keys are remembered for about 24 hours. | |
| code_length | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| verification | Yes |