Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.responsibleailabs.ai/llms.txt

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

Overview: Compliance API | Credits: 0.1 per call (up to 50 events)
Fire-and-forget event recording. Events are stored as tamper-evident compliance evidence and feed into /evaluate and /require decisions.

Parameters

session_id
string
Links events to a compliance session. When provided, events automatically update session state.
events
array
required
1-50 events per call.
events[].type
string
required
Event type from the taxonomy below.
events[].timestamp
string
ISO-8601 timestamp. Defaults to server time if omitted.
events[].data
object
required
Event-specific payload. Include user_id, purpose, and any relevant identifiers.

Event type taxonomy

CategoryEvent Types
Consent/Noticenotice.shown, consent.granted, consent.refused, consent.withdrawn
Decisionsdecision.made, explanation.shown, appeal.opened, appeal.resolved
DSRdsr.received, dsr.acknowledged, dsr.responded, dsr.escalated
Data Lifecycledata.collected, data.shared, data.transferred, retention.started, erasure.executed, breach.detected
Childrenchild.detected, child.parental_consent, child.tracking_attempted, child.aged_out
Modelmodel.deployed, model.retrained
Aggregateaggregate.fairness_metrics, aggregate.decision_stats

Session state side effects

Events automatically update session state when a session_id is provided:
Event TypeState Change
consent.grantedSets purpose consent to “active”; adds consent_obtained to fulfilled obligations
consent.withdrawnSets purpose consent to “withdrawn”
notice.shownSets notice_shown = true; adds notice_shown to fulfilled obligations
child.detectedSets child_session = true
child.parental_consentAdds parental_consent_obtained to fulfilled obligations
decision.madeAdds decision_communicated to fulfilled obligations
explanation.shownAdds explanation_shown to fulfilled obligations

Timer auto-creation

Some events automatically start compliance timers with regulatory deadlines:
EventTimer TypeDeadline
dsr.receiveddsr_sla90 days (Rule 14(3))
breach.detectedcertin_notification6 hours (CERT-In Directions 2022)
breach.detecteddpbi_initial_intimationImmediate
breach.detecteddpbi_detailed_report72 hours (Rule 7)
retention.startedpre_erasure_noticeretention_days - 2
retention.startederasure_executionretention_days

Request

curl -X POST https://api.responsibleailabs.ai/railscore/v1/compliance/dpdp/emit \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_RAIL_API_KEY" \
  -d '{
    "session_id": "sess_abc123def456",
    "events": [
      {
        "type": "consent.granted",
        "timestamp": "2026-05-14T08:13:55Z",
        "data": {
          "user_id": "u_hashed_abc",
          "purpose": "credit_scoring",
          "notice_id": "notice_2026_v3",
          "method": "explicit_checkbox",
          "withdrawal_mechanism": "settings_page"
        }
      }
    ]
  }'

Response

{
  "result": {
    "accepted": 1,
    "rejected": 0,
    "events": [
      {
        "event_id": "evt_abc123def456",
        "type": "consent.granted",
        "status": "recorded",
        "timers_started": [],
        "state_changes": ["consent_status", "fulfilled_obligations"]
      }
    ]
  },
  "credits_consumed": 0.1
}
result.accepted
integer
Number of events successfully recorded.
result.rejected
integer
Number of events that failed validation.
result.events
array
Per-event results. Each includes event_id, type, status ("recorded" or "rejected"), timers_started (timer IDs created by this event), and state_changes (session fields updated).