Api Reference

Authentication — API Reference

REST API reference for the Silent Auth Call Authentication module in kasookoo-sdk-backend.

For verification options, sequence diagrams, and integration architecture, see the main Authentication Dev integration guide.


Table of contents

  1. Authentication
  2. Base path
  3. Data model
  4. Endpoints summary
  5. GET /health
  6. POST /sessions
  7. POST /sessions/{session_id}/trigger-outbound
  8. POST /sessions/{session_id}/verify
  9. POST /sessions/{session_id}/verify-otp
  10. GET /sessions/list
  11. Verification webhook
  12. Error handling
  13. Related documentation

Authentication

All silent auth call endpoints require a valid SDK JWT:

Authorization: Bearer <sdk_access_token>

Mint a token via POST /api/v1/sdk/auth/client-sessions (see POSTMAN_COLLECTION_README.md).

  • Tenant scope comes from the organization_id claim in the JWT (get_organization_id). Do not send organization_id in query or body — it is ignored on create.
  • Session-scoped routes verify the session belongs to the JWT's organization; cross-tenant access returns 404.
  • GET /sessions/list also requires SDK JWT (operator/debug listing for the authenticated tenant context).

Base path

/api/v1/silent-auth-call

All endpoints require Authorization: Bearer <sdk_access_token> unless noted.


Data model

MongoDB collection: silent_auth_call_sessions

FieldTypeDescription
session_idstring (UUID)Public session identifier
msisdnstringNormalized E.164 phone number (any country)
methodstringcallback, callback_whatsapp, missed_outbound_call, voice_otp, or push_otp
statusstringpending, verified, expired, or failed
organization_idObjectId / nullFrom JWT at session creation
device_fingerprintstring / nullRequired for missed_outbound_call and push_otp
webhook_urlstring / nullHTTPS URL POSTed on verification
metadataobjectOpaque client metadata
attempt_countintFailed verify attempts
otp_codestring / nullServer-side only for voice_otp; never returned by API
push_codestring / nullServer-side only for push_otp; sent via FCM payload, never returned by API
outbound_room_namestring / nullSIP outbound session room name
created_at, updated_at, expires_at, verified_atdatetime (UTC)Lifecycle timestamps

Legacy method aliases: hybrid and outbound_missed_call are accepted for missed_outbound_call on create.


Endpoints summary

MethodPathDescription
GET/healthConfiguration and rate-limit status for JWT org
POST/sessionsCreate verification session
POST/sessions/{session_id}/trigger-outboundTrigger verification side effect (missed_outbound_call, voice_otp, push_otp)
POST/sessions/{session_id}/verifyFlashcall or InApp one-button verify (SDK submits code from push payload)
POST/sessions/{session_id}/verify-otpEnhanced OTP Call one-button verify (SDK submits OTP from push payload)
GET/sessions/listDebug session list

GET /health

Response (200):

{
  "configured": true,
  "did_number": "+2348012345678",
  "fixed_cli": "+2348012345678",
  "organization_id": "674a1b2c3d4e5f6789012345",
  "line_source": "primary_associated_number",
  "session_ttl_seconds": 60,
  "rate_limit": {
    "max_attempts": 5,
    "window_minutes": 10
  }
}

POST /sessions

Request body:

{
  "msisdn": "08031234567",
  "method": "callback",
  "device_fingerprint": "required-for-missed_outbound_call-or-push_otp",
  "webhook_url": "https://your-app.com/hooks/silent-auth-call-verified",
  "metadata": { "app_version": "1.2.0" }
}
FieldTypeRequiredDescription
msisdnstringYesUser phone in E.164 (+447…, +234…, +1…) or local format (parsed with SILENT_AUTH_CALL_DEFAULT_PHONE_REGION, default NG)
methodstringNocallback (default), callback_whatsapp, missed_outbound_call, voice_otp, or push_otp
device_fingerprintstringYes for missed_outbound_call and push_otpClient device ID for replay protection
webhook_urlstringNoMust be https://; POSTed when verified
metadataobjectNoStored verbatim

organization_id in the body is ignored; org scope comes from the JWT.

Response (201):

{
  "session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "method": "callback",
  "status": "pending",
  "msisdn": "+2348031234567",
  "did_number": "+2348012345678",
  "fixed_cli": null,
  "expires_at": "2026-06-12T10:01:00Z",
  "created_at": "2026-06-12T10:00:00Z",
  "verified_at": null,
  "organization_id": "674a1b2c3d4e5f6789012345"
}

POST /sessions/{session_id}/trigger-outbound

Trigger method-specific verification: SIP outbound for missed_outbound_call/voice_otp (voice OTP also sends OTP push to SDK), push notification for push_otp.

Response (200) includes outbound_triggered: true and outbound_room_name.


POST /sessions/{session_id}/verify

Used by Option 3 (Flashcall) and Option 5 (InApp).

Option 3 — Flashcall (after SDK detects missed call from fixed_cli):

{
  "device_fingerprint": "same-value-as-create",
  "timestamp": "2026-06-12T10:00:05Z"
}

Option 5 — InApp — used after the user taps Verify on the consent screen. SDK submits the code automatically from the push payload (user does not type digits).

{
  "device_fingerprint": "same-value-as-create",
  "code": "4821"
}

The code value must match the verification code shown on screen and sent in the push notification for the active push_otp session.

Response (200):

{
  "session_id": "...",
  "status": "verified",
  "verified": true,
  "msisdn": "+2348031234567",
  "verified_at": "2026-06-12T10:00:06Z"
}

POST /sessions/{session_id}/verify-otp

Option 4 — Enhanced OTP Call — used after the user taps Verify on the consent screen. SDK submits the OTP automatically from the push payload (user does not type digits).

{ "otp": "4821" }

The otp value must match the code shown on screen and sent in the push notification for the active voice_otp session.


GET /sessions/list

Debug listing. Query params: msisdn, status, limit (1–200, default 50). otp_code is excluded from results.


Verification webhook (client-provided URL)

When webhook_url is set and verification succeeds:

{
  "session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "verified",
  "msisdn": "+2348031234567",
  "method": "callback",
  "verified_at": "2026-06-12T10:00:03Z"
}

Delivery is best-effort (10 s timeout).


Error handling

HTTPWhen
400Invalid MSISDN, missing fingerprint for Flashcall, invalid OTP format
401Missing or invalid SDK JWT
403Wrong OTP or device fingerprint mismatch
404Unknown session or session in another org
409Session already verified
410Session expired or failed
429MSISDN rate limit exceeded on session create
502Outbound SIP call failed
503DID/CLI not configured for chosen method

Related documentation


Kasookoo Communications Ltd · Kasookoo SDK Backend


Did this page help you?