Identify user
curl --request POST \
--url https://my.learn.ink/api/v1/users/identify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "your_unique_user_id",
"orgId": "acme",
"data": {
"firstName": "Mary",
"lastName": "Kamau",
"country": "Kenya",
"region": "Kisumu",
"sex": "female",
"ageBracket": "18-24",
"userGroups": [
"field-agents",
"nairobi-region"
]
}
}
'import requests
url = "https://my.learn.ink/api/v1/users/identify"
payload = {
"id": "your_unique_user_id",
"orgId": "acme",
"data": {
"firstName": "Mary",
"lastName": "Kamau",
"country": "Kenya",
"region": "Kisumu",
"sex": "female",
"ageBracket": "18-24",
"userGroups": ["field-agents", "nairobi-region"]
}
}
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({
id: 'your_unique_user_id',
orgId: 'acme',
data: {
firstName: 'Mary',
lastName: 'Kamau',
country: 'Kenya',
region: 'Kisumu',
sex: 'female',
ageBracket: '18-24',
userGroups: ['field-agents', 'nairobi-region']
}
})
};
fetch('https://my.learn.ink/api/v1/users/identify', 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://my.learn.ink/api/v1/users/identify",
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([
'id' => 'your_unique_user_id',
'orgId' => 'acme',
'data' => [
'firstName' => 'Mary',
'lastName' => 'Kamau',
'country' => 'Kenya',
'region' => 'Kisumu',
'sex' => 'female',
'ageBracket' => '18-24',
'userGroups' => [
'field-agents',
'nairobi-region'
]
]
]),
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://my.learn.ink/api/v1/users/identify"
payload := strings.NewReader("{\n \"id\": \"your_unique_user_id\",\n \"orgId\": \"acme\",\n \"data\": {\n \"firstName\": \"Mary\",\n \"lastName\": \"Kamau\",\n \"country\": \"Kenya\",\n \"region\": \"Kisumu\",\n \"sex\": \"female\",\n \"ageBracket\": \"18-24\",\n \"userGroups\": [\n \"field-agents\",\n \"nairobi-region\"\n ]\n }\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://my.learn.ink/api/v1/users/identify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"your_unique_user_id\",\n \"orgId\": \"acme\",\n \"data\": {\n \"firstName\": \"Mary\",\n \"lastName\": \"Kamau\",\n \"country\": \"Kenya\",\n \"region\": \"Kisumu\",\n \"sex\": \"female\",\n \"ageBracket\": \"18-24\",\n \"userGroups\": [\n \"field-agents\",\n \"nairobi-region\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://my.learn.ink/api/v1/users/identify")
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 \"id\": \"your_unique_user_id\",\n \"orgId\": \"acme\",\n \"data\": {\n \"firstName\": \"Mary\",\n \"lastName\": \"Kamau\",\n \"country\": \"Kenya\",\n \"region\": \"Kisumu\",\n \"sex\": \"female\",\n \"ageBracket\": \"18-24\",\n \"userGroups\": [\n \"field-agents\",\n \"nairobi-region\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "your_unique_user_id",
"data": {
"userId": "a_unique_id",
"registrationStatus": "registered",
"lastActive": "2025-08-14T15:12:34+00:00",
"registeredAt": "2025-05-02T09:23:32+00:00",
"firstName": "Mary",
"lastName": "Kamau",
"country": "Kenya",
"region": "Kisumu",
"sex": "female",
"ageBracket": "18-24",
"userGroups": [
"field-agents",
"nairobi-region"
],
"learningPathId": "id1234",
"learningPathName": "Field Agent Onboarding",
"learningPathStartDate": "2025-08-12",
"learningPathDueDate": "2025-08-15",
"learningPathCompletedAt": "2025-08-14T14:42:46+00:00"
},
"token": "a_unique_sign_in_token"
}{
"code": 400,
"message": "Invalid request parameters"
}{
"code": 403,
"message": "Forbidden"
}{
"code": 500,
"message": "Internal server error"
}Identify API
Identify user
Creates a new user on first call, keeps profile data in sync on subsequent calls, and returns a short-lived sign-in token for WebView SSO.
POST
/
api
/
v1
/
users
/
identify
Identify user
curl --request POST \
--url https://my.learn.ink/api/v1/users/identify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "your_unique_user_id",
"orgId": "acme",
"data": {
"firstName": "Mary",
"lastName": "Kamau",
"country": "Kenya",
"region": "Kisumu",
"sex": "female",
"ageBracket": "18-24",
"userGroups": [
"field-agents",
"nairobi-region"
]
}
}
'import requests
url = "https://my.learn.ink/api/v1/users/identify"
payload = {
"id": "your_unique_user_id",
"orgId": "acme",
"data": {
"firstName": "Mary",
"lastName": "Kamau",
"country": "Kenya",
"region": "Kisumu",
"sex": "female",
"ageBracket": "18-24",
"userGroups": ["field-agents", "nairobi-region"]
}
}
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({
id: 'your_unique_user_id',
orgId: 'acme',
data: {
firstName: 'Mary',
lastName: 'Kamau',
country: 'Kenya',
region: 'Kisumu',
sex: 'female',
ageBracket: '18-24',
userGroups: ['field-agents', 'nairobi-region']
}
})
};
fetch('https://my.learn.ink/api/v1/users/identify', 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://my.learn.ink/api/v1/users/identify",
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([
'id' => 'your_unique_user_id',
'orgId' => 'acme',
'data' => [
'firstName' => 'Mary',
'lastName' => 'Kamau',
'country' => 'Kenya',
'region' => 'Kisumu',
'sex' => 'female',
'ageBracket' => '18-24',
'userGroups' => [
'field-agents',
'nairobi-region'
]
]
]),
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://my.learn.ink/api/v1/users/identify"
payload := strings.NewReader("{\n \"id\": \"your_unique_user_id\",\n \"orgId\": \"acme\",\n \"data\": {\n \"firstName\": \"Mary\",\n \"lastName\": \"Kamau\",\n \"country\": \"Kenya\",\n \"region\": \"Kisumu\",\n \"sex\": \"female\",\n \"ageBracket\": \"18-24\",\n \"userGroups\": [\n \"field-agents\",\n \"nairobi-region\"\n ]\n }\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://my.learn.ink/api/v1/users/identify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"your_unique_user_id\",\n \"orgId\": \"acme\",\n \"data\": {\n \"firstName\": \"Mary\",\n \"lastName\": \"Kamau\",\n \"country\": \"Kenya\",\n \"region\": \"Kisumu\",\n \"sex\": \"female\",\n \"ageBracket\": \"18-24\",\n \"userGroups\": [\n \"field-agents\",\n \"nairobi-region\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://my.learn.ink/api/v1/users/identify")
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 \"id\": \"your_unique_user_id\",\n \"orgId\": \"acme\",\n \"data\": {\n \"firstName\": \"Mary\",\n \"lastName\": \"Kamau\",\n \"country\": \"Kenya\",\n \"region\": \"Kisumu\",\n \"sex\": \"female\",\n \"ageBracket\": \"18-24\",\n \"userGroups\": [\n \"field-agents\",\n \"nairobi-region\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "your_unique_user_id",
"data": {
"userId": "a_unique_id",
"registrationStatus": "registered",
"lastActive": "2025-08-14T15:12:34+00:00",
"registeredAt": "2025-05-02T09:23:32+00:00",
"firstName": "Mary",
"lastName": "Kamau",
"country": "Kenya",
"region": "Kisumu",
"sex": "female",
"ageBracket": "18-24",
"userGroups": [
"field-agents",
"nairobi-region"
],
"learningPathId": "id1234",
"learningPathName": "Field Agent Onboarding",
"learningPathStartDate": "2025-08-12",
"learningPathDueDate": "2025-08-15",
"learningPathCompletedAt": "2025-08-14T14:42:46+00:00"
},
"token": "a_unique_sign_in_token"
}{
"code": 400,
"message": "Invalid request parameters"
}{
"code": 403,
"message": "Forbidden"
}{
"code": 500,
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I