curl --request POST \
--url https://api.robase.dev/v1/otp/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+2348012345678",
"code_length": 6,
"ttl_seconds": 600,
"language": "fr"
}
'import requests
url = "https://api.robase.dev/v1/otp/send"
payload = {
"phone_number": "+2348012345678",
"code_length": 6,
"ttl_seconds": 600,
"language": "fr"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '+2348012345678',
code_length: 6,
ttl_seconds: 600,
language: 'fr'
})
};
fetch('https://api.robase.dev/v1/otp/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.robase.dev/v1/otp/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phone_number' => '+2348012345678',
'code_length' => 6,
'ttl_seconds' => 600,
'language' => 'fr'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.robase.dev/v1/otp/send"
payload := strings.NewReader("{\n \"phone_number\": \"+2348012345678\",\n \"code_length\": 6,\n \"ttl_seconds\": 600,\n \"language\": \"fr\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.robase.dev/v1/otp/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+2348012345678\",\n \"code_length\": 6,\n \"ttl_seconds\": 600,\n \"language\": \"fr\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.robase.dev/v1/otp/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"+2348012345678\",\n \"code_length\": 6,\n \"ttl_seconds\": 600,\n \"language\": \"fr\"\n}"
response = http.request(request)
puts response.read_bodySend an OTP
POST /v1/otp/send — generate a code, charge credits, queue SMS delivery.
curl --request POST \
--url https://api.robase.dev/v1/otp/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+2348012345678",
"code_length": 6,
"ttl_seconds": 600,
"language": "fr"
}
'import requests
url = "https://api.robase.dev/v1/otp/send"
payload = {
"phone_number": "+2348012345678",
"code_length": 6,
"ttl_seconds": 600,
"language": "fr"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone_number: '+2348012345678',
code_length: 6,
ttl_seconds: 600,
language: 'fr'
})
};
fetch('https://api.robase.dev/v1/otp/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.robase.dev/v1/otp/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phone_number' => '+2348012345678',
'code_length' => 6,
'ttl_seconds' => 600,
'language' => 'fr'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.robase.dev/v1/otp/send"
payload := strings.NewReader("{\n \"phone_number\": \"+2348012345678\",\n \"code_length\": 6,\n \"ttl_seconds\": 600,\n \"language\": \"fr\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.robase.dev/v1/otp/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+2348012345678\",\n \"code_length\": 6,\n \"ttl_seconds\": 600,\n \"language\": \"fr\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.robase.dev/v1/otp/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"+2348012345678\",\n \"code_length\": 6,\n \"ttl_seconds\": 600,\n \"language\": \"fr\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Your Robase API key. Starts with robe_. Include as Authorization: Bearer robe_...
Headers
Opaque client-generated key. Replaying the same key within 24 hours returns the original response instead of performing the action again. Recommended for every send so a network-level retry cannot double-charge.
255Body
Phone number in E.164 format
"+2348012345678"
Number of digits in the generated code. Omit to use the default —
sending 0 is not the same as omitting the field. Anything outside
4–8 is refused with validation_error.
4 <= x <= 8How long the code stays verifiable, in seconds. Omit to use the default.
1 <= x <= 3600Language for the OTP message body. Omit to use the workspace's default language (Settings → General → Language & region). Supply it per request when your own end users are not all in the same language.
Accept-Language deliberately does not affect the message body — it describes the integrator reading our error responses, not the person receiving the SMS.
en, fr "fr"
Arbitrary key-value data stored with the OTP and returned by GET /v1/otp/{id}
Response
OTP created, charged, and queued for delivery
OTP ID to use with the verify and get endpoints
Destination the code was sent to, in E.164 format
"+2348012345678"
ISO 3166-1 alpha-2 country code derived from the number
"NG"
Credits consumed by this send
1
Always pending — delivery happens asynchronously
pending Number of digits in the generated code
6
After this instant the code can no longer be verified