Create an account
curl --request POST \
--url https://api.liara.ir/v1/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "you@example.com",
"password": "<your-password>",
"fullname": "نام نمونه",
"nationalCode": "0000000000",
"phone": "09120000000"
}
'import requests
url = "https://api.liara.ir/v1/register"
payload = {
"email": "you@example.com",
"password": "<your-password>",
"fullname": "نام نمونه",
"nationalCode": "0000000000",
"phone": "09120000000"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'you@example.com',
password: '<your-password>',
fullname: 'نام نمونه',
nationalCode: '0000000000',
phone: '09120000000'
})
};
fetch('https://api.liara.ir/v1/register', 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.liara.ir/v1/register",
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([
'email' => 'you@example.com',
'password' => '<your-password>',
'fullname' => 'نام نمونه',
'nationalCode' => '0000000000',
'phone' => '09120000000'
]),
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://api.liara.ir/v1/register"
payload := strings.NewReader("{\n \"email\": \"you@example.com\",\n \"password\": \"<your-password>\",\n \"fullname\": \"نام نمونه\",\n \"nationalCode\": \"0000000000\",\n \"phone\": \"09120000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.liara.ir/v1/register")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"you@example.com\",\n \"password\": \"<your-password>\",\n \"fullname\": \"نام نمونه\",\n \"nationalCode\": \"0000000000\",\n \"phone\": \"09120000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.liara.ir/v1/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"you@example.com\",\n \"password\": \"<your-password>\",\n \"fullname\": \"نام نمونه\",\n \"nationalCode\": \"0000000000\",\n \"phone\": \"09120000000\"\n}"
response = http.request(request)
puts response.read_body{
"api_token": "<api-token>",
"fullname": "نام نمونه",
"avatar": "https://example.com/avatar.png"
}
Registration
Create an account
Creates a personal account and returns an API token for it. Before you can create services or API tokens, finish verifying the account (see the Verification endpoints and isVerified in GET /v1/me).
If an account with this email address already exists and password matches it, you’re logged in instead and get 200 with a token.
This endpoint is rate limited. Too many requests return 429.
POST
/
v1
/
register
Create an account
curl --request POST \
--url https://api.liara.ir/v1/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "you@example.com",
"password": "<your-password>",
"fullname": "نام نمونه",
"nationalCode": "0000000000",
"phone": "09120000000"
}
'import requests
url = "https://api.liara.ir/v1/register"
payload = {
"email": "you@example.com",
"password": "<your-password>",
"fullname": "نام نمونه",
"nationalCode": "0000000000",
"phone": "09120000000"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'you@example.com',
password: '<your-password>',
fullname: 'نام نمونه',
nationalCode: '0000000000',
phone: '09120000000'
})
};
fetch('https://api.liara.ir/v1/register', 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.liara.ir/v1/register",
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([
'email' => 'you@example.com',
'password' => '<your-password>',
'fullname' => 'نام نمونه',
'nationalCode' => '0000000000',
'phone' => '09120000000'
]),
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://api.liara.ir/v1/register"
payload := strings.NewReader("{\n \"email\": \"you@example.com\",\n \"password\": \"<your-password>\",\n \"fullname\": \"نام نمونه\",\n \"nationalCode\": \"0000000000\",\n \"phone\": \"09120000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.liara.ir/v1/register")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"you@example.com\",\n \"password\": \"<your-password>\",\n \"fullname\": \"نام نمونه\",\n \"nationalCode\": \"0000000000\",\n \"phone\": \"09120000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.liara.ir/v1/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"you@example.com\",\n \"password\": \"<your-password>\",\n \"fullname\": \"نام نمونه\",\n \"nationalCode\": \"0000000000\",\n \"phone\": \"09120000000\"\n}"
response = http.request(request)
puts response.read_body{
"api_token": "<api-token>",
"fullname": "نام نمونه",
"avatar": "https://example.com/avatar.png"
}
Body
application/json
Maximum string length:
250Persian letters and spaces only.
Maximum string length:
100Pattern:
^[\u0600-\u06FF\s]+$10 to 12 digits.
Pattern:
^\d{10,12}$Iranian mobile number in the form 09XXXXXXXXX.
Pattern:
^09\d{9}$Example:
"09120000000"
⌘I
