Submit Journey Event
curl --request POST \
--url https://adhere-api.smartcomply.com/api/v1/journey/event/ \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
'import requests
url = "https://adhere-api.smartcomply.com/api/v1/journey/event/"
payload = {
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
session_id: '<string>',
timestamp: '2023-11-07T05:31:56Z',
device_id: '<string>',
ip_address: '<string>',
metadata: {amount: 123, currency: '<string>'}
})
};
fetch('https://adhere-api.smartcomply.com/api/v1/journey/event/', 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://adhere-api.smartcomply.com/api/v1/journey/event/",
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([
'user_id' => '<string>',
'session_id' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'device_id' => '<string>',
'ip_address' => '<string>',
'metadata' => [
'amount' => 123,
'currency' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-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://adhere-api.smartcomply.com/api/v1/journey/event/"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-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://adhere-api.smartcomply.com/api/v1/journey/event/")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/v1/journey/event/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}Transaction Monitoring
User Journey Tracking
Track and validate user transaction events in sequence to detect out-of-order or suspicious behaviour.
POST
/
api
/
v1
/
journey
/
event
/
Submit Journey Event
curl --request POST \
--url https://adhere-api.smartcomply.com/api/v1/journey/event/ \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
'import requests
url = "https://adhere-api.smartcomply.com/api/v1/journey/event/"
payload = {
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
session_id: '<string>',
timestamp: '2023-11-07T05:31:56Z',
device_id: '<string>',
ip_address: '<string>',
metadata: {amount: 123, currency: '<string>'}
})
};
fetch('https://adhere-api.smartcomply.com/api/v1/journey/event/', 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://adhere-api.smartcomply.com/api/v1/journey/event/",
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([
'user_id' => '<string>',
'session_id' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'device_id' => '<string>',
'ip_address' => '<string>',
'metadata' => [
'amount' => 123,
'currency' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-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://adhere-api.smartcomply.com/api/v1/journey/event/"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-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://adhere-api.smartcomply.com/api/v1/journey/event/")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/v1/journey/event/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}The User Journey API tracks critical steps in a user’s transaction flow through defined checkpoints. It validates that expected events occur in the correct sequence and flags suspicious or out-of-order behaviour in real time.
Submit Event
Submit a user journey event for fraud assessment.Endpoint
POST /api/v1/journey/event/
Headers
| Header | Value | Required |
|---|---|---|
x-access-token | Your API secret key | Yes |
Content-Type | application/json | Yes |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Unique identifier for the user |
session_id | string | Yes | Identifier for the current session |
event | string | Yes | Event type: LOGIN, OTP_VERIFY, PAYMENT_INIT, PAYMENT_COMPLETE, or LOGOUT |
timestamp | string | Yes | ISO-8601 datetime of the event |
device_id | string | No | Device identifier |
ip_address | string | No | IP address during the event |
metadata.amount | number | No | Transaction amount if applicable |
metadata.currency | string | No | Currency code |
201 Created
{
"status": "Success",
"data": {
"status": "allow",
"risk_score": 0.12,
"reason": "Normal login pattern",
"session_state": "OTP_VERIFY",
"alert_triggered": false
},
"message": "success"
}
Get Session State
Retrieve the current state and event history for a session.Endpoint
GET /api/v1/journey/session/{session_id}/
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Identifier for the session to retrieve |
200 OK
{
"status": "success",
"data": {
"session_id": "abc-123",
"user_id": "user-456",
"current_state": "PAYMENT_INIT",
"events": [],
"start_time": "2025-08-01T10:00:00Z"
},
"message": "success"
}
Clear Session
Delete all stored data for a session.Endpoint
DELETE /api/v1/journey/session/{session_id}/
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Identifier for the session to clear |
204 No Content
{
"message": "Session cleared"
}
User Analytics
Retrieve fraud and risk statistics for a user across all sessions.Endpoint
GET /api/v1/journey/analytics/user/{user_id}/
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Identifier for the user |
200 OK
{
"status": "success",
"data": {
"user_id": "user-456",
"total_events": 42,
"average_risk_score": 0.08,
"blocked_events": 1,
"reviewed_events": 3,
"total_sessions": 10,
"average_session_risk": 0.07
},
"message": "Success"
}
Health Check
Check the service health and dependency status.Endpoint
GET /api/v1/journey/health/
200 OK
{
"status": "healthy",
"broker": "connected",
"database": "connected",
"timestamp": "2025-08-01T10:00:00Z"
}
Error Codes
| Code | Description |
|---|---|
200 | Success |
201 | Event processed successfully |
400 | Missing, malformed, or invalid fields |
401 | Authentication failed or API key missing |
403 | Insufficient permissions for this resource |
404 | Resource or endpoint not found |
429 | Rate limit exceeded — retry after cooldown |
500 | Unexpected server error |
Authorizations
Your Adhere API secret key
Body
application/json
Response
Event processed
⌘I

