22
33from __future__ import annotations
44
5- from typing import Dict , List
5+ from typing import Dict , List , Optional
66from typing_extensions import Literal
77
88import httpx
@@ -73,9 +73,9 @@ def with_streaming_response(self) -> InboundEmailResourceWithStreamingResponse:
7373 def create (
7474 self ,
7575 * ,
76- callback_url : str ,
7776 alias : str | Omit = omit ,
7877 allowed_sources : List [Literal ["cdsl" , "nsdl" , "cams" , "kfintech" ]] | Omit = omit ,
78+ callback_url : Optional [str ] | Omit = omit ,
7979 metadata : Dict [str , str ] | Omit = omit ,
8080 reference : str | Omit = omit ,
8181 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -87,38 +87,19 @@ def create(
8787 ) -> InboundEmailCreateResponse :
8888 """
8989 Create a dedicated inbound email address for collecting CAS statements via email
90- forwarding.
90+ forwarding. When an investor forwards a CAS email to this address, we verify the
91+ sender and make the file available to you.
9192
92- **How it works:**
93+ `callback_url` is **optional**:
9394
94- 1. Create an inbound email with your webhook URL
95- 2. Display the email address to your user (e.g., "Forward your CAS to
96- ie_xxx@import.casparser.in")
97- 3. When an investor forwards a CAS email, we verify the sender and deliver to
98- your webhook
99-
100- **Webhook Delivery:**
101-
102- - We POST to your `callback_url` with JSON body containing files (matching
103- EmailCASFile schema)
104- - Failed deliveries are retried automatically with exponential backoff
105-
106- **Inactivity:**
107-
108- - Inbound emails with no activity in 30 days are marked inactive
109- - Active inbound emails remain operational indefinitely
95+ - **Set it** — we POST each parsed email to your webhook as it arrives.
96+ - **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files` without
97+ building a webhook consumer.
11098
11199 Args:
112- callback_url: Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP
113- allowed for localhost during development).
114-
115- alias: Optional custom email prefix for user-friendly addresses.
116-
117- - Must be 3-32 characters
118- - Alphanumeric + hyphens only
119- - Must start and end with letter/number
120- - Example: `john-portfolio@import.casparser.in`
121- - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
100+ alias: Optional custom email prefix (e.g. `john-portfolio@import.casparser.in`). 3-32
101+ chars, alphanumeric + hyphens, must start/end with a letter or number. If
102+ omitted, a random ID is generated.
122103
123104 allowed_sources: Filter emails by CAS provider. If omitted, accepts all providers.
124105
@@ -127,6 +108,10 @@ def create(
127108 - `cams` → donotreply@camsonline.com
128109 - `kfintech` → samfS@kfintech.com
129110
111+ callback_url: Optional webhook URL where we POST parsed emails. Must be HTTPS in production
112+ (HTTP allowed for localhost). If omitted, retrieve files via
113+ `GET /v4/inbound-email/{id}/files`.
114+
130115 metadata: Optional key-value pairs (max 10) to include in webhook payload. Useful for
131116 passing context like plan_type, campaign_id, etc.
132117
@@ -145,9 +130,9 @@ def create(
145130 "/v4/inbound-email" ,
146131 body = maybe_transform (
147132 {
148- "callback_url" : callback_url ,
149133 "alias" : alias ,
150134 "allowed_sources" : allowed_sources ,
135+ "callback_url" : callback_url ,
151136 "metadata" : metadata ,
152137 "reference" : reference ,
153138 },
@@ -328,9 +313,9 @@ def with_streaming_response(self) -> AsyncInboundEmailResourceWithStreamingRespo
328313 async def create (
329314 self ,
330315 * ,
331- callback_url : str ,
332316 alias : str | Omit = omit ,
333317 allowed_sources : List [Literal ["cdsl" , "nsdl" , "cams" , "kfintech" ]] | Omit = omit ,
318+ callback_url : Optional [str ] | Omit = omit ,
334319 metadata : Dict [str , str ] | Omit = omit ,
335320 reference : str | Omit = omit ,
336321 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -342,38 +327,19 @@ async def create(
342327 ) -> InboundEmailCreateResponse :
343328 """
344329 Create a dedicated inbound email address for collecting CAS statements via email
345- forwarding.
330+ forwarding. When an investor forwards a CAS email to this address, we verify the
331+ sender and make the file available to you.
346332
347- **How it works:**
333+ `callback_url` is **optional**:
348334
349- 1. Create an inbound email with your webhook URL
350- 2. Display the email address to your user (e.g., "Forward your CAS to
351- ie_xxx@import.casparser.in")
352- 3. When an investor forwards a CAS email, we verify the sender and deliver to
353- your webhook
354-
355- **Webhook Delivery:**
356-
357- - We POST to your `callback_url` with JSON body containing files (matching
358- EmailCASFile schema)
359- - Failed deliveries are retried automatically with exponential backoff
360-
361- **Inactivity:**
362-
363- - Inbound emails with no activity in 30 days are marked inactive
364- - Active inbound emails remain operational indefinitely
335+ - **Set it** — we POST each parsed email to your webhook as it arrives.
336+ - **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files` without
337+ building a webhook consumer.
365338
366339 Args:
367- callback_url: Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP
368- allowed for localhost during development).
369-
370- alias: Optional custom email prefix for user-friendly addresses.
371-
372- - Must be 3-32 characters
373- - Alphanumeric + hyphens only
374- - Must start and end with letter/number
375- - Example: `john-portfolio@import.casparser.in`
376- - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
340+ alias: Optional custom email prefix (e.g. `john-portfolio@import.casparser.in`). 3-32
341+ chars, alphanumeric + hyphens, must start/end with a letter or number. If
342+ omitted, a random ID is generated.
377343
378344 allowed_sources: Filter emails by CAS provider. If omitted, accepts all providers.
379345
@@ -382,6 +348,10 @@ async def create(
382348 - `cams` → donotreply@camsonline.com
383349 - `kfintech` → samfS@kfintech.com
384350
351+ callback_url: Optional webhook URL where we POST parsed emails. Must be HTTPS in production
352+ (HTTP allowed for localhost). If omitted, retrieve files via
353+ `GET /v4/inbound-email/{id}/files`.
354+
385355 metadata: Optional key-value pairs (max 10) to include in webhook payload. Useful for
386356 passing context like plan_type, campaign_id, etc.
387357
@@ -400,9 +370,9 @@ async def create(
400370 "/v4/inbound-email" ,
401371 body = await async_maybe_transform (
402372 {
403- "callback_url" : callback_url ,
404373 "alias" : alias ,
405374 "allowed_sources" : allowed_sources ,
375+ "callback_url" : callback_url ,
406376 "metadata" : metadata ,
407377 "reference" : reference ,
408378 },
0 commit comments