curl --request POST \
--url https://test-api.segmnt.cloud/v1/me/phone/start \
--header 'Content-Type: application/json' \
--cookie segmnt_session= \
--data '
{
"phone": "0512345678"
}
'import requests
url = "https://test-api.segmnt.cloud/v1/me/phone/start"
payload = { "phone": "0512345678" }
headers = {
"cookie": "segmnt_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'segmnt_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({phone: '0512345678'})
};
fetch('https://test-api.segmnt.cloud/v1/me/phone/start', 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://test-api.segmnt.cloud/v1/me/phone/start",
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' => '0512345678'
]),
CURLOPT_COOKIE => "segmnt_session=",
CURLOPT_HTTPHEADER => [
"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://test-api.segmnt.cloud/v1/me/phone/start"
payload := strings.NewReader("{\n \"phone\": \"0512345678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "segmnt_session=")
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://test-api.segmnt.cloud/v1/me/phone/start")
.header("cookie", "segmnt_session=")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"0512345678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/me/phone/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'segmnt_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"0512345678\"\n}"
response = http.request(request)
puts response.read_body{
"challengeId": "phc_8fK2mQ",
"phone": "+96651****678",
"expiresAt": "2023-11-07T05:31:56Z",
"testCode": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Send a phone verification code
Starts phone verification for the signed-in account (task A13). Phone
verification is not enforced in this version, so a free account can
upload without it; this route is kept for when the wizard phone step
ships. The number
must be a Saudi or GCC mobile (05XXXXXXXX, +9665XXXXXXXX,
+9715XXXXXXXX, +965XXXXXXXX, …); it is stored only as a salted hash.
Send a full international number (+CC...), or a local number together
with country; without country a local number is treated as Saudi.
At most 5 codes per account per hour. A phone number or account under an
active ban is refused. SMS is sent through the board-approved provider
(BudgetSMS; Msegat or Twilio can be used instead); when none is
configured this route answers 503. In the
TEST environment only, the test provider also returns the code in
testCode so the automated end-to-end test can finish the flow.
curl --request POST \
--url https://test-api.segmnt.cloud/v1/me/phone/start \
--header 'Content-Type: application/json' \
--cookie segmnt_session= \
--data '
{
"phone": "0512345678"
}
'import requests
url = "https://test-api.segmnt.cloud/v1/me/phone/start"
payload = { "phone": "0512345678" }
headers = {
"cookie": "segmnt_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'segmnt_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({phone: '0512345678'})
};
fetch('https://test-api.segmnt.cloud/v1/me/phone/start', 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://test-api.segmnt.cloud/v1/me/phone/start",
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' => '0512345678'
]),
CURLOPT_COOKIE => "segmnt_session=",
CURLOPT_HTTPHEADER => [
"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://test-api.segmnt.cloud/v1/me/phone/start"
payload := strings.NewReader("{\n \"phone\": \"0512345678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "segmnt_session=")
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://test-api.segmnt.cloud/v1/me/phone/start")
.header("cookie", "segmnt_session=")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"0512345678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.segmnt.cloud/v1/me/phone/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'segmnt_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"0512345678\"\n}"
response = http.request(request)
puts response.read_body{
"challengeId": "phc_8fK2mQ",
"phone": "+96651****678",
"expiresAt": "2023-11-07T05:31:56Z",
"testCode": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Authorizations
Dashboard session cookie, set after SSO sign-in.
Body
A Saudi or GCC mobile number. Stored only as a salted hash.
"0512345678"
"+966512345678"
"+971501234567"
Country of a local phone (for example ae for 0501234567).
Ignored when phone starts with a country code. Defaults to sa.
sa, ae, kw, qa, bh, om Response
A code was sent.
"phc_8fK2mQ"
The number with its middle digits masked.
"+96651****678"
Present ONLY in the TEST environment (TEST_SINK=1), so the
automated end-to-end test can finish the flow without a real SMS.
Never present in production.