Skip to main content
POST
/
v4
/
inbound-email
Create Inbound Email
curl --request POST \
  --url https://api.casparser.in/v4/inbound-email \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "callback_url": "https://api.yourapp.com/webhooks/cas-email",
  "alias": "john-portfolio",
  "reference": "user_12345",
  "allowed_sources": [
    "cdsl",
    "nsdl"
  ],
  "metadata": {
    "plan": "premium",
    "source": "onboarding"
  }
}
'
{
  "inbound_email_id": "ie_a1b2c3d4e5f6",
  "email": "ie_a1b2c3d4e5f6@import.casparser.in",
  "reference": "user_12345",
  "callback_url": "https://api.yourapp.com/webhooks/cas-email",
  "allowed_sources": [
    "cdsl",
    "nsdl"
  ],
  "status": "active",
  "metadata": {
    "plan": "premium"
  },
  "created_at": "2025-02-21T10:30:00Z",
  "updated_at": "2025-02-21T10:30:00Z"
}

Authorizations

x-api-key
string
header
required

Your API key for authentication. Use sandbox-with-json-responses as Sandbox key.

Body

application/json
callback_url
string<uri>
required

Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP allowed for localhost during development).

Example:

"https://api.yourapp.com/webhooks/cas-email"

alias
string

Optional custom email prefix for user-friendly addresses.

  • Must be 3-32 characters
  • Alphanumeric + hyphens only
  • Must start and end with letter/number
  • Example: john-portfolio@import.casparser.in
  • If omitted, generates random ID like ie_abc123xyz@import.casparser.in
Required string length: 3 - 32
Example:

"john-portfolio"

reference
string

Your internal identifier (e.g., user_id, account_id). Returned in webhook payload for correlation.

Maximum string length: 256
Example:

"user_12345"

allowed_sources
enum<string>[]

Filter emails by CAS provider. If omitted, accepts all providers.

Available options:
cdsl,
nsdl,
cams,
kfintech
Example:
["cdsl", "nsdl"]
metadata
object

Optional key-value pairs (max 10) to include in webhook payload. Useful for passing context like plan_type, campaign_id, etc.

Example:
{ "plan": "premium", "source": "onboarding" }

Response

Mailbox created successfully

An inbound email address for receiving forwarded CAS emails

inbound_email_id
string

Unique inbound email identifier

Example:

"ie_a1b2c3d4e5f6"

email
string<email>

The inbound email address to forward CAS statements to

Example:

"ie_a1b2c3d4e5f6@import.casparser.in"

reference
string | null

Your internal reference identifier

Example:

"user_12345"

callback_url
string<uri>

Webhook URL for email notifications

Example:

"https://api.yourapp.com/webhooks/cas-email"

allowed_sources
enum<string>[]

Accepted CAS providers (empty = all)

Available options:
cdsl,
nsdl,
cams,
kfintech
Example:
["cdsl", "nsdl"]
status
enum<string>

Current mailbox status

Available options:
active,
paused
Example:

"active"

metadata
object

Custom key-value metadata

Example:
{ "plan": "premium" }
created_at
string<date-time>

When the mailbox was created

Example:

"2025-02-21T10:30:00Z"

updated_at
string<date-time>

When the mailbox was last updated

Example:

"2025-02-21T10:30:00Z"