Create a new user by link
curl --request POST \
--url https://app.sandbox.rio.trade/api/users/link \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"country": "MX",
"email": "john.doe@example.com",
"userType": "individual",
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
'import requests
url = "https://app.sandbox.rio.trade/api/users/link"
payload = {
"country": "MX",
"email": "john.doe@example.com",
"userType": "individual",
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country: 'MX',
email: 'john.doe@example.com',
userType: 'individual',
businessName: 'My Business Inc.',
firstName: 'John',
middleName: 'Michael',
lastName: 'Doe',
secondLastName: 'Smith',
brokerId: '655f4084b96e4fb76f5a0e6e'
})
};
fetch('https://app.sandbox.rio.trade/api/users/link', 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://app.sandbox.rio.trade/api/users/link",
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([
'country' => 'MX',
'email' => 'john.doe@example.com',
'userType' => 'individual',
'businessName' => 'My Business Inc.',
'firstName' => 'John',
'middleName' => 'Michael',
'lastName' => 'Doe',
'secondLastName' => 'Smith',
'brokerId' => '655f4084b96e4fb76f5a0e6e'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://app.sandbox.rio.trade/api/users/link"
payload := strings.NewReader("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"userType\": \"individual\",\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://app.sandbox.rio.trade/api/users/link")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"userType\": \"individual\",\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandbox.rio.trade/api/users/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"userType\": \"individual\",\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "66562bc04fe8bf83c577c178",
"onboardingLink": "https://verification.example.com/session/123"
}{
"errors": [
{
"code": 19,
"message": "Not authorized"
}
]
}{
"errors": [
{
"code": 1,
"message": "User not found"
}
]
}Users API
Create a new user by link
POST
/
api
/
users
/
link
Create a new user by link
curl --request POST \
--url https://app.sandbox.rio.trade/api/users/link \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"country": "MX",
"email": "john.doe@example.com",
"userType": "individual",
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
'import requests
url = "https://app.sandbox.rio.trade/api/users/link"
payload = {
"country": "MX",
"email": "john.doe@example.com",
"userType": "individual",
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country: 'MX',
email: 'john.doe@example.com',
userType: 'individual',
businessName: 'My Business Inc.',
firstName: 'John',
middleName: 'Michael',
lastName: 'Doe',
secondLastName: 'Smith',
brokerId: '655f4084b96e4fb76f5a0e6e'
})
};
fetch('https://app.sandbox.rio.trade/api/users/link', 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://app.sandbox.rio.trade/api/users/link",
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([
'country' => 'MX',
'email' => 'john.doe@example.com',
'userType' => 'individual',
'businessName' => 'My Business Inc.',
'firstName' => 'John',
'middleName' => 'Michael',
'lastName' => 'Doe',
'secondLastName' => 'Smith',
'brokerId' => '655f4084b96e4fb76f5a0e6e'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://app.sandbox.rio.trade/api/users/link"
payload := strings.NewReader("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"userType\": \"individual\",\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://app.sandbox.rio.trade/api/users/link")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"userType\": \"individual\",\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandbox.rio.trade/api/users/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"userType\": \"individual\",\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "66562bc04fe8bf83c577c178",
"onboardingLink": "https://verification.example.com/session/123"
}{
"errors": [
{
"code": 19,
"message": "Not authorized"
}
]
}{
"errors": [
{
"code": 1,
"message": "User not found"
}
]
}v1 (legacy). This page documents the API before the v2 update. The v1
format is not enabled for new accounts and must be enabled on your account by
your account manager. New integrations should use the
current documentation. To update an existing integration,
follow the migration guide.
Authorizations
Body
application/json
Country
Available options:
MX, PE, CO Example:
"MX"
User's email address.
Example:
"john.doe@example.com"
Type of user.
Available options:
business, individual Example:
"individual"
Business name (required for business users).
Example:
"My Business Inc."
First name (required for individual users only).
Example:
"John"
Middle name (for individual users only).
Example:
"Michael"
Last name (required for individual users).
Example:
"Doe"
Second last name (for individual users only).
Example:
"Smith"
ID of the broker (optional).
Example:
"655f4084b96e4fb76f5a0e6e"