curl --request POST \
--url https://api.casparser.in/v4/inbound-email \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"alias": "john-portfolio",
"reference": "user_12345",
"callback_url": "https://api.yourapp.com/webhooks/cas-email",
"allowed_sources": [
"cdsl",
"nsdl"
],
"metadata": {
"plan": "premium",
"source": "onboarding"
}
}
'import requests
url = "https://api.casparser.in/v4/inbound-email"
payload = {
"alias": "john-portfolio",
"reference": "user_12345",
"callback_url": "https://api.yourapp.com/webhooks/cas-email",
"allowed_sources": ["cdsl", "nsdl"],
"metadata": {
"plan": "premium",
"source": "onboarding"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alias: 'john-portfolio',
reference: 'user_12345',
callback_url: 'https://api.yourapp.com/webhooks/cas-email',
allowed_sources: ['cdsl', 'nsdl'],
metadata: {plan: 'premium', source: 'onboarding'}
})
};
fetch('https://api.casparser.in/v4/inbound-email', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.casparser.in/v4/inbound-email",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'alias' => 'john-portfolio',
'reference' => 'user_12345',
'callback_url' => 'https://api.yourapp.com/webhooks/cas-email',
'allowed_sources' => [
'cdsl',
'nsdl'
],
'metadata' => [
'plan' => 'premium',
'source' => 'onboarding'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.casparser.in/v4/inbound-email"
payload := strings.NewReader("{\n \"alias\": \"john-portfolio\",\n \"reference\": \"user_12345\",\n \"callback_url\": \"https://api.yourapp.com/webhooks/cas-email\",\n \"allowed_sources\": [\n \"cdsl\",\n \"nsdl\"\n ],\n \"metadata\": {\n \"plan\": \"premium\",\n \"source\": \"onboarding\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.casparser.in/v4/inbound-email")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"alias\": \"john-portfolio\",\n \"reference\": \"user_12345\",\n \"callback_url\": \"https://api.yourapp.com/webhooks/cas-email\",\n \"allowed_sources\": [\n \"cdsl\",\n \"nsdl\"\n ],\n \"metadata\": {\n \"plan\": \"premium\",\n \"source\": \"onboarding\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v4/inbound-email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alias\": \"john-portfolio\",\n \"reference\": \"user_12345\",\n \"callback_url\": \"https://api.yourapp.com/webhooks/cas-email\",\n \"allowed_sources\": [\n \"cdsl\",\n \"nsdl\"\n ],\n \"metadata\": {\n \"plan\": \"premium\",\n \"source\": \"onboarding\"\n }\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"status": "failed",
"msg": "Invalid PDF file or password."
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}Create Inbound Email
Create a dedicated inbound email address for collecting CAS statements via email forwarding. When an investor forwards a CAS email to this address, we verify the sender and make the file available to you.
callback_url is optional:
- Set it — we POST each parsed email to your webhook as it arrives.
- Omit it — retrieve files via
GET /v4/inbound-email/{id}/fileswithout building a webhook consumer.
curl --request POST \
--url https://api.casparser.in/v4/inbound-email \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"alias": "john-portfolio",
"reference": "user_12345",
"callback_url": "https://api.yourapp.com/webhooks/cas-email",
"allowed_sources": [
"cdsl",
"nsdl"
],
"metadata": {
"plan": "premium",
"source": "onboarding"
}
}
'import requests
url = "https://api.casparser.in/v4/inbound-email"
payload = {
"alias": "john-portfolio",
"reference": "user_12345",
"callback_url": "https://api.yourapp.com/webhooks/cas-email",
"allowed_sources": ["cdsl", "nsdl"],
"metadata": {
"plan": "premium",
"source": "onboarding"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alias: 'john-portfolio',
reference: 'user_12345',
callback_url: 'https://api.yourapp.com/webhooks/cas-email',
allowed_sources: ['cdsl', 'nsdl'],
metadata: {plan: 'premium', source: 'onboarding'}
})
};
fetch('https://api.casparser.in/v4/inbound-email', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.casparser.in/v4/inbound-email",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'alias' => 'john-portfolio',
'reference' => 'user_12345',
'callback_url' => 'https://api.yourapp.com/webhooks/cas-email',
'allowed_sources' => [
'cdsl',
'nsdl'
],
'metadata' => [
'plan' => 'premium',
'source' => 'onboarding'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.casparser.in/v4/inbound-email"
payload := strings.NewReader("{\n \"alias\": \"john-portfolio\",\n \"reference\": \"user_12345\",\n \"callback_url\": \"https://api.yourapp.com/webhooks/cas-email\",\n \"allowed_sources\": [\n \"cdsl\",\n \"nsdl\"\n ],\n \"metadata\": {\n \"plan\": \"premium\",\n \"source\": \"onboarding\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.casparser.in/v4/inbound-email")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"alias\": \"john-portfolio\",\n \"reference\": \"user_12345\",\n \"callback_url\": \"https://api.yourapp.com/webhooks/cas-email\",\n \"allowed_sources\": [\n \"cdsl\",\n \"nsdl\"\n ],\n \"metadata\": {\n \"plan\": \"premium\",\n \"source\": \"onboarding\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v4/inbound-email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alias\": \"john-portfolio\",\n \"reference\": \"user_12345\",\n \"callback_url\": \"https://api.yourapp.com/webhooks/cas-email\",\n \"allowed_sources\": [\n \"cdsl\",\n \"nsdl\"\n ],\n \"metadata\": {\n \"plan\": \"premium\",\n \"source\": \"onboarding\"\n }\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"status": "failed",
"msg": "Invalid PDF file or password."
}{
"status": "failed",
"msg": "Authentication failed: API key is missing. Please provide a valid API key in the x-api-key header."
}Authorizations
Your API key for authentication.
Use sandbox-with-json-responses as Sandbox key.
Body
Optional custom email prefix (e.g.
john-portfolio@import.casparser.in). 3-32 chars,
alphanumeric + hyphens, must start/end with a letter or
number. If omitted, a random ID is generated.
3 - 32^[a-z0-9][a-z0-9-]*[a-z0-9]$"john-portfolio"
Your internal identifier (e.g., user_id, account_id). Returned in webhook payload for correlation.
256"user_12345"
Optional webhook URL where we POST parsed emails. Must be
HTTPS in production (HTTP allowed for localhost). If omitted,
retrieve files via GET /v4/inbound-email/{id}/files.
"https://api.yourapp.com/webhooks/cas-email"
Filter emails by CAS provider. If omitted, accepts all providers.
cdsl→ eCAS@cdslstatement.comnsdl→ NSDL-CAS@nsdl.co.incams→ donotreply@camsonline.comkfintech→ samfS@kfintech.com
cdsl, nsdl, cams, kfintech ["cdsl", "nsdl"]
Optional key-value pairs (max 10) to include in webhook payload. Useful for passing context like plan_type, campaign_id, etc.
Show child attributes
Show child attributes
{ "plan": "premium", "source": "onboarding" }
Response
Inbound email created successfully
An inbound email address for receiving forwarded CAS emails
Unique inbound email identifier
"ie_a1b2c3d4e5f6"
The inbound email address to forward CAS statements to
"ie_a1b2c3d4e5f6@import.casparser.in"
Your internal reference identifier
"user_12345"
Webhook URL for email notifications. If set, we POST each parsed
email here. If omitted, files are only retrievable via
GET /v4/inbound-email/{id}/files.
"https://api.yourapp.com/webhooks/cas-email"
Accepted CAS providers (empty = all)
cdsl, nsdl, cams, kfintech ["cdsl", "nsdl"]
Current inbound email lifecycle status
active, paused "active"
Custom key-value metadata
Show child attributes
Show child attributes
{ "plan": "premium" }
When the inbound email was created
"2025-02-21T10:30:00Z"
When the inbound email was last updated
"2025-02-21T10:30:00Z"
Was this page helpful?

