@@ -67,26 +67,14 @@ func NewInboundEmailService(opts ...option.RequestOption) (r InboundEmailService
6767}
6868
6969// Create a dedicated inbound email address for collecting CAS statements via email
70- // forwarding.
70+ // forwarding. When an investor forwards a CAS email to this address, we verify the
71+ // sender and make the file available to you.
7172//
72- // **How it works:**
73- //
74- // 1. Create an inbound email with your webhook URL
75- // 2. Display the email address to your user (e.g., "Forward your CAS to
76- // ie_xxx@import.casparser.in")
77- // 3. When an investor forwards a CAS email, we verify the sender and deliver to
78- // your webhook
79- //
80- // **Webhook Delivery:**
73+ // `callback_url` is **optional**:
8174//
82- // - We POST to your `callback_url` with JSON body containing files (matching
83- // EmailCASFile schema)
84- // - Failed deliveries are retried automatically with exponential backoff
85- //
86- // **Inactivity:**
87- //
88- // - Inbound emails with no activity in 30 days are marked inactive
89- // - Active inbound emails remain operational indefinitely
75+ // - **Set it** — we POST each parsed email to your webhook as it arrives.
76+ // - **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files` without
77+ // building a webhook consumer.
9078func (r * InboundEmailService ) New (ctx context.Context , body InboundEmailNewParams , opts ... option.RequestOption ) (res * InboundEmailNewResponse , err error ) {
9179 opts = slices .Concat (r .Options , opts )
9280 path := "v4/inbound-email"
@@ -136,8 +124,9 @@ type InboundEmailNewResponse struct {
136124 //
137125 // Any of "cdsl", "nsdl", "cams", "kfintech".
138126 AllowedSources []string `json:"allowed_sources"`
139- // Webhook URL for email notifications
140- CallbackURL string `json:"callback_url" format:"uri"`
127+ // Webhook URL for email notifications. `null` means files are only retrievable via
128+ // `GET /v4/inbound-email/{id}/files` (pull delivery).
129+ CallbackURL string `json:"callback_url" api:"nullable" format:"uri"`
141130 // When the mailbox was created
142131 CreatedAt time.Time `json:"created_at" format:"date-time"`
143132 // The inbound email address to forward CAS statements to
@@ -190,8 +179,9 @@ type InboundEmailGetResponse struct {
190179 //
191180 // Any of "cdsl", "nsdl", "cams", "kfintech".
192181 AllowedSources []string `json:"allowed_sources"`
193- // Webhook URL for email notifications
194- CallbackURL string `json:"callback_url" format:"uri"`
182+ // Webhook URL for email notifications. `null` means files are only retrievable via
183+ // `GET /v4/inbound-email/{id}/files` (pull delivery).
184+ CallbackURL string `json:"callback_url" api:"nullable" format:"uri"`
195185 // When the mailbox was created
196186 CreatedAt time.Time `json:"created_at" format:"date-time"`
197187 // The inbound email address to forward CAS statements to
@@ -269,8 +259,9 @@ type InboundEmailListResponseInboundEmail struct {
269259 //
270260 // Any of "cdsl", "nsdl", "cams", "kfintech".
271261 AllowedSources []string `json:"allowed_sources"`
272- // Webhook URL for email notifications
273- CallbackURL string `json:"callback_url" format:"uri"`
262+ // Webhook URL for email notifications. `null` means files are only retrievable via
263+ // `GET /v4/inbound-email/{id}/files` (pull delivery).
264+ CallbackURL string `json:"callback_url" api:"nullable" format:"uri"`
274265 // When the mailbox was created
275266 CreatedAt time.Time `json:"created_at" format:"date-time"`
276267 // The inbound email address to forward CAS statements to
@@ -328,16 +319,13 @@ func (r *InboundEmailDeleteResponse) UnmarshalJSON(data []byte) error {
328319}
329320
330321type InboundEmailNewParams struct {
331- // Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP
332- // allowed for localhost during development).
333- CallbackURL string `json:"callback_url" api:"required" format:"uri"`
334- // Optional custom email prefix for user-friendly addresses.
335- //
336- // - Must be 3-32 characters
337- // - Alphanumeric + hyphens only
338- // - Must start and end with letter/number
339- // - Example: `john-portfolio@import.casparser.in`
340- // - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
322+ // Optional webhook URL where we POST parsed emails. Must be HTTPS in production
323+ // (HTTP allowed for localhost). If omitted, retrieve files via
324+ // `GET /v4/inbound-email/{id}/files`.
325+ CallbackURL param.Opt [string ] `json:"callback_url,omitzero" format:"uri"`
326+ // Optional custom email prefix (e.g. `john-portfolio@import.casparser.in`). 3-32
327+ // chars, alphanumeric + hyphens, must start/end with a letter or number. If
328+ // omitted, a random ID is generated.
341329 Alias param.Opt [string ] `json:"alias,omitzero"`
342330 // Your internal identifier (e.g., user_id, account_id). Returned in webhook
343331 // payload for correlation.
0 commit comments