Skip to main content
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>"
  }
}
'
{
  "status": "failed",
  "data": [
    "<unknown>"
  ],
  "message": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.smartcomply.com/llms.txt

Use this file to discover all available pages before exploring further.

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

HeaderValueRequired
x-access-tokenYour API secret keyYes
Content-Typeapplication/jsonYes

Body Parameters

ParameterTypeRequiredDescription
user_idstringYesUnique identifier for the user
session_idstringYesIdentifier for the current session
eventstringYesEvent type: LOGIN, OTP_VERIFY, PAYMENT_INIT, PAYMENT_COMPLETE, or LOGOUT
timestampstringYesISO-8601 datetime of the event
device_idstringNoDevice identifier
ip_addressstringNoIP address during the event
metadata.amountnumberNoTransaction amount if applicable
metadata.currencystringNoCurrency 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

ParameterTypeRequiredDescription
session_idstringYesIdentifier 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

ParameterTypeRequiredDescription
session_idstringYesIdentifier 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

ParameterTypeRequiredDescription
user_idstringYesIdentifier 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

CodeDescription
200Success
201Event processed successfully
400Missing, malformed, or invalid fields
401Authentication failed or API key missing
403Insufficient permissions for this resource
404Resource or endpoint not found
429Rate limit exceeded — retry after cooldown
500Unexpected server error

Authorizations

x-access-token
string
header
required

Your Adhere API secret key

Body

application/json
user_id
string
required
session_id
string
required
event
enum<string>
required
Available options:
LOGIN,
OTP_VERIFY,
PAYMENT_INIT,
PAYMENT_COMPLETE,
LOGOUT
timestamp
string<date-time>
required
device_id
string
ip_address
string
metadata
object

Response

Event processed