Rasanex Notification API Docs

Version: v1 | Base Path: /api/v1 | Auth: Authorization: Bearer <token>

POST /notifications/otp/send

POST/api/v1/notifications/otp/send

Input

  • phone required string max:32
  • internal_template_key required string max:120
  • tenant_id optional string max:120
  • params optional object/array
  • options optional object/array
{
  "phone": "09120000111",
  "internal_template_key": "otp_login",
  "params": { "token": "1234" },
  "options": { "intent": "OTP_LOGIN" }
}

Output (202)

{
  "tracking_id": "uuid",
  "status": "accepted"
}

POST /notifications/send

POST/api/v1/notifications/send

Input

  • intent required string max:120
  • recipient required object
  • recipient.phone optional string
  • recipient.email optional email
  • recipient.device_tokens optional string[]
  • recipient.user_id optional integer
  • recipient.tenant_id optional string
  • payload optional object
  • options optional object
{
  "intent": "OTP_LOGIN",
  "recipient": { "phone": "09120000111" },
  "payload": { "token": "1234" },
  "options": {
    "message_kind": "provider_templated",
    "internal_template_key": "otp_login"
  }
}

Output (202)

{
  "tracking_id": "uuid",
  "status": "accepted"
}

GET /notifications/{trackingId}

GET/api/v1/notifications/{trackingId}

Output (200)

{
  "tracking_id": "uuid",
  "status": "pending|sent|failed",
  "intent": "OTP_LOGIN",
  "tenant_id": "rasanex-api",
  "scheduled_at": "Y-m-d H:i:s",
  "created_at": "Y-m-d H:i:s",
  "updated_at": "Y-m-d H:i:s",
  "channel_results": {},
  "attempts": []
}

POST /notifications/providers/kavenegar/setup

POST/api/v1/notifications/providers/kavenegar/setup

Input

  • api_key required string min:8
  • tenant_id optional
  • base_url optional url
  • type optional
  • timeout optional integer 1-60
  • is_active optional boolean

Output (200)

{
  "status": "configured",
  "tenant_id": "rasanex-api",
  "client_id": "client-id",
  "channel": "sms",
  "provider": "kavenegar"
}

POST /notifications/providers/sms/setup

POST/api/v1/notifications/providers/sms/setup

Input

  • provider required: kavenegar or twilio
  • For kavenegar: api_key required
  • For twilio: account_sid, auth_token, from required
  • Optional: tenant_id, base_url, timeout, is_active, type

Output (200)

{
  "status": "configured",
  "tenant_id": "rasanex-api",
  "client_id": "client-id",
  "channel": "sms",
  "provider": "twilio"
}

GET /notifications/settings/providers/sms

GET/api/v1/notifications/settings/providers/sms?tenant_id=...

Output (200)

{
  "tenant_id": "rasanex-api",
  "client_id": "client-id",
  "channel": "sms",
  "providers": [
    { "provider": "kavenegar", "configured": true, "active": true, "requires_setup": true }
  ]
}

PUT /notifications/settings/otp-routing

PUT/api/v1/notifications/settings/otp-routing

Input

  • providers required array min:1
  • fallback optional boolean
  • is_active optional boolean
  • intents optional array of string
  • tenant_id optional

Output (200)

{
  "status": "updated",
  "tenant_id": "rasanex-api",
  "intents": ["OTP_LOGIN"],
  "routing": {
    "channels": [
      { "channel": "sms", "providers": ["kavenegar"], "fallback": true }
    ]
  }
}

GET /notifications/settings/otp-routing

GET/api/v1/notifications/settings/otp-routing?tenant_id=...

Output (200)

{
  "tenant_id": "rasanex-api",
  "items": [
    { "intent": "OTP_LOGIN", "rule": {}, "is_active": true }
  ]
}