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 '
{
"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."
}Inbound Email
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.
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 '
{
"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
Body
application/json
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
Available options:
cdsl, nsdl, cams, kfintech Example:
["cdsl", "nsdl"]
Response
Inbound email created successfully
An inbound email address for receiving forwarded CAS emails
Was this page helpful?

