Entity Management
Create Entity
Creates a new individual or business entity record for verification and monitoring purposes.
POST
/
v2
/
api
/
entities
Create Entity
curl --request POST \
--url https://api.youverify.co/v2/api/entities \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"entityType": "individual",
"isSubjectConsent": true,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+2348012345678",
"gender": "male",
"dateOfBirth": "1990-01-01",
"nationality": "NG",
"imageUrl": "http://someimage",
"verifiedBy": "client"
}
'import requests
url = "https://api.youverify.co/v2/api/entities"
payload = {
"entityType": "individual",
"isSubjectConsent": True,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+2348012345678",
"gender": "male",
"dateOfBirth": "1990-01-01",
"nationality": "NG",
"imageUrl": "http://someimage",
"verifiedBy": "client"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'individual',
isSubjectConsent: true,
firstName: 'John',
lastName: 'Doe',
email: 'john.doe@example.com',
phone: '+2348012345678',
gender: 'male',
dateOfBirth: '1990-01-01',
nationality: 'NG',
imageUrl: 'http://someimage',
verifiedBy: 'client'
})
};
fetch('https://api.youverify.co/v2/api/entities', 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.youverify.co/v2/api/entities",
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([
'entityType' => 'individual',
'isSubjectConsent' => true,
'firstName' => 'John',
'lastName' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+2348012345678',
'gender' => 'male',
'dateOfBirth' => '1990-01-01',
'nationality' => 'NG',
'imageUrl' => 'http://someimage',
'verifiedBy' => 'client'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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://api.youverify.co/v2/api/entities"
payload := strings.NewReader("{\n \"entityType\": \"individual\",\n \"isSubjectConsent\": true,\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+2348012345678\",\n \"gender\": \"male\",\n \"dateOfBirth\": \"1990-01-01\",\n \"nationality\": \"NG\",\n \"imageUrl\": \"http://someimage\",\n \"verifiedBy\": \"client\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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://api.youverify.co/v2/api/entities")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"individual\",\n \"isSubjectConsent\": true,\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+2348012345678\",\n \"gender\": \"male\",\n \"dateOfBirth\": \"1990-01-01\",\n \"nationality\": \"NG\",\n \"imageUrl\": \"http://someimage\",\n \"verifiedBy\": \"client\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.youverify.co/v2/api/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityType\": \"individual\",\n \"isSubjectConsent\": true,\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+2348012345678\",\n \"gender\": \"male\",\n \"dateOfBirth\": \"1990-01-01\",\n \"nationality\": \"NG\",\n \"imageUrl\": \"http://someimage\",\n \"verifiedBy\": \"client\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 201,
"message": "Entity created successfully.",
"data": {
"id": "ent_684f5cc5a47a3926763b83a7",
"businessId": "61d880f1e8e15aaf24558f1a",
"createdBy": {
"firstName": "Timothy",
"lastName": "Akinyelu",
"middleName": "",
"id": "61f162ec1fd251c3a63f31c2"
}
}
}{
"success": false,
"statusCode": 401,
"message": "Permission denied",
"name": "UnauthorizedError",
"data": {}
}{
"success": false,
"statusCode": 402,
"message": "Insufficient fund",
"name": "PaymentRequiredError",
"data": {}
}{
"success": false,
"statusCode": 404,
"message": "You have attempted to get a resource that does not exist.",
"name": "ResourceNotFoundError",
"data": {}
}{
"success": false,
"statusCode": 429,
"message": "Too many requests",
"name": "RateLimitError",
"data": {}
}{
"success": false,
"statusCode": 500,
"message": "Internal Server Error",
"name": "Error",
"data": {}
}Body
application/json
Response
Success
⌘I
Create Entity
curl --request POST \
--url https://api.youverify.co/v2/api/entities \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"entityType": "individual",
"isSubjectConsent": true,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+2348012345678",
"gender": "male",
"dateOfBirth": "1990-01-01",
"nationality": "NG",
"imageUrl": "http://someimage",
"verifiedBy": "client"
}
'import requests
url = "https://api.youverify.co/v2/api/entities"
payload = {
"entityType": "individual",
"isSubjectConsent": True,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+2348012345678",
"gender": "male",
"dateOfBirth": "1990-01-01",
"nationality": "NG",
"imageUrl": "http://someimage",
"verifiedBy": "client"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'individual',
isSubjectConsent: true,
firstName: 'John',
lastName: 'Doe',
email: 'john.doe@example.com',
phone: '+2348012345678',
gender: 'male',
dateOfBirth: '1990-01-01',
nationality: 'NG',
imageUrl: 'http://someimage',
verifiedBy: 'client'
})
};
fetch('https://api.youverify.co/v2/api/entities', 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.youverify.co/v2/api/entities",
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([
'entityType' => 'individual',
'isSubjectConsent' => true,
'firstName' => 'John',
'lastName' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+2348012345678',
'gender' => 'male',
'dateOfBirth' => '1990-01-01',
'nationality' => 'NG',
'imageUrl' => 'http://someimage',
'verifiedBy' => 'client'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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://api.youverify.co/v2/api/entities"
payload := strings.NewReader("{\n \"entityType\": \"individual\",\n \"isSubjectConsent\": true,\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+2348012345678\",\n \"gender\": \"male\",\n \"dateOfBirth\": \"1990-01-01\",\n \"nationality\": \"NG\",\n \"imageUrl\": \"http://someimage\",\n \"verifiedBy\": \"client\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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://api.youverify.co/v2/api/entities")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"individual\",\n \"isSubjectConsent\": true,\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+2348012345678\",\n \"gender\": \"male\",\n \"dateOfBirth\": \"1990-01-01\",\n \"nationality\": \"NG\",\n \"imageUrl\": \"http://someimage\",\n \"verifiedBy\": \"client\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.youverify.co/v2/api/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityType\": \"individual\",\n \"isSubjectConsent\": true,\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+2348012345678\",\n \"gender\": \"male\",\n \"dateOfBirth\": \"1990-01-01\",\n \"nationality\": \"NG\",\n \"imageUrl\": \"http://someimage\",\n \"verifiedBy\": \"client\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 201,
"message": "Entity created successfully.",
"data": {
"id": "ent_684f5cc5a47a3926763b83a7",
"businessId": "61d880f1e8e15aaf24558f1a",
"createdBy": {
"firstName": "Timothy",
"lastName": "Akinyelu",
"middleName": "",
"id": "61f162ec1fd251c3a63f31c2"
}
}
}{
"success": false,
"statusCode": 401,
"message": "Permission denied",
"name": "UnauthorizedError",
"data": {}
}{
"success": false,
"statusCode": 402,
"message": "Insufficient fund",
"name": "PaymentRequiredError",
"data": {}
}{
"success": false,
"statusCode": 404,
"message": "You have attempted to get a resource that does not exist.",
"name": "ResourceNotFoundError",
"data": {}
}{
"success": false,
"statusCode": 429,
"message": "Too many requests",
"name": "RateLimitError",
"data": {}
}{
"success": false,
"statusCode": 500,
"message": "Internal Server Error",
"name": "Error",
"data": {}
}