@productcraft/mail 0.2.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AASO,IAAM,OAAN,MAAW;AAAA;AAAA,EAEA,MAAA;AAAA,EAEhB,WAAA,CAAY,MAAA,GAAyB,EAAC,EAAG;AACvC,IAAA,IAAA,CAAK,MAAA,GAAS,UAAA,CAAkB,WAAA,CAAY,IAAA,EAAM,MAAM,CAAA;AAAA,EAC1D;AACF","file":"index.js","sourcesContent":["import type { paths } from \"./_generated.js\";\nimport { makeClient, PC_BASE_URL, type PCClientConfig } from \"@productcraft/core\";\n\n/**\n * Mail — typed `openapi-fetch` client for every endpoint in\n * `Specs/mail.json`. Reach for `client.GET(\"/v1/...\")` or\n * `client.POST(...)`; request / response types come from the\n * generated `paths` interface.\n */\nexport class Mail {\n /** The underlying typed client. v0 surface — every endpoint reachable. */\n public readonly client: ReturnType<typeof makeClient<paths>>;\n\n constructor(config: PCClientConfig = {}) {\n this.client = makeClient<paths>(PC_BASE_URL.mail, config);\n }\n}\n\nexport type { paths } from \"./_generated.js\";\n"]}
1
+ {"version":3,"sources":["../src/_generated/resources.ts","../src/_generated/types.ts","../src/_generated/client.ts","../src/_generated/errors.ts"],"names":["Mail"],"mappings":";;;;;;AAuBO,IAAM,cAAN,MAAkB;AAAA,EACJ,OAAA;AAAA;AAAA,EAEA,EAAA;AAAA,EACnB,WAAA,CAAY,MAAA,EAAmB,KAAA,GAAe,EAAC,EAAG;AAChD,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA;AACf,IAAA,IAAA,CAAK,EAAA,GAAK,KAAA;AAAA,EACZ;AACF,CAAA;AAKO,IAAM,aAAA,GAAN,cAA4B,WAAA,CAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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mBAAA,EAAqB,yBAAA,EAA2B,wBAAA,EAA0B,4BAAA,EAA8B,6BAAA,EAA+B,qBAAA,EAAuB,sBAAA,EAAwB,kBAAA,EAAoB,eAAA,EAAiB,yBAAA,EAA2B,gCAAA,EAAkC,4BAAA,EAA8B,4BAAA,EAA8B,sBAAA,EAAwB,kBAAA,EAAoB,wBAAA,EAA0B,iBAAA,EAAmB,mBAAA,EAAqB,sBAAA,EAAwB,oCAAA,EAAsC,oBAAA,EAAsB,kBAAA,EAAoB,kBAAA,EAAoB,sBAAA,EAAwB,gCAAA,EAAkC,aAAA,EAAe,cAAA,EAAgB,oBAAA,EAAsB,qBAAA,EAAuB,gBAAA,EAAkB,sBAAA,EAAwB,sBAAA,EAAwB,kBAAA,EAAoB,cAAA,EAAgB,uBAAA,EAAyB,uBAAA,EAAyB,yBAAA,EAA2B,gBAAA,EAAkB,4BAAA,EAA8B,yBAAA,EAA2B,sBAAA,EAAwB,yBAAA,EAA2B,iBAAA,EAAmB,sBAAA,EAAwB,sBAAA,EAAwB,uBAAA,EAAyB,gBAAA,EAAkB,eAAA,EAAiB,mBAAA,EAAqB,oBAAA,EAAsB,oBAAA,EAAsB,4BAAA,EAA8B,sBAAA,EAAwB,mBAAA,EAAqB,uBAAA,EAAyB,wBAAA,EAA0B,uBAAA,EAAyB,4BAAA,EAA8B,oBAAA,EAAsB,wBAAA,EAA0B,4BAAA,EAA8B,cAAA,EAAgB,aAAA,EAAe,iBAAA,EAAmB,wBAAA,EAA0B,0BAAA,EAA4B,2BAAA,EAA6B,iCAAA,EAAmC,0BAAA,EAA4B,mBAAA,EAAqB,gCAAgC,CAAA","file":"index.js","sourcesContent":["// Generated by scripts/gen-sdk.mjs from Specs/mail.json. Do not edit.\n\nimport type { APIClient, APIPromise, PagePromise, PollOptions, RequestOptions } from \"@productcraft/core\";\nimport type * as T from \"./types.js\";\nimport type { UnwrapWebhookEvent, WebhookUnwrapParams } from \"./webhooks.js\";\n\ntype Bound = Readonly<Record<string, string | undefined>>;\n\n/** Split params into [picked, rest] by key. */\nfunction split(params: object | undefined, keys: readonly string[]): [Record<string, unknown>, Record<string, unknown>] {\n const picked: Record<string, unknown> = {};\n const rest: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(params ?? {})) (keys.includes(k) ? picked : rest)[k] = v;\n return [picked, rest];\n}\n\n/** Fill `actor_id` from a scope bound with `.as(actorId)`, unless the call passes one. */\nfunction fillActor<P>(params: P, bound: Bound): P {\n if (bound.actor_id === undefined) return params;\n const p = (params ?? {}) as Record<string, unknown>;\n return (p.actor_id === undefined ? { ...p, actor_id: bound.actor_id } : p) as P;\n}\n\nexport class APIResource {\n protected readonly _client: APIClient;\n /** Path parameters (and `actor_id`) bound by the enclosing scope. */\n protected readonly _b: Bound;\n constructor(client: APIClient, bound: Bound = {}) {\n this._client = client;\n this._b = bound;\n }\n}\n\nvoid split;\nvoid fillActor;\n/** `brand` */\nexport class BrandResource extends APIResource {\n /**\n * Remove all brand customizations and revert to platform defaults.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/brand\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-brand\n * @example\n * ```ts\n * await mail.brand.reset();\n * ```\n */\n reset(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/brand\" }, options);\n }\n /**\n * Get the resolved brand tokens for the workspace. Always returns a complete object, with platform defaults filling in any unset fields.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/brand\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-brand\n * @example\n * ```ts\n * const brand = await mail.brand.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.Brand>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/brand\" }, options);\n }\n /**\n * Replace the workspace brand. Any field omitted from the body is reset to the platform default for that field. To partially-update, send back what GET returned with the desired diff applied.\n *\n * @param params - `Mail.BrandUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure on the brand payload.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/workspaces/{workspace_id}/brand\n * @see https://productcraft.co/docs/mail/api-reference#put-v1-workspaces-workspace-id-brand\n * @example\n * ```ts\n * const brand = await mail.brand.update({ background_color: \"string\" });\n * ```\n */\n update(params?: T.BrandUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Brand>> {\n return this._client.request({ method: \"PUT\", path: \"/v1/workspaces/{workspace_id}/brand\", body: params, idempotent: true }, options);\n }\n}\n\n/** `broadcasts.clickedLinks` */\nexport class BroadcastsClickedLinksResource extends APIResource {\n /**\n * Links clicked in a broadcast\n *\n * Most clicked first. Empty until click tracking is enabled.\n *\n * @param broadcastId - Id of the broadcast.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/clicked-links\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-broadcasts-broadcast-id-clicked-links\n * @example\n * ```ts\n * const clickedLinks = await mail.broadcasts.clickedLinks.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n list(broadcastId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ClickedLinks>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/clicked-links\", pathParams: { broadcast_id: broadcastId } }, options);\n }\n}\n\n/** `broadcasts.recipients` */\nexport class BroadcastsRecipientsResource extends APIResource {\n /**\n * List a broadcast's recipients\n *\n * In send order, with each message status.\n *\n * @param broadcastId - Id of the broadcast.\n * @param params - `Mail.BroadcastRecipientListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/recipients\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-broadcasts-broadcast-id-recipients\n * @example\n * ```ts\n * for await (const recipient of mail.broadcasts.recipients.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\")) {\n * console.log(recipient);\n * }\n * const page = await mail.broadcasts.recipients.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", {}, { timeout: 5_000 });\n * ```\n */\n list(broadcastId: string, params?: T.BroadcastRecipientListParams, options?: RequestOptions): PagePromise<T.BroadcastRecipient> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/recipients\", pathParams: { broadcast_id: broadcastId }, query: params }, options);\n }\n}\n\n/** `broadcasts.settings` */\nexport class BroadcastsSettingsResource extends APIResource {\n /**\n * Get the broadcast settings\n *\n * The messages-per-minute pace broadcasts go out at.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/broadcast-settings\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-broadcast-settings\n * @example\n * ```ts\n * const broadcastSettings = await mail.broadcasts.settings.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.BroadcastSettings>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/broadcast-settings\" }, options);\n }\n /**\n * Update the broadcast settings\n *\n * Set the workspace campaign pace (1 to 300 messages per minute; null for the default, 120). It never affects transactional sends, which have their own limit.\n *\n * @param params - `Mail.BroadcastSettingsUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/workspaces/{workspace_id}/broadcast-settings\n * @see https://productcraft.co/docs/mail/api-reference#put-v1-workspaces-workspace-id-broadcast-settings\n * @example\n * ```ts\n * const broadcastSettings = await mail.broadcasts.settings.update({ rate_per_minute: 1 });\n * ```\n */\n update(params: T.BroadcastSettingsUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.BroadcastSettings>> {\n return this._client.request({ method: \"PUT\", path: \"/v1/workspaces/{workspace_id}/broadcast-settings\", body: params, idempotent: true }, options);\n }\n}\n\n/** `broadcasts` */\nexport class BroadcastsResource extends APIResource {\n #clickedLinks?: BroadcastsClickedLinksResource;\n #recipients?: BroadcastsRecipientsResource;\n #settings?: BroadcastsSettingsResource;\n get clickedLinks(): BroadcastsClickedLinksResource {\n return (this.#clickedLinks ??= new BroadcastsClickedLinksResource(this._client, this._b));\n }\n get recipients(): BroadcastsRecipientsResource {\n return (this.#recipients ??= new BroadcastsRecipientsResource(this._client, this._b));\n }\n get settings(): BroadcastsSettingsResource {\n return (this.#settings ??= new BroadcastsSettingsResource(this._client, this._b));\n }\n /**\n * Count a broadcast audience\n *\n * How many contacts a broadcast to this segment and/or topic would reach if it were sent now: members of the segment, subscribed to the topic, minus anyone unsubscribed or on the suppression list.\n *\n * @param params - `Mail.BroadcastAudienceParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, AUDIENCE_REQUIRED, SEGMENT_NOT_FOUND, TOPIC_NOT_FOUND: Neither given (`AUDIENCE_REQUIRED`), or one does not exist in this workspace (`SEGMENT_NOT_FOUND` / `TOPIC_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/broadcasts/audience\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-broadcasts-audience\n * @example\n * ```ts\n * const broadcastAudience = await mail.broadcasts.audience();\n * ```\n */\n audience(params?: T.BroadcastAudienceParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.BroadcastAudience>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/broadcasts/audience\", query: params }, options);\n }\n /**\n * Cancel a scheduled or sending broadcast\n *\n * Recipients not sent yet are marked `canceled`; messages already handed off are not recalled.\n *\n * @param broadcastId - Id of the broadcast.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, BROADCAST_NOT_CANCELABLE, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Draft, sent or already canceled (`BROADCAST_NOT_CANCELABLE`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/cancel\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-broadcasts-broadcast-id-cancel\n * @example\n * ```ts\n * const broadcast = await mail.broadcasts.cancel(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n cancel(broadcastId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Broadcast>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/cancel\", pathParams: { broadcast_id: broadcastId }, idempotent: true }, options);\n }\n /**\n * Create a broadcast (draft)\n *\n * Content is a saved template (`template_name`) or inline Handlebars (`html`, `subject`, optional `text`). The audience is a segment, a topic, or both. Nothing is sent until `POST .../send`.\n *\n * @param params - `Mail.BroadcastCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, SEGMENT_NOT_FOUND, TOPIC_NOT_FOUND, BROADCAST_CONTENT_CONFLICT: `segment_id` or `topic_id` does not name one of this workspace's (`SEGMENT_NOT_FOUND` / `TOPIC_NOT_FOUND`), or both `template_name` and `html` were given (`BROADCAST_CONTENT_CONFLICT`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/broadcasts\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-broadcasts\n * @example\n * ```ts\n * const broadcast = await mail.broadcasts.create({ name: \"October product update\" });\n * ```\n */\n create(params: T.BroadcastCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Broadcast>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/broadcasts\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a broadcast\n *\n * Drafts, sent and canceled broadcasts, with their recipient list. The messages themselves stay in the message log.\n *\n * @param broadcastId - Id of the broadcast.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, BROADCAST_NOT_DELETABLE: Scheduled or sending: cancel it first (`BROADCAST_NOT_DELETABLE`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-broadcasts-broadcast-id\n * @example\n * ```ts\n * await mail.broadcasts.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(broadcastId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}\", pathParams: { broadcast_id: broadcastId } }, options);\n }\n /**\n * Duplicate a broadcast\n *\n * A new draft with the same content and audience.\n *\n * @param broadcastId - Id of the broadcast.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/duplicate\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-broadcasts-broadcast-id-duplicate\n * @example\n * ```ts\n * const broadcast = await mail.broadcasts.duplicate(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n duplicate(broadcastId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Broadcast>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/duplicate\", pathParams: { broadcast_id: broadcastId }, idempotent: true }, options);\n }\n /**\n * List broadcasts, newest first\n *\n * @param params - `Mail.BroadcastListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/broadcasts\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-broadcasts\n * @example\n * ```ts\n * for await (const broadcast of mail.broadcasts.list()) {\n * console.log(broadcast);\n * }\n * const page = await mail.broadcasts.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.BroadcastListParams, options?: RequestOptions): PagePromise<T.Broadcast> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/broadcasts\", query: params }, options);\n }\n /**\n * Get a broadcast\n *\n * Includes `counts` once sending has started: recipients, sent, delivered, bounced, complained, opened, clicked, unsubscribed.\n *\n * @param broadcastId - Id of the broadcast.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-broadcasts-broadcast-id\n * @example\n * ```ts\n * const broadcast = await mail.broadcasts.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(broadcastId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Broadcast>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}\", pathParams: { broadcast_id: broadcastId } }, options);\n }\n /**\n * Send or schedule a broadcast\n *\n * Now, or at `scheduled_at`. When sending starts the audience is frozen (segment ∩ topic subscribers − unsubscribed − suppression list) and the messages go out at the broadcast rate (default 120 per minute; separate from the transactional limit), on the marketing stream, each with a one-click unsubscribe link and `List-Unsubscribe` headers. The send survives restarts: it continues from the recipients not yet sent.\n *\n * @param broadcastId - Id of the broadcast.\n * @param params - `Mail.BroadcastSendParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, BROADCAST_NOT_DRAFT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Not a draft (`BROADCAST_NOT_DRAFT`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, UNSUBSCRIBE_LINK_REQUIRED, BROADCAST_NOT_READY, BROADCAST_AUDIENCE_EMPTY, INVALID_FROM_ADDRESS, from_domain_not_verified: Not ready: `UNSUBSCRIBE_LINK_REQUIRED` (the body does not contain `{{{unsubscribe_url}}}`) or `BROADCAST_NOT_READY` (`details.problems`: no audience, no content, no subject, missing template, no From); `BROADCAST_AUDIENCE_EMPTY` (nobody to send to); `INVALID_FROM_ADDRESS`; or `from_domain_not_verified` (`details: { fqdn, reason }`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/send\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-broadcasts-broadcast-id-send\n * @example\n * ```ts\n * const broadcast = await mail.broadcasts.send(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { scheduled_at: \"2026-11-02T09:00:00Z\" });\n * ```\n */\n send(broadcastId: string, params?: T.BroadcastSendParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Broadcast>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/send\", pathParams: { broadcast_id: broadcastId }, body: params, idempotent: true }, options);\n }\n /**\n * Update a draft broadcast\n *\n * Only drafts can change; null clears an optional field.\n *\n * @param broadcastId - Id of the broadcast.\n * @param params - `Mail.BroadcastUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, BROADCAST_NOT_FOUND: No such broadcast (`BROADCAST_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, BROADCAST_NOT_DRAFT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Not a draft any more (`BROADCAST_NOT_DRAFT`, `details.status`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, SEGMENT_NOT_FOUND, TOPIC_NOT_FOUND, BROADCAST_CONTENT_CONFLICT: `segment_id` or `topic_id` does not name one of this workspace's (`SEGMENT_NOT_FOUND` / `TOPIC_NOT_FOUND`), or both `template_name` and `html` were given (`BROADCAST_CONTENT_CONFLICT`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-broadcasts-broadcast-id\n * @example\n * ```ts\n * const broadcast = await mail.broadcasts.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { from: \"string\" });\n * ```\n */\n update(broadcastId: string, params?: T.BroadcastUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Broadcast>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}\", pathParams: { broadcast_id: broadcastId }, body: params, idempotent: true }, options);\n }\n}\n\n/** `contacts.imports` */\nexport class ContactsImportsResource extends APIResource {\n /**\n * Import contacts from a CSV file\n *\n * Queues the file and returns the import (`status: queued`); poll `GET .../contacts/imports/{id}` for progress. At most 10 MB and 100,000 rows, two imports running per workspace. Rows that assert consent (`consent` true or a `consented_at` date) are recorded with it and opted in to `topic_ids`; every other row starts without consent. An import emits no per-contact webhook events.\n *\n * @param params - `Mail.ContactImportCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, TOPIC_NOT_FOUND: A `topic_ids` entry is not a topic of this workspace (`TOPIC_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IMPORT_IN_PROGRESS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Two imports are already running (`IMPORT_IN_PROGRESS`), or `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different body or route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {APIError} 413 PAYLOAD_TOO_LARGE, IMPORT_TOO_LARGE: The CSV is larger than 10 MB (`IMPORT_TOO_LARGE`).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_CSV: Empty file, or no header line with an `email` column (`INVALID_CSV`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/contacts/imports\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-contacts-imports\n * @example\n * ```ts\n * const contactImport = await mail.contacts.imports.create({\n * csv: \"email,first_name,consent,consented_at\\nada@example.com,Ada,true,2026-10-01T09:00:00Z\\n\",\n * on_conflict: \"upsert\",\n * });\n * ```\n */\n create(params: T.ContactImportCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactImport>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/contacts/imports\", body: params, idempotent: true }, options);\n }\n /**\n * List contact imports, newest first\n *\n * @param params - `Mail.ContactImportListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contacts/imports\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contacts-imports\n * @example\n * ```ts\n * for await (const importItem of mail.contacts.imports.list()) {\n * console.log(importItem);\n * }\n * const page = await mail.contacts.imports.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.ContactImportListParams, options?: RequestOptions): PagePromise<T.ContactImport> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contacts/imports\", query: params }, options);\n }\n /**\n * Get a contact import and its progress\n *\n * @param importId - Id of the import.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, IMPORT_NOT_FOUND: No such import in this workspace (`IMPORT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contacts/imports/{import_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contacts-imports-import-id\n * @example\n * ```ts\n * const contactImport = await mail.contacts.imports.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(importId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactImport>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contacts/imports/{import_id}\", pathParams: { import_id: importId } }, options);\n }\n}\n\n/** `contacts.properties` */\nexport class ContactsPropertiesResource extends APIResource {\n /**\n * Define a contact property\n *\n * At most 50 per workspace.\n *\n * @param params - `Mail.ContactPropertyCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, CONTACT_PROPERTY_EXISTS, CONTACT_PROPERTY_LIMIT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: The key exists (`CONTACT_PROPERTY_EXISTS`), the workspace has 50 properties (`CONTACT_PROPERTY_LIMIT`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, RESERVED_PROPERTY_KEY, INVALID_CONTACT_PROPERTY_VALUE: The key is a contact field (`RESERVED_PROPERTY_KEY`) or the fallback does not match the type (`INVALID_CONTACT_PROPERTY_VALUE`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/contact-properties\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-contact-properties\n * @example\n * ```ts\n * const contactProperty = await mail.contacts.properties.create({ key: \"company\", type: \"string\" });\n * ```\n */\n create(params: T.ContactPropertyCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactProperty>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/contact-properties\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a contact property\n *\n * Values already stored on contacts stay, but are no longer validated; define the key again to use it.\n *\n * @param propertyId - Id of the property.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_PROPERTY_NOT_FOUND: No such property (`CONTACT_PROPERTY_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/contact-properties/{property_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-contact-properties-property-id\n * @example\n * ```ts\n * await mail.contacts.properties.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(propertyId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/contact-properties/{property_id}\", pathParams: { property_id: propertyId } }, options);\n }\n /**\n * List contact properties, newest first\n *\n * @param params - `Mail.ContactPropertyListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contact-properties\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contact-properties\n * @example\n * ```ts\n * for await (const property of mail.contacts.properties.list()) {\n * console.log(property);\n * }\n * const page = await mail.contacts.properties.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.ContactPropertyListParams, options?: RequestOptions): PagePromise<T.ContactProperty> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contact-properties\", query: params }, options);\n }\n /**\n * Get a contact property\n *\n * @param propertyId - Id of the property.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_PROPERTY_NOT_FOUND: No such property (`CONTACT_PROPERTY_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contact-properties/{property_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contact-properties-property-id\n * @example\n * ```ts\n * const contactProperty = await mail.contacts.properties.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(propertyId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactProperty>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contact-properties/{property_id}\", pathParams: { property_id: propertyId } }, options);\n }\n /**\n * Change a contact property's fallback value\n *\n * The key and type are fixed once created.\n *\n * @param propertyId - Id of the property.\n * @param params - `Mail.ContactPropertyUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_PROPERTY_NOT_FOUND: No such property (`CONTACT_PROPERTY_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_CONTACT_PROPERTY_VALUE: The fallback does not match the type (`INVALID_CONTACT_PROPERTY_VALUE`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/contact-properties/{property_id}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-contact-properties-property-id\n * @example\n * ```ts\n * const contactProperty = await mail.contacts.properties.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { fallback_value: \"string\" });\n * ```\n */\n update(propertyId: string, params?: T.ContactPropertyUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactProperty>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/contact-properties/{property_id}\", pathParams: { property_id: propertyId }, body: params, idempotent: true }, options);\n }\n}\n\n/** `contacts.segments` */\nexport class ContactsSegmentsResource extends APIResource {\n /**\n * Add a contact to a static segment\n *\n * Adds the contact. Adding a contact that is already a member changes nothing and answers the same way, with `added_at` from the first time.\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param segmentId - Id of the segment.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND, SEGMENT_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`) or segment (`SEGMENT_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, SEGMENT_RULE_BASED: The segment is rule-based: its members follow the rule (`SEGMENT_RULE_BASED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/contacts/{contact}/segments/{segment_id}\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-contacts-contact-segments-segment-id\n * @example\n * ```ts\n * const segmentMembership = await mail.contacts.segments.add(\"ada@example.com\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n add(contact: string, segmentId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SegmentMembership>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}/segments/{segment_id}\", pathParams: { contact, segment_id: segmentId }, idempotent: true }, options);\n }\n /**\n * Remove a contact from a static segment\n *\n * 204 whether or not it was a member.\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param segmentId - Id of the segment.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND, SEGMENT_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`) or segment (`SEGMENT_NOT_FOUND`).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, SEGMENT_RULE_BASED: The segment is rule-based (`SEGMENT_RULE_BASED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/contacts/{contact}/segments/{segment_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-contacts-contact-segments-segment-id\n * @example\n * ```ts\n * await mail.contacts.segments.delete(\"ada@example.com\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n delete(contact: string, segmentId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}/segments/{segment_id}\", pathParams: { contact, segment_id: segmentId } }, options);\n }\n /**\n * List a contact's segments\n *\n * Static segments it was added to and rule segments it matches now.\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contacts/{contact}/segments\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contacts-contact-segments\n * @example\n * ```ts\n * const contactSegments = await mail.contacts.segments.list(\"ada@example.com\");\n * ```\n */\n list(contact: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactSegments>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}/segments\", pathParams: { contact } }, options);\n }\n}\n\n/** `contacts.topics` */\nexport class ContactsTopicsResource extends APIResource {\n /**\n * List a contact's topic subscriptions\n *\n * Every topic of the workspace, with the contact's own choice and whether a topic send would reach it now (and why).\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contacts/{contact}/topics\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contacts-contact-topics\n * @example\n * ```ts\n * const contactTopics = await mail.contacts.topics.list(\"ada@example.com\");\n * ```\n */\n list(contact: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactTopics>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}/topics\", pathParams: { contact } }, options);\n }\n /**\n * Opt a contact in to or out of topics\n *\n * Records the contact's choice per topic (an explicit `opt_in` is consent for that topic). A global unsubscribe still wins: clear it with `PATCH .../contacts/{contact}` `unsubscribed: false`. Emits `contact.updated`.\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param params - `Mail.ContactTopicUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND, TOPIC_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`) or topic (`TOPIC_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/contacts/{contact}/topics\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-contacts-contact-topics\n * @example\n * ```ts\n * const contactTopics = await mail.contacts.topics.update(\"ada@example.com\", { topics: [{ id: \"9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b\", subscription: \"opt_in\" }] });\n * ```\n */\n update(contact: string, params: T.ContactTopicUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ContactTopics>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}/topics\", pathParams: { contact }, body: params, idempotent: true }, options);\n }\n}\n\n/** `contacts` */\nexport class ContactsResource extends APIResource {\n #imports?: ContactsImportsResource;\n #properties?: ContactsPropertiesResource;\n #segments?: ContactsSegmentsResource;\n #topics?: ContactsTopicsResource;\n get imports(): ContactsImportsResource {\n return (this.#imports ??= new ContactsImportsResource(this._client, this._b));\n }\n get properties(): ContactsPropertiesResource {\n return (this.#properties ??= new ContactsPropertiesResource(this._client, this._b));\n }\n get segments(): ContactsSegmentsResource {\n return (this.#segments ??= new ContactsSegmentsResource(this._client, this._b));\n }\n get topics(): ContactsTopicsResource {\n return (this.#topics ??= new ContactsTopicsResource(this._client, this._b));\n }\n /**\n * Create a contact\n *\n * Emits `contact.created`. Without `consent`, the contact receives only topics it is explicitly opted in to.\n *\n * @param params - `Mail.ContactCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, TOPIC_NOT_FOUND: A `topics[].id` is not a topic of this workspace (`TOPIC_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, CONTACT_EXISTS, CONTACT_LIMIT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: A contact with this email exists (`CONTACT_EXISTS`), the workspace has 100,000 contacts (`CONTACT_LIMIT`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, UNKNOWN_CONTACT_PROPERTY, INVALID_CONTACT_PROPERTY_VALUE: A `properties` key is not a defined property (`UNKNOWN_CONTACT_PROPERTY`) or its value has the wrong type (`INVALID_CONTACT_PROPERTY_VALUE`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/contacts\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-contacts\n * @example\n * ```ts\n * const contact = await mail.contacts.create({ email: \"ada@example.com\" });\n * ```\n */\n create(params: T.ContactCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Contact>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/contacts\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a contact\n *\n * Removes the contact, its properties and its topic choices. Emits `contact.deleted`. To stop mailing someone, unsubscribe them instead: a deleted contact that later receives a topic send is refused (`no_consent`), but its opt-out is forgotten.\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/contacts/{contact}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-contacts-contact\n * @example\n * ```ts\n * await mail.contacts.delete(\"ada@example.com\");\n * ```\n */\n delete(contact: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}\", pathParams: { contact } }, options);\n }\n /**\n * List contacts, newest first\n *\n * @param params - `Mail.ContactListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contacts\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contacts\n * @example\n * ```ts\n * for await (const contact of mail.contacts.list()) {\n * console.log(contact);\n * }\n * const page = await mail.contacts.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.ContactListParams, options?: RequestOptions): PagePromise<T.Contact> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contacts\", query: params }, options);\n }\n /**\n * Get a contact by id or email\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/contacts/{contact}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-contacts-contact\n * @example\n * ```ts\n * const contact = await mail.contacts.retrieve(\"ada@example.com\");\n * ```\n */\n retrieve(contact: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Contact>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}\", pathParams: { contact } }, options);\n }\n /**\n * Update a contact\n *\n * The email cannot change (delete and re-create). Emits `contact.updated` when something changed.\n *\n * @param contact - The contact id, or its email address (URL-encoded).\n * @param params - `Mail.ContactUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, CONTACT_NOT_FOUND: No such contact (`CONTACT_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, UNKNOWN_CONTACT_PROPERTY, INVALID_CONTACT_PROPERTY_VALUE: `UNKNOWN_CONTACT_PROPERTY` or `INVALID_CONTACT_PROPERTY_VALUE`.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/contacts/{contact}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-contacts-contact\n * @example\n * ```ts\n * const contact = await mail.contacts.update(\"ada@example.com\", { consent: { consented_at: \"2026-10-24T09:00:00Z\", source: \"signup-form-2026\" } });\n * ```\n */\n update(contact: string, params?: T.ContactUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Contact>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/contacts/{contact}\", pathParams: { contact }, body: params, idempotent: true }, options);\n }\n}\n\n/** `deliverability` */\nexport class DeliverabilityResource extends APIResource {\n /**\n * Deliverability verdict for the workspace over a lookback window. `unconfirmed` means mail was handed off and nothing came back either way — it is not a synonym for healthy.\n *\n * @param params - `Mail.DeliverabilityRetrieveParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: window_days out of range.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Not authenticated.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Missing mail.message.read, or the mail service is not enabled.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/deliverability\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-deliverability\n * @example\n * ```ts\n * const deliverability = await mail.deliverability.retrieve();\n * ```\n */\n retrieve(params?: T.DeliverabilityRetrieveParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Deliverability>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/deliverability\", query: params }, options);\n }\n}\n\n/** `domains.dnsRecords` */\nexport class DomainsDnsRecordsResource extends APIResource {\n /**\n * Set up the domain's DNS records in one step with a short-lived Cloudflare or DigitalOcean API token.\n *\n * Reads the zone through the provider's API and plans every record the domain needs: `create`, `update` (only ever an SPF merge into an existing SPF record, shown with `before`/`after`) or `skip` (already there). `dry_run: true` returns the plan and changes nothing; `dry_run: false` applies exactly that plan, runs a DNS check straight away and records `setup_method = provider_api`. Only names at or under the domain are written, nothing is ever deleted, and Cloudflare records are DNS-only (not proxied). The recommended DMARC record (`p=none`) is included when `include_dmarc` is true (the default) and no DMARC policy applies to the domain yet; an existing policy is never touched. Any blocking conflict refuses the whole apply with 409. The token is used for this request only: it is never stored, logged, queued or returned; revoke it afterwards (`warnings` says so when it could see more than this zone). Applies are limited to one per domain every 10 seconds; dry runs are not limited.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainDnsRecordApplyParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED, INVALID_ZONE, PROVIDER_TOKEN_REJECTED, PROVIDER_PERMISSION_DENIED, PROVIDER_ZONE_NOT_FOUND: Validation failure; `Idempotency-Key` missing (`IDEMPOTENCY_KEY_REQUIRED`); `zone` not the domain or a parent (`INVALID_ZONE`); the provider rejected the token (`PROVIDER_TOKEN_REJECTED`), the token lacks DNS permissions (`PROVIDER_PERMISSION_DENIED`), or it cannot see a zone for the domain (`PROVIDER_ZONE_NOT_FOUND`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Missing `mail.update`, or the mail service is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, DNS_CONFLICTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `DNS_CONFLICTS`: a blocking conflict (a second SPF record, a CNAME at the name, another DKIM key at our selector, other MX records at the MAIL FROM host or the domain, a merge over 10 SPF lookups). Nothing was written; the body carries the full `plan` and `conflicts`. Or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: Applied less than 10 seconds ago (`RATE_LIMITED`). Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @throws {InternalServerError} 502 BAD_GATEWAY, PROVIDER_UNAVAILABLE, PROVIDER_ERROR: The provider failed or did not answer (`PROVIDER_UNAVAILABLE`, `PROVIDER_ERROR`). Nothing was written unless the plan items say so.\n * @see POST /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/apply\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains-domain-id-dns-records-apply\n * @example\n * ```ts\n * const dnsApplyResult = await mail.domains.dnsRecords.apply(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { dry_run: true, provider: \"cloudflare\", token: \"dop_v1_EXAMPLE_TOKEN_DO_NOT_USE\" });\n * ```\n */\n apply(domainId: string, params: T.DomainDnsRecordApplyParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.DnsApplyResult>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/apply\", pathParams: { domain_id: domainId }, body: params, idempotent: true }, options);\n }\n /**\n * Check the domain's DNS records now.\n *\n * Queries the zone's authoritative nameservers and a public resolver for every record, stores the result, flips a pending domain whose required records pass to `active`, and returns the same body as `GET .../dns-records`. Never fails because records are missing: their states say so. Limited to one call per domain every 10 seconds. Safe to retry: it changes nothing but the stored check result, so it takes no Idempotency-Key.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainDnsRecordCheckParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, INVALID_ZONE: `zone` is not the domain or one of its parents (`INVALID_ZONE`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Checked less than 10 seconds ago (`RATE_LIMITED`). Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/check\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains-domain-id-dns-records-check\n * @example\n * ```ts\n * const domainDnsRecords = await mail.domains.dnsRecords.check(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n check(domainId: string, params?: T.DomainDnsRecordCheckParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.DomainDnsRecords>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/check\", pathParams: { domain_id: domainId }, query: params }, options);\n }\n /**\n * Download the domain's DNS records as a BIND zone fragment or a CSV.\n *\n * `format=bind`: a zone-file fragment (`$ORIGIN <zone>.`, `$TTL 3600`, names relative to the zone, MX with priority, TXT split into ≤255-byte quoted strings, a comment per record with its purpose, required/recommended and any conflict) that Cloudflare and Route 53 import directly. `format=csv`: `type,name,value,priority,ttl,purpose,required` (the common DNS-import columns plus two), RFC 4180 quoting, fully qualified names. By default only records not yet verified; `all=true` for every record. Served as an attachment.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainDnsRecordExportParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `format` missing or not `bind`/`csv`, or `zone` is not the domain or one of its parents.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/export\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains-domain-id-dns-records-export\n * @example\n * ```ts\n * const response = await mail.domains.dnsRecords.export(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { format: \"bind\" });\n * const text = await response.text();\n * ```\n */\n export(domainId: string, params: T.DomainDnsRecordExportParams, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/export\", pathParams: { domain_id: domainId }, query: params, raw: true }, options);\n }\n /**\n * Per-record DNS status for a domain.\n *\n * Every record the domain needs for its intent, with its state (`missing`, `mismatch`, `conflict`, `propagating`, `verified`), what was found, a propagation hint and timestamps, as of the last check (the verifier re-checks pending domains every 5 minutes and active ones hourly). Does not run a DNS lookup; use `POST .../dns-records/check` for that.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainDnsRecordListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, INVALID_ZONE: `zone` is not the domain or one of its parents (`INVALID_ZONE`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains-domain-id-dns-records\n * @example\n * ```ts\n * const domainDnsRecords = await mail.domains.dnsRecords.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n list(domainId: string, params?: T.DomainDnsRecordListParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.DomainDnsRecords>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records\", pathParams: { domain_id: domainId }, query: params }, options);\n }\n}\n\n/** `domains.domainConnect` */\nexport class DomainsDomainConnectResource extends APIResource {\n /**\n * Start one-click DNS setup at the domain's DNS provider (Domain Connect).\n *\n * Returns a signed Domain Connect URL for the provider that hosts the domain's zone (Cloudflare, GoDaddy, IONOS, Vercel and the others that have onboarded ProductCraft's template). Open it in the browser: the user signs in at their provider and confirms, the provider writes the DKIM key at `productcraft._domainkey.<domain>` and the MAIL FROM records at `bounce.<domain>` (MX to the regional feedback host, SPF merged into any existing SPF there), and then redirects to `GET /v1/domain-connect/callback`, which records `setup_method = domain_connect`, checks the records and returns the user to the domain in the console. With `include_dmarc` and no DMARC policy in place yet, a second confirmation adds `v=DMARC1; p=none;` at `_dmarc.<domain>`. The URL is valid for 10 minutes and works once. ProductCraft never receives a DNS credential. For sending domains whose MAIL FROM label is `bounce` (the default). Not available while ProductCraft has Domain Connect switched off (`domain_connect.available` in `GET .../domains/lookup` says whether it is).\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainDomainConnectStartParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure, or an id is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Missing `mail.update`, or the mail service is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, DOMAIN_CONNECT_DISABLED, DOMAIN_CONNECT_UNAVAILABLE, DOMAIN_CONNECT_NOT_SENDING, DOMAIN_CONNECT_MAIL_FROM_LABEL, DKIM_KEY_MISSING, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: One-click setup is not possible for this domain; nothing was started. `DOMAIN_CONNECT_DISABLED`: ProductCraft has not switched Domain Connect on. `DOMAIN_CONNECT_UNAVAILABLE`: the DNS provider does not run Domain Connect or has not onboarded our template (`details.reason`: `no_record`, `settings_unreachable`, `template_not_onboarded` or `lookup_failed`; `details.provider_name`). `DOMAIN_CONNECT_NOT_SENDING`: a receive-only domain. `DOMAIN_CONNECT_MAIL_FROM_LABEL`: the MAIL FROM label is not `bounce` or MAIL FROM is off. `DKIM_KEY_MISSING`: no DKIM key to publish. Or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/domains/{domain_id}/domain-connect/start\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains-domain-id-domain-connect-start\n * @example\n * ```ts\n * const domainConnectStart = await mail.domains.domainConnect.start(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { include_dmarc: true });\n * ```\n */\n start(domainId: string, params?: T.DomainDomainConnectStartParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.DomainConnectStart>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/domain-connect/start\", pathParams: { domain_id: domainId }, body: params, idempotent: true }, options);\n }\n}\n\n/** `domains.events` */\nexport class DomainsEventsResource extends APIResource {\n /**\n * List a domain's events (its timeline), newest first, cursor-paginated.\n *\n * Added, records found, verified, degraded, failing, recovered, MAIL FROM verified, DMARC detected, check failed. An event is written only when something changed, so a domain checked every few minutes does not grow a row per check.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainEventListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid cursor, or `domain_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains/{domain_id}/events\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains-domain-id-events\n * @example\n * ```ts\n * for await (const event of mail.domains.events.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\")) {\n * console.log(event);\n * }\n * const page = await mail.domains.events.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", {}, { timeout: 5_000 });\n * ```\n */\n list(domainId: string, params?: T.DomainEventListParams, options?: RequestOptions): PagePromise<T.DomainEvent> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/events\", pathParams: { domain_id: domainId }, query: params }, options);\n }\n}\n\n/** `domains.shareLinks` */\nexport class DomainsShareLinksResource extends APIResource {\n /**\n * Create a share link: a read-only DNS setup page for whoever manages the domain's DNS.\n *\n * Returns a link (valid 1–7 days, default 7) to a public page that shows the domain name, its DNS records with copy-ready values, their live status and zone-file / CSV downloads, without an account. The page shows nothing else about the workspace. The link is shown only in this response (only its hash is stored); revoke it with `DELETE .../share-links/{link_id}`. Optionally emails it from ProductCraft to up to 5 recipients per domain per day (20 per workspace). Requires `mail.update` on the domain.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainShareLinkCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure: `expires_in_days` outside 1–7, more than 5 `email_to` entries, or an invalid address.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the key was used with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: The daily email cap for the domain (5 recipients) or the workspace (20) would be exceeded (`RATE_LIMITED`). No link is created. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, EMAIL_UNAVAILABLE: `EMAIL_UNAVAILABLE`: `email_to` was given but the email cap cannot be checked right now. No link is created; retry, or create it without `email_to`.\n * @see POST /v1/workspaces/{workspace_id}/domains/{domain_id}/share-links\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains-domain-id-share-links\n * @example\n * ```ts\n * const createdShareLink = await mail.domains.shareLinks.create(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { email_to: [\"it@example.com\"] });\n * ```\n */\n create(domainId: string, params?: T.DomainShareLinkCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.CreatedShareLink>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/share-links\", pathParams: { domain_id: domainId }, body: params, idempotent: true }, options);\n }\n /**\n * Revoke a share link.\n *\n * The public page and its downloads answer 404 from now on. Revoking an already revoked or expired link succeeds and changes nothing.\n *\n * @param domainId - Id of the domain.\n * @param linkId - Id of the link.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: An id is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain or share link not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/domains/{domain_id}/share-links/{link_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-domains-domain-id-share-links-link-id\n * @example\n * ```ts\n * await mail.domains.shareLinks.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n delete(domainId: string, linkId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/share-links/{link_id}\", pathParams: { domain_id: domainId, link_id: linkId } }, options);\n }\n /**\n * List the domain's share links (newest first, including expired and revoked), cursor-paginated.\n *\n * The links themselves are not returned: they are shown once, at creation.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainShareLinkListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid cursor, or an id is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains/{domain_id}/share-links\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains-domain-id-share-links\n * @example\n * ```ts\n * for await (const shareLink of mail.domains.shareLinks.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\")) {\n * console.log(shareLink);\n * }\n * const page = await mail.domains.shareLinks.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", {}, { timeout: 5_000 });\n * ```\n */\n list(domainId: string, params?: T.DomainShareLinkListParams, options?: RequestOptions): PagePromise<T.ShareLink> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/share-links\", pathParams: { domain_id: domainId }, query: params }, options);\n }\n}\n\n/** `domains.smtpConfig` */\nexport class DomainsSmtpConfigResource extends APIResource {\n /**\n * Drop the per-domain override; sends from this domain fall back to the workspace default (or ProductCraft Mail's own sending).\n *\n * @param domainId - Id of the domain.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: No per-domain override to delete\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-domains-domain-id-smtp-config\n * @example\n * ```ts\n * await mail.domains.smtpConfig.reset(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n reset(domainId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config\", pathParams: { domain_id: domainId } }, options);\n }\n /**\n * Get the per-domain SMTP override (returns null if unset; the workspace default applies in that case).\n *\n * @param domainId - Id of the domain.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains-domain-id-smtp-config\n * @example\n * ```ts\n * const getSmtpConfig = await mail.domains.smtpConfig.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(domainId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.GetSmtpConfig>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config\", pathParams: { domain_id: domainId } }, options);\n }\n /**\n * Create or update the per-domain SMTP override (resets verification)\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainSmtpConfigUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure or username/password mismatch.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config\n * @see https://productcraft.co/docs/mail/api-reference#put-v1-workspaces-workspace-id-domains-domain-id-smtp-config\n * @example\n * ```ts\n * const smtpConfig = await mail.domains.smtpConfig.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", {\n * from_email: \"noreply@acme.com\",\n * from_name: \"Acme Notifications\",\n * host: \"smtp.sendgrid.net\",\n * port: 587,\n * secure: false,\n * });\n * ```\n */\n update(domainId: string, params: T.DomainSmtpConfigUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SmtpConfig>> {\n return this._client.request({ method: \"PUT\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config\", pathParams: { domain_id: domainId }, body: params, idempotent: true }, options);\n }\n /**\n * Test the per-domain SMTP override; updates status\n *\n * @param domainId - Id of the domain.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: No per-domain override saved\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config/verify-saved\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains-domain-id-smtp-config-verify-saved\n * @example\n * ```ts\n * const smtpVerifyResult = await mail.domains.smtpConfig.verifySaved(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n verifySaved(domainId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SmtpVerifyResult>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config/verify-saved\", pathParams: { domain_id: domainId } }, options);\n }\n}\n\n/** `domains` */\nexport class DomainsResource extends APIResource {\n #dnsRecords?: DomainsDnsRecordsResource;\n #domainConnect?: DomainsDomainConnectResource;\n #events?: DomainsEventsResource;\n #shareLinks?: DomainsShareLinksResource;\n #smtpConfig?: DomainsSmtpConfigResource;\n get dnsRecords(): DomainsDnsRecordsResource {\n return (this.#dnsRecords ??= new DomainsDnsRecordsResource(this._client, this._b));\n }\n get domainConnect(): DomainsDomainConnectResource {\n return (this.#domainConnect ??= new DomainsDomainConnectResource(this._client, this._b));\n }\n get events(): DomainsEventsResource {\n return (this.#events ??= new DomainsEventsResource(this._client, this._b));\n }\n get shareLinks(): DomainsShareLinksResource {\n return (this.#shareLinks ??= new DomainsShareLinksResource(this._client, this._b));\n }\n get smtpConfig(): DomainsSmtpConfigResource {\n return (this.#smtpConfig ??= new DomainsSmtpConfigResource(this._client, this._b));\n }\n /**\n * Register a domain for a workspace\n *\n * Accepts Resend's create-domain body as well as ours: `name` for `fqdn`, `capabilities` for `intent`, `custom_return_path` for the MAIL FROM label, and `region`, `tls`, `open_tracking`, `click_tracking`, `tracking_subdomain`. Defaults to sending only (`intent: send`), as Resend does. Options we do not offer yet are refused with 422 rather than ignored.\n *\n * @param params - `Mail.DomainCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, INVALID_CAPABILITIES, MAIL_FROM_NOT_SENDING: Validation failure on the request body: no `fqdn`/`name`, `fqdn` and `name` disagree, `intent` and `capabilities` disagree or enable nothing (`INVALID_CAPABILITIES`), or `custom_return_path` on a receive-only domain (`MAIL_FROM_NOT_SENDING`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, MAIL_FROM_HOST_IN_USE, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Domain already registered (globally unique); `MAIL_FROM_HOST_IN_USE`: the `custom_return_path` host already has records that are not ours (listed in `details.found`); or `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different body or route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, REGION_NOT_AVAILABLE, TLS_ENFORCED_NOT_AVAILABLE, TRACKING_NOT_AVAILABLE: `REGION_NOT_AVAILABLE`: `region` is not the region this deployment sends from (`details.available`); `TLS_ENFORCED_NOT_AVAILABLE`: `tls: enforced`; `TRACKING_NOT_AVAILABLE`: open/click tracking or a tracking subdomain.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/domains\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains\n * @example\n * ```ts\n * const domain = await mail.domains.create({ capabilities: { receiving: \"enabled\", sending: \"enabled\" } });\n * ```\n */\n create(params?: T.DomainCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Domain>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a domain (must have no active mailboxes left).\n *\n * Permanently deletes the domain, its DNS record set and its Amazon SES sending identity. Mailboxes you already deleted on it are erased with it, together with the mail they still held and its stored files; this cannot be undone. Refused with 409 `DOMAIN_HAS_MAILBOXES` while any mailbox on it is active.\n *\n * @param domainId - Id of the domain.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, DOMAIN_HAS_MAILBOXES: `DOMAIN_HAS_MAILBOXES`: the domain still has active mailboxes. `details.count` is how many; `details.mailboxes` lists them (`id`, `address`, first 100). Delete them, then try again.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @throws {InternalServerError} 503 SERVICE_UNAVAILABLE, SES_IDENTITY_DELETE_FAILED: `SES_IDENTITY_DELETE_FAILED`: the domain's Amazon SES identity could not be removed. Nothing was deleted; retry.\n * @see DELETE /v1/workspaces/{workspace_id}/domains/{domain_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-domains-domain-id\n * @example\n * ```ts\n * await mail.domains.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(domainId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}\", pathParams: { domain_id: domainId } }, options);\n }\n /**\n * List domains registered to this workspace (newest first), cursor-paginated.\n *\n * @param params - `Mail.DomainListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid cursor, search term, or status filter.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains\n * @example\n * ```ts\n * for await (const domain of mail.domains.list()) {\n * console.log(domain);\n * }\n * const page = await mail.domains.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.DomainListParams, options?: RequestOptions): PagePromise<T.Domain> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains\", query: params }, options);\n }\n /**\n * Look up a domain before adding it: zone, DNS provider, Domain Connect support, a better subdomain, existing records.\n *\n * Creates nothing. Resolves only names at or under `fqdn` and its zone apex, plus the Domain Connect endpoints the zone advertises (fetched through the SSRF guard; cached per zone for an hour). Limited to 30 lookups per workspace per minute.\n *\n * @param params - `Mail.DomainLookupParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `fqdn` missing or not a domain name.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 30 lookups this minute (`RATE_LIMITED`). Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains/lookup\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains-lookup\n * @example\n * ```ts\n * const domainLookup = await mail.domains.lookup({ fqdn: \"acme.com\" });\n * ```\n */\n lookup(params: T.DomainLookupParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.DomainLookup>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/lookup\", query: params }, options);\n }\n /**\n * Get a single domain (with DNS instructions and its latest events).\n *\n * The domain with `verification_status`, `region`, the effective `dns_provider`, `recommended_pending`, its DNS instructions, and `events`: the latest 20 domain events, newest first.\n *\n * @param domainId - Id of the domain.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domain_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/domains/{domain_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-domains-domain-id\n * @example\n * ```ts\n * const domainDetail = await mail.domains.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(domainId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.DomainDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}\", pathParams: { domain_id: domainId } }, options);\n }\n /**\n * Retrieve until `status` is `active`, `disabled`.\n *\n * @param options - `intervalMs` (default 2 000), `timeoutMs` (default 300 000, then `APITimeoutError`), `signal`, and request options.\n * @example\n * ```ts\n * const done = await mail.domains.poll(\"…\");\n * ```\n */\n poll(domainId: string, options?: PollOptions): Promise<T.WithLastResponse<T.DomainDetail>> {\n return this._client.poll({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}\", pathParams: { domain_id: domainId } }, { field: \"status\", terminal: [\"active\", \"disabled\"] }, options);\n }\n /**\n * Create, then poll until `status` is terminal. The Idempotency-Key goes on the create only.\n *\n * @param options - Poll options (`intervalMs`, `timeoutMs`, `signal`) and request options for the create.\n */\n createAndPoll(params?: T.DomainCreateParams, options?: PollOptions): Promise<T.WithLastResponse<T.DomainDetail>> {\n return this._client.createAndPoll<T.WithLastResponse<T.DomainDetail>>(\n { method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains\", body: params, idempotent: true },\n (created) => ({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}\", pathParams: { domain_id: created.id } }),\n { field: \"status\", terminal: [\"active\", \"disabled\"] },\n options,\n );\n }\n /**\n * Send a built-in test email from this domain, no template needed.\n *\n * Sends a fixed message (subject `[TEST] Sending from <domain> works`, a short body naming the domain and the From address) so a freshly verified domain can be tried before any template exists. The From address defaults to `test@<domain>` and must be at this exact domain. Like a template test send it skips the suppression list and the ordinary send limits, counts against the workspace test-send limit (30 per hour), and is recorded with `source: test_send`.\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainTestSendParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domain_id` is not a UUID, or the body is malformed (bad `to` or `from`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, DOMAIN_NOT_FOUND: `DOMAIN_NOT_FOUND`: no such domain in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different body or route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, FROM_DOMAIN_MISMATCH, from_domain_not_verified, domain_not_verified_by_provider: `FROM_DOMAIN_MISMATCH`: the From address is not at this domain; or `from_domain_not_verified` (body `code`, `details: { fqdn, reason }`): the domain is receive-only (`reason: not_registered`) or not verified yet (`reason: not_verified`); or `domain_not_verified_by_provider`: its DNS records have been broken for over 72 h (`health: failing`). Refused before anything is recorded or queued.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 30 test sends this hour in this workspace: `RATE_LIMITED` with `details: { window, limit, retry_after }`. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/domains/{domain_id}/test-send\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains-domain-id-test-send\n * @example\n * ```ts\n * const sendAccepted = await mail.domains.testSend(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { to: \"you@acme.com\" });\n * ```\n */\n testSend(domainId: string, params: T.DomainTestSendParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendAccepted>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/test-send\", pathParams: { domain_id: domainId }, body: params, idempotent: true }, options);\n }\n /**\n * Update domain settings: capabilities, DNS provider hint, custom MAIL FROM subdomain, DMARC recommendation.\n *\n * `intent` (or Resend's `capabilities`) changes what the domain is used for. A pending domain just changes; a verified domain gaining sending or receiving has the new records checked live and is refused with 409 `CAPABILITY_NOT_VERIFIED` (the records to publish in `details.records`) until they pass. Turning receiving off is refused while active mailboxes exist (409 `DOMAIN_HAS_MAILBOXES`, the mailboxes in `details.mailboxes`; deleted mailboxes do not count); turning sending off also turns the custom MAIL FROM off. `tls`, `open_tracking`, `click_tracking` and `tracking_subdomain` are accepted for Resend compatibility; only the values in effect today pass (422 otherwise). `dns_provider` is the provider the setup wizard renders host names for. `mail_from_subdomain` sets the custom MAIL FROM label (`bounce` → `bounce.<fqdn>`; `null` turns it off): the domain's record set gains the MAIL FROM MX + SPF records, and once the domain is verified its MAIL FROM is pointed there (the default return address stays in use until the MX record is found, so mail never stops). Refused with 409 when that host already carries records that are not ours. `dmarc_managed: false` hides the `_dmarc` recommendation for domains whose DMARC is managed elsewhere (the policy is still detected and graded).\n *\n * @param domainId - Id of the domain.\n * @param params - `Mail.DomainUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, INVALID_CAPABILITIES, MAIL_FROM_NOT_SENDING: Validation failure on the request body; `intent` and `capabilities` disagree or enable nothing (`INVALID_CAPABILITIES`); or `mail_from_subdomain` on a receive-only domain (`MAIL_FROM_NOT_SENDING`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, CAPABILITY_NOT_VERIFIED, DOMAIN_HAS_MAILBOXES, MAIL_FROM_HOST_IN_USE, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `CAPABILITY_NOT_VERIFIED`: a verified domain cannot gain sending or receiving until the new records verify (`details.failing`, `details.records`); `DOMAIN_HAS_MAILBOXES`: receiving cannot be turned off while active mailboxes exist (`details.count`, `details.mailboxes[].id|address`); `MAIL_FROM_HOST_IN_USE`: the MAIL FROM host already has a CNAME, a foreign MX or a foreign SPF record (listed in `details.found`); or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, TLS_ENFORCED_NOT_AVAILABLE, TRACKING_NOT_AVAILABLE: `TLS_ENFORCED_NOT_AVAILABLE`: `tls: enforced`; `TRACKING_NOT_AVAILABLE`: open/click tracking or a tracking subdomain.\n * @throws {RateLimitError} 429 RATE_LIMITED: `mail_from_subdomain` or `intent` changed less than 10 seconds ago (`RATE_LIMITED`). Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/domains/{domain_id}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-domains-domain-id\n * @example\n * ```ts\n * const domain = await mail.domains.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { capabilities: { receiving: \"enabled\", sending: \"enabled\" } });\n * ```\n */\n update(domainId: string, params?: T.DomainUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Domain>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}\", pathParams: { domain_id: domainId }, body: params, idempotent: true }, options);\n }\n /**\n * Run a synchronous DNS check against this domain; flips status to active when the required record set passes.\n *\n * Legacy shape, kept as an alias of `POST .../dns-records/check`: returns the domain on success and a 400 with `dns_check_results` when a required record fails. New integrations should use `POST .../dns-records/check`, which returns per-record states.\n *\n * @param domainId - Id of the domain.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Verification failed — one or more required records are still missing or wrong.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: Verified less than 10 seconds ago (`RATE_LIMITED`). Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/domains/{domain_id}/verify\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-domains-domain-id-verify\n * @example\n * ```ts\n * const domain = await mail.domains.verify(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n verify(domainId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Domain>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/domains/{domain_id}/verify\", pathParams: { domain_id: domainId } }, options);\n }\n}\n\n/** `emails` */\nexport class EmailsResource extends APIResource {\n /**\n * Send up to 100 emails in one request\n *\n * Each row is a `POST /emails` body plus an optional `idempotency_key`, processed independently: the response reports `accepted` (with the email `id`) or `rejected` (with `error.code`) per row. An `Idempotency-Key` header covers the whole request; a row `idempotency_key` covers one row, in the same dedupe namespace (so the header must differ from every row key).\n *\n * @param params - `Mail.EmailBatchParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, IDEMPOTENCY_KEY_CONFLICTS_WITH_ROW: Validation failure (malformed row, more than 100 rows), or `IDEMPOTENCY_KEY_CONFLICTS_WITH_ROW`: the `Idempotency-Key` header equals a row `idempotency_key`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, from_domain_not_verified, domain_not_verified_by_provider, INVALID_FROM_ADDRESS: For any row: `from_domain_not_verified` (body `code`, `details: { fqdn, reason }`): the domain of the From address is not itself an active sending domain of this workspace (`reason: not_registered` or `not_verified`); refused before anything is recorded or queued. Or `domain_not_verified_by_provider`: the from-domain's DNS records have been broken for over 72 h, so the email provider no longer sends for it. Or `INVALID_FROM_ADDRESS`. The whole batch is refused; no row is sent.\n * @throws {RateLimitError} 429 RATE_LIMITED: The workspace send limits never 429 a batch: a row over one is rejected in the 200 body with `RATE_LIMITED`, and the other rows are unaffected. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/emails/batch\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-emails-batch\n * @example\n * ```ts\n * const sendBatchOpenApi = await mail.emails.batch({\n * emails: [{ from: \"Acme <hello@mail.acme.com>\", to: [\"success@simulator.amazonses.com\"] }],\n * });\n * ```\n */\n batch(params: T.EmailBatchParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendBatchOpenApi>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/emails/batch\", body: params, idempotent: true }, options);\n }\n /**\n * List emails\n *\n * One entry per email (send call), newest first, with its recipients and `last_event`, the worst status across its messages. Filter by tags with `tag[name]=value` (repeat for several; all must match). Emails sent before 2026-11-06 appear as one-recipient emails.\n *\n * @param params - `Mail.EmailListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid cursor or tag filter.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/emails\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-emails\n * @example\n * ```ts\n * for await (const email of mail.emails.list()) {\n * console.log(email);\n * }\n * const page = await mail.emails.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.EmailListParams, options?: RequestOptions): PagePromise<T.Email> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/emails\", query: params }, options);\n }\n /**\n * Email metrics for a workspace\n *\n * Outbound email counts and rates over a range of up to 30 days, in hourly or daily buckets in your time zone, optionally per sending domain, filtered by domain, API key or source. Read-only.\n *\n * - **Emails** (`sent`): messages that left the queue.\n * - **Deliverability rate**: delivered / emails sent with delivery tracking. Emails sent before delivery tracking started, or through a custom SMTP relay, are confirmed at hand-off only, so for them `delivered` is not measured and the rate is `null` (`measured.delivery = false`), never 0.\n * - **Bounce rate**: bounced / emails. Suppressed recipients never count.\n * - **Complaint rate**: complained / delivered, from mailbox providers' feedback loops.\n *\n * Rates are numbers from 0 to 1, or `null` when unmeasured or when the denominator is zero. Template test sends are excluded. Cached for up to 60 seconds.\n *\n * @param params - `Mail.EmailMetricsParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A parameter is invalid: `domain_id` or `api_key_id` is not a UUID; more than 100 `domain_id`; an unknown `timezone`, `granularity`, `source` or dimension; a date that does not parse; `end_date` not after `start_date`; a range longer than 30 days or starting before the 30-day retention; or `granularity=hourly` over more than 7 days. The reason is in `message`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: No valid credential.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `mail.message.read` on the workspace (including non-members), or Mail is not enabled on it (`SERVICE_NOT_ENABLED`).\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/emails/metrics\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-emails-metrics\n * @example\n * ```ts\n * const emailMetrics = await mail.emails.metrics();\n * ```\n */\n metrics(params?: T.EmailMetricsParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.EmailMetrics>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/emails/metrics\", query: params }, options);\n }\n /**\n * Retrieve an email\n *\n * The email as sent (from, to, cc, bcc, reply_to, subject, tags, custom headers) with one entry per recipient message and `last_event`, the worst status across them. Bodies are on `GET /messages/{id}/body`.\n *\n * @param id - Id of the email.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, EMAIL_NOT_FOUND: `EMAIL_NOT_FOUND`: no email with this id in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/emails/{id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-emails-id\n * @example\n * ```ts\n * const emailDetail = await mail.emails.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.EmailDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/emails/{id}\", pathParams: { id } }, options);\n }\n /**\n * Send an email\n *\n * Send your own `html` and/or `text`, or a saved `template`, to up to 50 recipients across `to`, `cc` and `bcc`, with `reply_to`, custom `headers` and `tags`. Every recipient gets its own copy (its own message in `GET /messages`, suppression check and delivery status) showing the same `To` and `Cc` headers; `bcc` recipients appear in no header. A recipient on the suppression list (or unsubscribed, for a template with an unsubscribe link) is left out with a `suppressed` message, and the email is still accepted. Counts one send per recipient against the workspace limits. Pass an `Idempotency-Key` header to make retries safe.\n *\n * @param params - `Mail.EmailSendParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, EMAIL_CONTENT_CONFLICT, RECIPIENT_LIMIT, MAIL_HEADER_NOT_ALLOWED: Validation failure; `EMAIL_CONTENT_CONFLICT` (both or neither of `html`/`text` and `template`); `RECIPIENT_LIMIT` (more than 50 recipients); `MAIL_HEADER_NOT_ALLOWED` (`details.headers` names the refused headers).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, TEMPLATE_NOT_FOUND: `TEMPLATE_NOT_FOUND`: the `template.name` is not a template of this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, from_domain_not_verified, domain_not_verified_by_provider, INVALID_FROM_ADDRESS, TEMPLATE_RENDER_FAILED, TEMPLATE_DATA_INVALID: `from_domain_not_verified` (body `code`, `details: { fqdn, reason }`): the domain of the From address is not itself an active sending domain of this workspace (`reason: not_registered` or `not_verified`); refused before anything is recorded or queued. Or `domain_not_verified_by_provider`: the from-domain's DNS records have been broken for over 72 h, so the email provider no longer sends for it. Or `INVALID_FROM_ADDRESS`. Or `TEMPLATE_RENDER_FAILED` / `TEMPLATE_DATA_INVALID` for a template send.\n * @throws {RateLimitError} 429 RATE_LIMITED: Over a workspace send limit (60 per minute, 600 per hour, 10,000 per day; each recipient counts): `RATE_LIMITED` with `details: { window, limit, retry_after }`. Nothing is recorded or queued. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/emails\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-emails\n * @example\n * ```ts\n * const sendEmail = await mail.emails.send({ from: \"Acme <hello@mail.acme.com>\", to: [\"success@simulator.amazonses.com\"] });\n * ```\n */\n send(params: T.EmailSendParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendEmail>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/emails\", body: params, idempotent: true }, options);\n }\n}\n\n/** `integrations.github.repos.branches` */\nexport class IntegrationsGithubReposBranchesResource extends APIResource {\n /**\n * List branches for the given repo.\n *\n * @param owner - Owner (user or organisation) of the GitHub repository.\n * @param repo - Name of the GitHub repository.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/integrations/github/repos/{owner}/{repo}/branches\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-integrations-github-repos-owner-repo-branches\n * @example\n * ```ts\n * const result = await mail.integrations.github.repos.branches.list(\"owner\", \"repo\");\n * ```\n */\n list(owner: string, repo: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.IntegrationGithubRepoBranchListResponse>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/integrations/github/repos/{owner}/{repo}/branches\", pathParams: { owner, repo } }, options);\n }\n}\n\n/** `integrations.github.repos` */\nexport class IntegrationsGithubReposResource extends APIResource {\n #branches?: IntegrationsGithubReposBranchesResource;\n get branches(): IntegrationsGithubReposBranchesResource {\n return (this.#branches ??= new IntegrationsGithubReposBranchesResource(this._client, this._b));\n }\n /**\n * List repos visible to the connected GitHub account.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/integrations/github/repos\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-integrations-github-repos\n * @example\n * ```ts\n * const result = await mail.integrations.github.repos.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.IntegrationGithubRepoListResponse>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/integrations/github/repos\" }, options);\n }\n}\n\n/** `integrations.github.settings` */\nexport class IntegrationsGithubSettingsResource extends APIResource {\n /**\n * Set the repo + branch + templates path to sync from.\n *\n * @param params - `Mail.IntegrationGithubSettingsUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/workspaces/{workspace_id}/integrations/github/settings\n * @see https://productcraft.co/docs/mail/api-reference#put-v1-workspaces-workspace-id-integrations-github-settings\n * @example\n * ```ts\n * await mail.integrations.github.settings.update({ branch: \"main\", repo_full_name: \"octocat/templates\", templates_path: \"/\" });\n * ```\n */\n update(params: T.IntegrationGithubSettingsUpdateParams, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"PUT\", path: \"/v1/workspaces/{workspace_id}/integrations/github/settings\", body: params, idempotent: true }, options);\n }\n}\n\n/** `integrations.github.sync` */\nexport class IntegrationsGithubSyncResource extends APIResource {\n /**\n * Trigger an immediate sync from GitHub. Returns a sync id to poll.\n *\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/integrations/github/sync\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-integrations-github-sync\n * @example\n * ```ts\n * const startSync = await mail.integrations.github.sync.create();\n * ```\n */\n create(options?: RequestOptions): APIPromise<T.WithLastResponse<T.StartSync>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/integrations/github/sync\", idempotent: true }, options);\n }\n /**\n * Poll a sync run's status.\n *\n * @param syncId - Id of the sync.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Run not found or expired.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/integrations/github/sync/{sync_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-integrations-github-sync-sync-id\n * @example\n * ```ts\n * const syncStatus = await mail.integrations.github.sync.retrieve(\"sync\");\n * ```\n */\n retrieve(syncId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SyncStatus>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/integrations/github/sync/{sync_id}\", pathParams: { sync_id: syncId } }, options);\n }\n}\n\n/** `integrations.github` */\nexport class IntegrationsGithubResource extends APIResource {\n #repos?: IntegrationsGithubReposResource;\n #settings?: IntegrationsGithubSettingsResource;\n #sync?: IntegrationsGithubSyncResource;\n get repos(): IntegrationsGithubReposResource {\n return (this.#repos ??= new IntegrationsGithubReposResource(this._client, this._b));\n }\n get settings(): IntegrationsGithubSettingsResource {\n return (this.#settings ??= new IntegrationsGithubSettingsResource(this._client, this._b));\n }\n get sync(): IntegrationsGithubSyncResource {\n return (this.#sync ??= new IntegrationsGithubSyncResource(this._client, this._b));\n }\n /**\n * Mint a GitHub OAuth state token and return the authorize URL.\n *\n * The frontend redirects the user to `authorize_url`; GitHub bounces back to the `/callback` endpoint with a `code` + `state` pair. state is single-use, 5-minute TTL.\n *\n * @param params - `Mail.IntegrationGithubConnectParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/integrations/github/connect\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-integrations-github-connect\n * @example\n * ```ts\n * const connectGitHub = await mail.integrations.github.connect({ return_to: \"https://console.productcraft.co/mail/workspaces/acme/integrations\" });\n * ```\n */\n connect(params: T.IntegrationGithubConnectParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ConnectGitHub>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/integrations/github/connect\", body: params, idempotent: true }, options);\n }\n}\n\n/** `integrations` */\nexport class IntegrationsResource extends APIResource {\n #github?: IntegrationsGithubResource;\n get github(): IntegrationsGithubResource {\n return (this.#github ??= new IntegrationsGithubResource(this._client, this._b));\n }\n /**\n * Disconnect an integration. Deletes the credential row.\n *\n * Hard delete — the encrypted blob is removed. The customer must reconnect via the provider-specific OAuth flow to restore access.\n *\n * @param provider - The integration provider (`github`).\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/integrations/{provider}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-integrations-provider\n * @example\n * ```ts\n * await mail.integrations.delete(\"provider\");\n * ```\n */\n delete(provider: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/integrations/{provider}\", pathParams: { provider }, idempotent: true }, options);\n }\n /**\n * List connected workspace integrations.\n *\n * Returns one entry per connected provider (GitHub, …). No secrets in the response — only public identifiers + status + sync stamps.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/integrations\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-integrations\n * @example\n * ```ts\n * const listIntegrations = await mail.integrations.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.ListIntegrations>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/integrations\" }, options);\n }\n /**\n * Get a single integration detail with redacted credentials.\n *\n * Includes the provider's `credentials_redacted` view. Secret fields (access tokens, signing keys) are never included.\n *\n * @param provider - The integration provider (`github`).\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: No integration of the requested provider for this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/integrations/{provider}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-integrations-provider\n * @example\n * ```ts\n * const integrationDetail = await mail.integrations.retrieve(\"provider\");\n * ```\n */\n retrieve(provider: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.IntegrationDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/integrations/{provider}\", pathParams: { provider } }, options);\n }\n}\n\n/** `mailboxes.messages.attachments` */\nexport class MailboxesMessagesAttachmentsResource extends APIResource {\n /**\n * Stream a single attachment by its position. Gated by `mail.message.body.read`: an attachment is message content, and /:mid already names it without handing over the bytes.\n *\n * @param id - Id of the mailboxe.\n * @param mid - Id of the message in the mailbox.\n * @param position - Position of the attachment in the message, starting at 0.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Policy denies `mail.message.body.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Attachment not found\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/attachments/{position}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-mailboxes-id-messages-mid-attachments-position\n * @example\n * ```ts\n * const response = await mail.mailboxes.messages.attachments.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\", \"position\");\n * const text = await response.text();\n * ```\n */\n retrieve(id: string, mid: string, position: string, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/attachments/{position}\", pathParams: { id, mid, position }, raw: true }, options);\n }\n}\n\n/** `mailboxes.messages` */\nexport class MailboxesMessagesResource extends APIResource {\n #attachments?: MailboxesMessagesAttachmentsResource;\n get attachments(): MailboxesMessagesAttachmentsResource {\n return (this.#attachments ??= new MailboxesMessagesAttachmentsResource(this._client, this._b));\n }\n /**\n * Soft-delete a message\n *\n * @param id - Id of the mailboxe.\n * @param mid - Id of the message in the mailbox.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Message not found\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-mailboxes-id-messages-mid\n * @example\n * ```ts\n * await mail.mailboxes.messages.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n delete(id: string, mid: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}\", pathParams: { id, mid } }, options);\n }\n /**\n * List messages in a mailbox\n *\n * @param id - Id of the mailboxe.\n * @param params - `Mail.MailboxMessageListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter or cursor.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Mailbox not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/mailboxes/{id}/messages\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-mailboxes-id-messages\n * @example\n * ```ts\n * for await (const message of mail.mailboxes.messages.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\")) {\n * console.log(message);\n * }\n * const page = await mail.mailboxes.messages.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", {}, { timeout: 5_000 });\n * ```\n */\n list(id: string, params?: T.MailboxMessageListParams, options?: RequestOptions): PagePromise<T.Message> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}/messages\", pathParams: { id }, query: params }, options);\n }\n /**\n * Stream the raw RFC5322 .eml for a message. Gated by `mail.message.body.read` (admin+ by default; not granted to plain members) — the outbound lane's /messages/:id/body action.\n *\n * @param id - Id of the mailboxe.\n * @param mid - Id of the message in the mailbox.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Policy denies `mail.message.body.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: Message not found\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/raw\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-mailboxes-id-messages-mid-raw\n * @example\n * ```ts\n * const response = await mail.mailboxes.messages.raw(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * const text = await response.text();\n * ```\n */\n raw(id: string, mid: string, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/raw\", pathParams: { id, mid }, raw: true }, options);\n }\n /**\n * Mark a message as read\n *\n * @param id - Id of the mailboxe.\n * @param mid - Id of the message in the mailbox.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Message not found\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/read\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-mailboxes-id-messages-mid-read\n * @example\n * ```ts\n * await mail.mailboxes.messages.read(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n read(id: string, mid: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/read\", pathParams: { id, mid } }, options);\n }\n /**\n * Get a single message (metadata + attachment manifest; `body_preview` is null without `mail.message.body.read`). Use /:mid/raw for content.\n *\n * @param id - Id of the mailboxe.\n * @param mid - Id of the message in the mailbox.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Message not found\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-mailboxes-id-messages-mid\n * @example\n * ```ts\n * const messageDetail = await mail.mailboxes.messages.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"5d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6\");\n * ```\n */\n retrieve(id: string, mid: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.MessageDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}\", pathParams: { id, mid } }, options);\n }\n}\n\n/** `mailboxes` */\nexport class MailboxesResource extends APIResource {\n #messages?: MailboxesMessagesResource;\n get messages(): MailboxesMessagesResource {\n return (this.#messages ??= new MailboxesMessagesResource(this._client, this._b));\n }\n /**\n * Create a mailbox under a verified domain. Local-part + domain combination must be globally unique.\n *\n * @param params - `Mail.MailboxCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (invalid local part, retention out of range).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `mail.create` permission, or workspace has not enabled the `mail` service.\n * @throws {NotFoundError} 404 NOT_FOUND: Domain not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Mailbox local-part already exists on this domain, or the domain is not yet verified, or `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different body or route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: Local part or retention rejected by service-layer validation.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/mailboxes\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-mailboxes\n * @example\n * ```ts\n * const mailbox = await mail.mailboxes.create({ domain_id: \"9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b\", local_part: \"claude-qa-alpha\" });\n * ```\n */\n create(params: T.MailboxCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Mailbox>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/mailboxes\", body: params, idempotent: true }, options);\n }\n /**\n * Soft-delete a mailbox: its status becomes `disabled` and it stops accepting new mail; existing messages are kept until retention purges them, and `PATCH` with `status: active` restores it. A deleted mailbox no longer blocks deleting its domain, and deleting the domain erases it and its remaining mail.\n *\n * @param id - Id of the mailboxe.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Mailbox not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/mailboxes/{id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-mailboxes-id\n * @example\n * ```ts\n * await mail.mailboxes.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(id: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}\", pathParams: { id } }, options);\n }\n /**\n * List mailboxes in this workspace. 20 per page by default (max 200) — paginate with the cursor returned in `pagination.next_cursor` while `pagination.has_more` is true.\n *\n * @param params - `Mail.MailboxListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `mail.read` permission, or workspace has not enabled the `mail` service.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/mailboxes\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-mailboxes\n * @example\n * ```ts\n * for await (const mailbox of mail.mailboxes.list()) {\n * console.log(mailbox);\n * }\n * const page = await mail.mailboxes.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.MailboxListParams, options?: RequestOptions): PagePromise<T.Mailbox> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/mailboxes\", query: params }, options);\n }\n /**\n * Get one mailbox by id.\n *\n * @param id - Id of the mailboxe.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Mailbox not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/mailboxes/{id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-mailboxes-id\n * @example\n * ```ts\n * const mailbox = await mail.mailboxes.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Mailbox>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}\", pathParams: { id } }, options);\n }\n /**\n * Update mailbox display name, retention, or status. Status transitions are restricted (active ↔ suspended; archived is terminal).\n *\n * @param id - Id of the mailboxe.\n * @param params - `Mail.MailboxUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure or invalid status transition.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Mailbox not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: Retention or status rejected by service-layer validation.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/mailboxes/{id}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-mailboxes-id\n * @example\n * ```ts\n * const mailbox = await mail.mailboxes.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { display_name: \"string\" });\n * ```\n */\n update(id: string, params?: T.MailboxUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Mailbox>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/mailboxes/{id}\", pathParams: { id }, body: params, idempotent: true }, options);\n }\n}\n\n/** `messages.settings` */\nexport class MessagesSettingsResource extends APIResource {\n /**\n * Read this workspace's outbound-message settings. Absent → defaults (redact_bodies: false).\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/messages/settings\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-messages-settings\n * @example\n * ```ts\n * const outboundMessageSettings = await mail.messages.settings.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.OutboundMessageSettings>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/messages/settings\" }, options);\n }\n /**\n * Update this workspace's outbound-message settings. Gated on `mail.message.delete` — same privilege bar as RTBF, since both touch the PII boundary.\n *\n * @param params - `Mail.MessageSettingsUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid payload.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/messages/settings\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-messages-settings\n * @example\n * ```ts\n * const outboundMessageSettings = await mail.messages.settings.update({ redact_bodies: true });\n * ```\n */\n update(params: T.MessageSettingsUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.OutboundMessageSettings>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/messages/settings\", body: params, idempotent: true }, options);\n }\n}\n\n/** `messages` */\nexport class MessagesResource extends APIResource {\n #settings?: MessagesSettingsResource;\n get settings(): MessagesSettingsResource {\n return (this.#settings ??= new MessagesSettingsResource(this._client, this._b));\n }\n /**\n * Get the cleartext body of an outbound message. Gated by `mail.message.body.read` (admin+ by default; not granted to plain members).\n *\n * @param id - Id of the message.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Not found.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/messages/{id}/body\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-messages-id-body\n * @example\n * ```ts\n * const outboundMessageWithBody = await mail.messages.body(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n body(id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.OutboundMessageWithBody>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/messages/{id}/body\", pathParams: { id } }, options);\n }\n /**\n * RTBF: delete every message log row for `recipient` (case-insensitive). Returns the deleted-row count.\n *\n * The bulk GDPR erase (`messages.erase` in the SDKs): removes every delivery-log row sent to one recipient address in this workspace (with its stored body and events), and strips the address from the cc, bcc and reply-to lists of other rows, in one transaction. Repeating it is harmless (the second call deletes 0 rows).\n *\n * @param params - `Mail.MessageEraseParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Missing or invalid recipient.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/messages\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-messages\n * @example\n * ```ts\n * const deleteByRecipient = await mail.messages.erase({ recipient: \"ada@example.com\" });\n * ```\n */\n erase(params: T.MessageEraseParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.DeleteByRecipient>> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/messages\", query: params }, options);\n }\n /**\n * Stream the filtered message log as CSV. Same filters as GET /messages. Body columns are intentionally omitted; bodies remain gated by `mail.message.body.read`. Rate-limited 1 concurrent + 5/hour per workspace.\n *\n * Columns: id, created_at, sent_at, delivered_at, deferred_at, deferral_count, from_address, to_address, subject, template_name, status, spf_result, dkim_result, dmarc_result, bounce_code, bounce_detail, api_key_id, source, domain. The filters are resolved by the same code as `GET /messages`, so the same query string exports exactly the rows the list pages through. A rejected filter (400) does not count against the hourly cap.\n *\n * @param params - `Mail.MessageExportParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter: an unknown status or source, a malformed uuid or date-time, `q` over 200 characters, `created_after` not earlier than `created_before`, or a window wider than 30 days. The reason is in `message`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: Another export is already running, or this workspace has hit the hourly export cap. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/messages/export\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-messages-export\n * @example\n * ```ts\n * const response = await mail.messages.export();\n * const text = await response.text();\n * ```\n */\n export(params?: T.MessageExportParams, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/messages/export\", query: params, raw: true }, options);\n }\n /**\n * List outbound messages with cursor pagination\n *\n * One row per recipient delivery, newest first. Filters combine with AND: `q` (free text over recipient, from, subject, message id and Message-ID), `status` (any of, repeatable), `domain_id`, `api_key_id`, `source`, `template`, `created_after` / `created_before` (at most 30 days apart), plus the legacy `recipient` and `subject_contains`. `GET /messages/export` takes exactly the same filters and returns the same rows.\n *\n * @param params - `Mail.MessageListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter or cursor: an unknown status or source, a malformed uuid or date-time, `q` over 200 characters, `created_after` not earlier than `created_before`, or a window wider than 30 days. The reason is in `message`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/messages\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-messages\n * @example\n * ```ts\n * for await (const message of mail.messages.list()) {\n * console.log(message);\n * }\n * const page = await mail.messages.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.MessageListParams, options?: RequestOptions): PagePromise<T.OutboundMessage> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/messages\", query: params }, options);\n }\n /**\n * Get a single outbound message (metadata + delivery verdicts; body not included) with its event timeline: `events[]` oldest first, `last_event`, `transport`, `bounce_type`, `bounce_subtype`. Use /:id/body for cleartext content.\n *\n * @param id - Id of the message.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Not found.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/messages/{id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-messages-id\n * @example\n * ```ts\n * const outboundMessageDetail = await mail.messages.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.OutboundMessageDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/messages/{id}\", pathParams: { id } }, options);\n }\n /**\n * Day-bucketed inbound message volume for a workspace\n *\n * Counts INBOUND mail only: messages received by the workspace's mailboxes, in dense day buckets in [since, until). `metric=sent` (default, a historical name) counts received messages, not outbound sends; `metric=bounced` counts MX-time rejections matched to this workspace by envelope-to. For outbound counts and rates use `GET /emails/metrics`.\n *\n * @param params - `Mail.MessageTimelineParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/messages/timeline\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-messages-timeline\n * @example\n * ```ts\n * const messageTimeline = await mail.messages.timeline({ granularity: \"day\", since: \"2026-04-01T00:00:00Z\", until: \"2026-05-01T00:00:00Z\" });\n * ```\n */\n timeline(params: T.MessageTimelineParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.MessageTimeline>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/messages/timeline\", query: params }, options);\n }\n}\n\n/** `received.attachments` */\nexport class ReceivedAttachmentsResource extends APIResource {\n /**\n * Download one attachment of a received email\n *\n * By its `position` from the detail's attachment manifest. Unscanned, untrusted bytes from a third party. Gated by `mail.message.body.read`.\n *\n * @param id - Received email id.\n * @param position - Attachment position (0-based).\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a uuid or `position` is not an integer.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The policy does not grant `mail.message.body.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: No such email in this workspace, or no attachment at that position.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/received/{id}/attachments/{position}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-received-id-attachments-position\n * @example\n * ```ts\n * const response = await mail.received.attachments.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", \"position\");\n * const text = await response.text();\n * ```\n */\n retrieve(id: string, position: string, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/received/{id}/attachments/{position}\", pathParams: { id, position }, raw: true }, options);\n }\n}\n\n/** `received` */\nexport class ReceivedResource extends APIResource {\n #attachments?: ReceivedAttachmentsResource;\n get attachments(): ReceivedAttachmentsResource {\n return (this.#attachments ??= new ReceivedAttachmentsResource(this._client, this._b));\n }\n /**\n * Delete a received email\n *\n * Soft delete: it disappears from every list at once; retention purges the stored message later.\n *\n * @param id - Received email id.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a uuid.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The policy does not grant `mail.delete` on every mailbox.\n * @throws {NotFoundError} 404 NOT_FOUND: No such email in this workspace (or it was already deleted).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/received/{id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-received-id\n * @example\n * ```ts\n * await mail.received.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(id: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/received/{id}\", pathParams: { id } }, options);\n }\n /**\n * Stream the filtered received email as CSV. Same filters as GET /received. Rate-limited 1 concurrent + 5/hour per workspace.\n *\n * Columns: id, received_at, mailbox, from, to (`; `-separated), subject, spam_verdict, spf, dkim, dmarc, size_bytes, attachments (count). No body content. A cell starting with `=`, `+`, `-` or `@` is prefixed with `'` so a spreadsheet does not run it as a formula. A rejected filter (400) does not count against the hourly cap, which is separate from the sent-email export's.\n *\n * @param params - `Mail.ReceivedExportParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter or cursor: a malformed uuid, boolean or date-time, `q` over 200 characters, `received_after` not earlier than `received_before`, or a window wider than 30 days. The reason is in `message`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The policy does not grant `mail.list` on every mailbox, or Mail is not enabled for this workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: Another received-email export is already running, or this workspace has hit the hourly cap (5). Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/received/export\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-received-export\n * @example\n * ```ts\n * const response = await mail.received.export();\n * const text = await response.text();\n * ```\n */\n export(params?: T.ReceivedExportParams, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/received/export\", query: params, raw: true }, options);\n }\n /**\n * List received email across every mailbox in the workspace\n *\n * Newest first, cursor-paged, deleted email excluded. Filters combine with AND: `q` (sender, subject, envelope recipient or To address as a substring; or an exact id or Message-ID), `mailbox_id`, `domain_id`, `received_after` / `received_before` (at most 30 days apart), `spam`, `unread`. `GET /received/export` takes exactly the same filters and returns the same rows. No body content.\n *\n * @param params - `Mail.ReceivedListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter or cursor: a malformed uuid, boolean or date-time, `q` over 200 characters, `received_after` not earlier than `received_before`, or a window wider than 30 days. The reason is in `message`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The policy does not grant `mail.list` on every mailbox, or Mail is not enabled for this workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/received\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-received\n * @example\n * ```ts\n * for await (const received of mail.received.list()) {\n * console.log(received);\n * }\n * const page = await mail.received.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.ReceivedListParams, options?: RequestOptions): PagePromise<T.ReceivedEmail> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/received\", query: params }, options);\n }\n /**\n * Download the raw RFC 5322 message (.eml)\n *\n * Every header, the full body and every attachment inline. Gated by `mail.message.body.read` (admin and up by default), like `/mailboxes/{id}/messages/{mid}/raw`.\n *\n * @param id - Received email id.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a uuid.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The policy does not grant `mail.message.body.read`.\n * @throws {NotFoundError} 404 NOT_FOUND: No such email in this workspace (or it was deleted).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/received/{id}/raw\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-received-id-raw\n * @example\n * ```ts\n * const response = await mail.received.raw(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * const text = await response.text();\n * ```\n */\n raw(id: string, options?: RequestOptions): APIPromise<Response> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/received/{id}/raw\", pathParams: { id }, raw: true }, options);\n }\n /**\n * Mark a received email as read\n *\n * @param id - Received email id.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a uuid.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The policy does not grant `mail.read` on every mailbox.\n * @throws {NotFoundError} 404 NOT_FOUND: No such email in this workspace (or it was deleted).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/received/{id}/read\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-received-id-read\n * @example\n * ```ts\n * await mail.received.read(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n read(id: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/received/{id}/read\", pathParams: { id } }, options);\n }\n /**\n * Get one received email\n *\n * Metadata, the authentication results, the envelope recipient and the attachment manifest. `body_preview` is null without `mail.message.body.read`; the full message is at `/received/{id}/raw`.\n *\n * @param id - Received email id.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `id` is not a uuid.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The policy does not grant `mail.read` on every mailbox.\n * @throws {NotFoundError} 404 NOT_FOUND: No such email in this workspace (or it was deleted).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/received/{id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-received-id\n * @example\n * ```ts\n * const receivedEmailDetail = await mail.received.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(id: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ReceivedEmailDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/received/{id}\", pathParams: { id } }, options);\n }\n}\n\n/** `segments.contacts` */\nexport class SegmentsContactsResource extends APIResource {\n /**\n * List a segment's contacts\n *\n * Newest contact first. For a rule segment, the contacts matching its rule right now.\n *\n * @param segmentId - Id of the segment.\n * @param params - `Mail.SegmentContactListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: No such segment (`SEGMENT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/segments/{segment_id}/contacts\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-segments-segment-id-contacts\n * @example\n * ```ts\n * for await (const contact of mail.segments.contacts.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\")) {\n * console.log(contact);\n * }\n * const page = await mail.segments.contacts.list(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", {}, { timeout: 5_000 });\n * ```\n */\n list(segmentId: string, params?: T.SegmentContactListParams, options?: RequestOptions): PagePromise<T.Contact> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/segments/{segment_id}/contacts\", pathParams: { segment_id: segmentId }, query: params }, options);\n }\n}\n\n/** `segments` */\nexport class SegmentsResource extends APIResource {\n #contacts?: SegmentsContactsResource;\n get contacts(): SegmentsContactsResource {\n return (this.#contacts ??= new SegmentsContactsResource(this._client, this._b));\n }\n /**\n * Create a segment\n *\n * Without `rule`, a static segment: add and remove contacts one at a time. With `rule`, a rule segment: its members are the contacts whose fields and properties match, evaluated every time it is read. At most 100 segments per workspace.\n *\n * @param params - `Mail.SegmentCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, SEGMENT_EXISTS, SEGMENT_LIMIT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: A segment with this name exists (`SEGMENT_EXISTS`), the workspace has 100 segments (`SEGMENT_LIMIT`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_SEGMENT_RULE: The rule is invalid (`INVALID_SEGMENT_RULE`; `details.problems` lists each one with its condition index): an unknown field, `contains` on a number property, a missing or mistyped `value`, a `value` on `exists`.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/segments\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-segments\n * @example\n * ```ts\n * const segment = await mail.segments.create({ name: \"Pro customers\" });\n * ```\n */\n create(params: T.SegmentCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Segment>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/segments\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a segment\n *\n * Contacts are not touched; a static segment's member list goes with it.\n *\n * @param segmentId - Id of the segment.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: No such segment (`SEGMENT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/segments/{segment_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-segments-segment-id\n * @example\n * ```ts\n * await mail.segments.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(segmentId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/segments/{segment_id}\", pathParams: { segment_id: segmentId } }, options);\n }\n /**\n * List segments, newest first\n *\n * @param params - `Mail.SegmentListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/segments\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-segments\n * @example\n * ```ts\n * for await (const segment of mail.segments.list()) {\n * console.log(segment);\n * }\n * const page = await mail.segments.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.SegmentListParams, options?: RequestOptions): PagePromise<T.Segment> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/segments\", query: params }, options);\n }\n /**\n * A segment's size and unsubscribed share\n *\n * Counted on request.\n *\n * @param segmentId - Id of the segment.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: No such segment (`SEGMENT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/segments/{segment_id}/metrics\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-segments-segment-id-metrics\n * @example\n * ```ts\n * const segmentMetrics = await mail.segments.metrics(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n metrics(segmentId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SegmentMetrics>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/segments/{segment_id}/metrics\", pathParams: { segment_id: segmentId } }, options);\n }\n /**\n * Preview a segment rule\n *\n * Counts the contacts a rule selects and returns the newest few, without saving anything.\n *\n * @param params - `Mail.SegmentPreviewParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_SEGMENT_RULE: The rule is invalid (`INVALID_SEGMENT_RULE`; `details.problems` lists each one with its condition index): an unknown field, `contains` on a number property, a missing or mistyped `value`, a `value` on `exists`.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/segments/preview\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-segments-preview\n * @example\n * ```ts\n * const segmentPreview = await mail.segments.preview({ rule: { conditions: [{ field: \"plan\", operator: \"equals\" }], match: \"all\" } });\n * ```\n */\n preview(params: T.SegmentPreviewParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SegmentPreview>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/segments/preview\", body: params }, options);\n }\n /**\n * Get a segment\n *\n * @param segmentId - Id of the segment.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: No such segment (`SEGMENT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/segments/{segment_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-segments-segment-id\n * @example\n * ```ts\n * const segment = await mail.segments.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(segmentId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Segment>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/segments/{segment_id}\", pathParams: { segment_id: segmentId } }, options);\n }\n /**\n * Update a segment\n *\n * Rename it, or change a rule segment's rule. A segment's type (static or rule) is fixed.\n *\n * @param segmentId - Id of the segment.\n * @param params - `Mail.SegmentUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, SEGMENT_NOT_FOUND: No such segment (`SEGMENT_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, SEGMENT_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Another segment has this name (`SEGMENT_EXISTS`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, INVALID_SEGMENT_RULE, SEGMENT_TYPE_FIXED: The rule is invalid (`INVALID_SEGMENT_RULE`; `details.problems` lists each one with its condition index): an unknown field, `contains` on a number property, a missing or mistyped `value`, a `value` on `exists`. Or a rule on a static segment (`SEGMENT_TYPE_FIXED`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/segments/{segment_id}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-segments-segment-id\n * @example\n * ```ts\n * const segment = await mail.segments.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { description: \"string\" });\n * ```\n */\n update(segmentId: string, params?: T.SegmentUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Segment>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/segments/{segment_id}\", pathParams: { segment_id: segmentId }, body: params, idempotent: true }, options);\n }\n}\n\n/** `sendingDefaults` */\nexport class SendingDefaultsResource extends APIResource {\n /**\n * Get the workspace default sender\n *\n * The From used by template sends that name none, with the live verification status of its domain. `default_sender` is null when none is set.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/sending-defaults\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-sending-defaults\n * @example\n * ```ts\n * const sendingDefaults = await mail.sendingDefaults.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendingDefaults>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/sending-defaults\" }, options);\n }\n /**\n * Set or clear the workspace default sender\n *\n * Replaces the default sender (`address: null` clears it). The change applies to the next send of every product at once, and emits a `sending_defaults.updated` webhook event. Repeating the same request changes nothing, so it takes no `Idempotency-Key`.\n *\n * @param params - `Mail.SendingDefaultUpdateParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, sender_domain_not_in_workspace, INVALID_FROM_ADDRESS: `sender_domain_not_in_workspace` (`details: { fqdn }`): the address is not on a sending domain of this workspace (unknown, another workspace's, or receive-only). `INVALID_FROM_ADDRESS`: the address could not be parsed.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/workspaces/{workspace_id}/sending-defaults\n * @see https://productcraft.co/docs/mail/api-reference#put-v1-workspaces-workspace-id-sending-defaults\n * @example\n * ```ts\n * const sendingDefaults = await mail.sendingDefaults.update({ address: \"Acme <hello@acme.com>\" });\n * ```\n */\n update(params: T.SendingDefaultUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendingDefaults>> {\n return this._client.request({ method: \"PUT\", path: \"/v1/workspaces/{workspace_id}/sending-defaults\", body: params }, options);\n }\n}\n\n/** `smtpConfig` */\nexport class SmtpConfigResource extends APIResource {\n /**\n * List every SMTP config in the workspace (default + per-domain overrides)\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/smtp-configs\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-smtp-configs\n * @example\n * ```ts\n * const listSmtpConfigs = await mail.smtpConfig.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.ListSmtpConfigs>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/smtp-configs\" }, options);\n }\n /**\n * Revert the workspace to ProductCraft Mail's own sending\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: No SMTP config to delete\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/smtp-config\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-smtp-config\n * @example\n * ```ts\n * await mail.smtpConfig.reset();\n * ```\n */\n reset(options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/smtp-config\" }, options);\n }\n /**\n * Get the workspace-default SMTP config (returns null if unset). Per-domain overrides live under /workspaces/:id/domains/:domainId/smtp-config.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/smtp-config\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-smtp-config\n * @example\n * ```ts\n * const getSmtpConfig = await mail.smtpConfig.retrieve();\n * ```\n */\n retrieve(options?: RequestOptions): APIPromise<T.WithLastResponse<T.GetSmtpConfig>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/smtp-config\" }, options);\n }\n /**\n * Create or update the workspace-default SMTP config (resets verification)\n *\n * @param params - `Mail.SmtpConfigUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure or username/password mismatch.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PUT /v1/workspaces/{workspace_id}/smtp-config\n * @see https://productcraft.co/docs/mail/api-reference#put-v1-workspaces-workspace-id-smtp-config\n * @example\n * ```ts\n * const smtpConfig = await mail.smtpConfig.update({\n * from_email: \"noreply@acme.com\",\n * from_name: \"Acme Notifications\",\n * host: \"smtp.sendgrid.net\",\n * port: 587,\n * secure: false,\n * });\n * ```\n */\n update(params: T.SmtpConfigUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SmtpConfig>> {\n return this._client.request({ method: \"PUT\", path: \"/v1/workspaces/{workspace_id}/smtp-config\", body: params, idempotent: true }, options);\n }\n /**\n * Test arbitrary SMTP creds without persisting\n *\n * @param params - `Mail.SmtpConfigVerifyParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure on the request body.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/smtp-config/verify\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-smtp-config-verify\n * @example\n * ```ts\n * const smtpVerifyResult = await mail.smtpConfig.verify({\n * from_email: \"noreply@acme.com\",\n * from_name: \"Acme Notifications\",\n * host: \"smtp.sendgrid.net\",\n * port: 587,\n * secure: false,\n * });\n * ```\n */\n verify(params: T.SmtpConfigVerifyParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SmtpVerifyResult>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/smtp-config/verify\", body: params }, options);\n }\n /**\n * Test the persisted workspace-default SMTP config; updates status\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: No SMTP config saved\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/smtp-config/verify-saved\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-smtp-config-verify-saved\n * @example\n * ```ts\n * const smtpVerifyResult = await mail.smtpConfig.verifySaved();\n * ```\n */\n verifySaved(options?: RequestOptions): APIPromise<T.WithLastResponse<T.SmtpVerifyResult>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/smtp-config/verify-saved\" }, options);\n }\n}\n\n/** `stats` */\nexport class StatsResource extends APIResource {\n /**\n * Mail stats for a workspace\n *\n * Outbound sent, delivered, bounced, complained, deferred, suppressed and unconfirmed counts in the window, the deliverability, bounce and complaint rates, domain totals, the last send time and a daily sent series. For ranges, buckets, filters and a per-domain breakdown use `GET /emails/metrics`; the rates here use its definitions.\n *\n * `delivered` means the recipient's mail server confirmed the message; `unconfirmed` means the message was handed off and nothing came back either way, which is not the same as delivered. Days are UTC. Rates are 0 to 1, or null when not measured: delivery and complaints are only reported for mail with delivery tracking. Outbound messages are kept for 30 days, so 30d is the longest window. Cached for up to 60 seconds (`generated_at`).\n *\n * @param params - `Mail.StatsRetrieveParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `window` is not one of 1d, 7d, 30d.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: Caller lacks `mail.message.read` on the workspace (including non-members), or Mail is not enabled on it (`SERVICE_NOT_ENABLED`).\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/stats\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-stats\n * @example\n * ```ts\n * const mailWorkspaceStats = await mail.stats.retrieve();\n * ```\n */\n retrieve(params?: T.StatsRetrieveParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.MailWorkspaceStats>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/stats\", query: params }, options);\n }\n}\n\n/** `suppression` */\nexport class SuppressionResource extends APIResource {\n /**\n * Add an email to the workspace suppression list\n *\n * @param params - `Mail.SuppressionCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid payload (missing or malformed email).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: Email address rejected as invalid by the service layer.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/suppression\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-suppression\n * @example\n * ```ts\n * const suppressionEntry = await mail.suppression.create({ email: \"bounced@example.com\" });\n * ```\n */\n create(params: T.SuppressionCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SuppressionEntry>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/suppression\", body: params, idempotent: true }, options);\n }\n /**\n * Remove an address from the workspace suppression list.\n *\n * @param email - The suppressed address (URL-encoded).\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Email is not on this workspace suppression list.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/suppression/{email}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-suppression-email\n * @example\n * ```ts\n * await mail.suppression.delete(\"email\");\n * ```\n */\n delete(email: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/suppression/{email}\", pathParams: { email } }, options);\n }\n /**\n * List suppressed recipients in the workspace (most-recent first), cursor-paginated.\n *\n * @param params - `Mail.SuppressionListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid cursor, search term, or source filter.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/suppression\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-suppression\n * @example\n * ```ts\n * for await (const suppression of mail.suppression.list()) {\n * console.log(suppression);\n * }\n * const page = await mail.suppression.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.SuppressionListParams, options?: RequestOptions): PagePromise<T.SuppressionEntry> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/suppression\", query: params }, options);\n }\n}\n\n/** `templates.tags` */\nexport class TemplatesTagsResource extends APIResource {\n /**\n * Distinct tag list across all templates in this workspace (for autocomplete)\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/templates/tags\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-templates-tags\n * @example\n * ```ts\n * const listTemplateTags = await mail.templates.tags.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.ListTemplateTags>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/templates/tags\" }, options);\n }\n}\n\n/** `templates.variables` */\nexport class TemplatesVariablesResource extends APIResource {\n /**\n * Variables auto-detected from the saved template body + subject (Handlebars expressions, dotted paths preserved, dedup'd in first-occurrence order).\n *\n * @param name - Name of the template.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Template not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/templates/{name}/variables\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-templates-name-variables\n * @example\n * ```ts\n * const templateVariables = await mail.templates.variables.list(\"name\");\n * ```\n */\n list(name: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.TemplateVariables>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/templates/{name}/variables\", pathParams: { name } }, options);\n }\n}\n\n/** `templates` */\nexport class TemplatesResource extends APIResource {\n #tags?: TemplatesTagsResource;\n #variables?: TemplatesVariablesResource;\n get tags(): TemplatesTagsResource {\n return (this.#tags ??= new TemplatesTagsResource(this._client, this._b));\n }\n get variables(): TemplatesVariablesResource {\n return (this.#variables ??= new TemplatesVariablesResource(this._client, this._b));\n }\n /**\n * Create or update a template, layout, or partial. Idempotent on (workspace_id, name); `kind` cannot change after the first upsert.\n *\n * @param params - `Mail.TemplateCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (bad name / payload).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/templates\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-templates\n * @example\n * ```ts\n * const template = await mail.templates.create({ body_html: \"string\", name: \"order-confirmation\", subject: \"string\" });\n * ```\n */\n create(params: T.TemplateCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Template>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/templates\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a template, layout, or partial by name.\n *\n * @param name - Name of the template.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Template not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/templates/{name}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-templates-name\n * @example\n * ```ts\n * await mail.templates.delete(\"name\");\n * ```\n */\n delete(name: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/templates/{name}\", pathParams: { name } }, options);\n }\n /**\n * Lint a draft for deliverability red flags. Same render pipeline as /preview; returns a 0-100 score (higher is better) and a sorted list of findings (errors first). Self-developed heuristic linter, no external classifier — runs in-process.\n *\n * @param params - `Mail.TemplateLintParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: Underlying render failed.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/templates/lint\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-templates-lint\n * @example\n * ```ts\n * const lintResult = await mail.templates.lint({ body_html: \"string\" });\n * ```\n */\n lint(params: T.TemplateLintParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.LintResult>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/templates/lint\", body: params }, options);\n }\n /**\n * List templates / layouts / partials in a workspace, name-ascending and cursor-paginated. Filter via ?kind=template|layout|partial (default: all), ?tags=foo,bar (comma-separated), ?search=<substring of the name>.\n *\n * @param params - `Mail.TemplateListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid cursor or search term.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/templates\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-templates\n * @example\n * ```ts\n * for await (const template of mail.templates.list()) {\n * console.log(template);\n * }\n * const page = await mail.templates.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.TemplateListParams, options?: RequestOptions): PagePromise<T.Template> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/templates\", query: params }, options);\n }\n /**\n * Preview an unsaved draft. Renders subject + bodyHtml against the workspace brand tokens + supplied data, with all workspace layouts/partials registered. Used by the editor for live preview.\n *\n * @param params - `Mail.TemplatePreviewParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: Render failed (compile or runtime error).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/templates/preview\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-templates-preview\n * @example\n * ```ts\n * const renderedMessage = await mail.templates.preview({ body_html: \"string\" });\n * ```\n */\n preview(params: T.TemplatePreviewParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.RenderedMessage>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/templates/preview\", body: params }, options);\n }\n /**\n * Render a saved template against a data payload. Returns subject + html + text without sending.\n *\n * @param name - Name of the template.\n * @param params - `Mail.TemplateRenderParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Template not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT: Cannot render a layout/partial — only sendable templates.\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: Render or schema validation failed.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/templates/{name}/render\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-templates-name-render\n * @example\n * ```ts\n * const renderedMessage = await mail.templates.render(\"name\", { data: { name: \"Alice\", order_id: \"ord_123\" } });\n * ```\n */\n render(name: string, params: T.TemplateRenderParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.RenderedMessage>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/templates/{name}/render\", pathParams: { name }, body: params }, options);\n }\n /**\n * Get a template, layout, or partial by name.\n *\n * @param name - Name of the template.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Template not found in this workspace.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/templates/{name}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-templates-name\n * @example\n * ```ts\n * const template = await mail.templates.retrieve(\"name\");\n * ```\n */\n retrieve(name: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Template>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/templates/{name}\", pathParams: { name } }, options);\n }\n /**\n * Send a template-rendered message. Pass an `Idempotency-Key` header (1..256 chars, [A-Za-z0-9_\\-:]) to make retries safe — replays return the original response with `Idempotent-Replay: true` for 24h. Same key + different request body returns 409 IDEMPOTENCY_KEY_REUSE.\n *\n * @param name - Name of the template.\n * @param params - `Mail.TemplateSendParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (malformed body or recipient).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Template not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: IDEMPOTENCY_KEY_REUSE — same key, different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, RECIPIENT_SUPPRESSED, TOPIC_NOT_FOUND, from_domain_not_verified, domain_not_verified_by_provider, no_default_sender: Recipient suppressed (`RECIPIENT_SUPPRESSED`; with a `topic_id`, or a template rendering `{{{unsubscribe_url}}}`, also when the recipient unsubscribed or never opted in: `details.reason` is `unsubscribe` or `no_consent`), `TOPIC_NOT_FOUND`, render failure, or invalid from address; or `from_domain_not_verified` (body `code`, `details: { fqdn, reason }`): the domain of the From address is not itself an active sending domain of this workspace — `reason: not_registered` (unknown, registered to another workspace, or only a subdomain such as `mail.example.com` is verified; a verified subdomain does not cover its parent) or `reason: not_verified` (registered, DNS not verified yet). Refused before anything is recorded or queued; or `domain_not_verified_by_provider` (body `code`): the from-domain's DNS records have been broken for over 72 h (`health: failing`), so the email provider no longer sends for it; or `no_default_sender` (body `code`): the body has no `from` and the workspace has no default sender set (nothing is queued; an `email.skipped` webhook event is logged).\n * @throws {RateLimitError} 429 RATE_LIMITED: Over a workspace send limit (60 per minute, 600 per hour, 10,000 per day): `RATE_LIMITED` with `details: { window, limit, retry_after }`. Nothing is recorded or queued. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/templates/{name}/send\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-templates-name-send\n * @example\n * ```ts\n * const sendAccepted = await mail.templates.send(\"name\", { data: { name: \"Alice\", order_id: \"ord_123\" }, to: \"user@example.com\" });\n * ```\n */\n send(name: string, params: T.TemplateSendParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendAccepted>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/templates/{name}/send\", pathParams: { name }, body: params, idempotent: true }, options);\n }\n /**\n * Send up to 100 messages with the same template in one request. Per-row partial-success: each row carries its own status (`accepted` | `rejected`).\n *\n * Two ways to make retries safe. An `Idempotency-Key` header covers the whole request: a retry with the same key and body within 24 h returns the first response (with `Idempotent-Replay: true`) and sends nothing. A per-row `idempotency_key` covers one message: a later batch, or a `/send`, that repeats a row key replays that row instead of sending it again. Both share one dedupe namespace, so the header key must differ from every row key (400 otherwise).\n *\n * @param name - Name of the template.\n * @param params - `Mail.TemplateSendBatchParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, IDEMPOTENCY_KEY_CONFLICTS_WITH_ROW: Validation failure (malformed body, batch too large), or the `Idempotency-Key` header equals a row `idempotency_key` (`IDEMPOTENCY_KEY_CONFLICTS_WITH_ROW`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Template not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different request body or on a different route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, from_domain_not_verified, domain_not_verified_by_provider: For any row: `from_domain_not_verified` (body `code`, `details: { fqdn, reason }`): the domain of the From address is not itself an active sending domain of this workspace — `reason: not_registered` (unknown, registered to another workspace, or only a subdomain such as `mail.example.com` is verified; a verified subdomain does not cover its parent) or `reason: not_verified` (registered, DNS not verified yet). Refused before anything is recorded or queued (the whole batch is refused); or `domain_not_verified_by_provider` (body `code`): the from-domain's DNS records have been broken for over 72 h (`health: failing`), so the email provider no longer sends for it. The whole batch is refused; no row is sent.\n * @throws {RateLimitError} 429 RATE_LIMITED: The workspace send limits (60 per minute, 600 per hour, 10,000 per day) never 429 a batch: a row over one is rejected in the 200 body with `RATE_LIMITED`, and the other rows are unaffected. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/templates/{name}/send-batch\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-templates-name-send-batch\n * @example\n * ```ts\n * const sendBatchOpenApi = await mail.templates.sendBatch(\"name\", {\n * messages: [\n * {\n * data: { code: \"A1B2C3\", name: \"Alice\" },\n * from: \"Acme <noreply@acme.com>\",\n * to: \"alice@example.com\",\n * },\n * ],\n * });\n * ```\n */\n sendBatch(name: string, params: T.TemplateSendBatchParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendBatchOpenApi>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/templates/{name}/send-batch\", pathParams: { name }, body: params, idempotent: true }, options);\n }\n /**\n * Send a test rendering of the template to an arbitrary recipient. Bypasses the suppression list and the ordinary send limits (test sends have their own: 30 per hour per workspace); subject is auto-prefixed with [TEST]; missing variables render as [varname] placeholders.\n *\n * @param name - Name of the template.\n * @param params - `Mail.TemplateTestSendParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: From-address domain is not registered to this workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Template not found in this workspace.\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Cannot test-send a layout/partial, or `IDEMPOTENCY_KEY_REUSE`: the `Idempotency-Key` was already used with a different body or route. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, from_domain_not_verified, domain_not_verified_by_provider: Invalid from address or render failure; or `from_domain_not_verified` (body `code`, `details: { fqdn, reason }`): the domain of the From address is not itself an active sending domain of this workspace — `reason: not_registered` (unknown, registered to another workspace, or only a subdomain such as `mail.example.com` is verified; a verified subdomain does not cover its parent) or `reason: not_verified` (registered, DNS not verified yet). Refused before anything is recorded or queued; or `domain_not_verified_by_provider` (body `code`): the from-domain's DNS records have been broken for over 72 h (`health: failing`), so the email provider no longer sends for it.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 30 test sends this hour in this workspace: `RATE_LIMITED` with `details: { window, limit, retry_after }`. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/templates/{name}/test-send\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-templates-name-test-send\n * @example\n * ```ts\n * const sendAccepted = await mail.templates.testSend(\"name\", { from: \"Acme <hello@acme.com>\", to: \"ada@example.com\" });\n * ```\n */\n testSend(name: string, params: T.TemplateTestSendParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.SendAccepted>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/templates/{name}/test-send\", pathParams: { name }, body: params, idempotent: true }, options);\n }\n}\n\n/** `topics` */\nexport class TopicsResource extends APIResource {\n /**\n * Create a topic\n *\n * Send on a topic with `topic_id` on a template send. Recipients manage their topics on the hosted unsubscribe page. At most 50 topics per workspace.\n *\n * @param params - `Mail.TopicCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, TOPIC_EXISTS, TOPIC_LIMIT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: A topic with this name exists (`TOPIC_EXISTS`), the workspace has 50 topics (`TOPIC_LIMIT`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/topics\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-topics\n * @example\n * ```ts\n * const topic = await mail.topics.create({ default_subscription: \"opt_in\", name: \"Product updates\" });\n * ```\n */\n create(params: T.TopicCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Topic>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/topics\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a topic\n *\n * Also deletes every contact's choice for it. Sends naming it are refused afterwards (`TOPIC_NOT_FOUND`).\n *\n * @param topicId - Id of the topic.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, TOPIC_NOT_FOUND: No such topic (`TOPIC_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/topics/{topic_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-topics-topic-id\n * @example\n * ```ts\n * await mail.topics.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(topicId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/topics/{topic_id}\", pathParams: { topic_id: topicId } }, options);\n }\n /**\n * List topics, newest first\n *\n * @param params - `Mail.TopicListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/topics\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-topics\n * @example\n * ```ts\n * for await (const topic of mail.topics.list()) {\n * console.log(topic);\n * }\n * const page = await mail.topics.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.TopicListParams, options?: RequestOptions): PagePromise<T.Topic> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/topics\", query: params }, options);\n }\n /**\n * Get a topic\n *\n * @param topicId - Id of the topic.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, TOPIC_NOT_FOUND: No such topic (`TOPIC_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/topics/{topic_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-topics-topic-id\n * @example\n * ```ts\n * const topic = await mail.topics.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(topicId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Topic>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/topics/{topic_id}\", pathParams: { topic_id: topicId } }, options);\n }\n /**\n * Update a topic\n *\n * `default_subscription` cannot change: flipping it would silently subscribe or unsubscribe everyone who never chose.\n *\n * @param topicId - Id of the topic.\n * @param params - `Mail.TopicUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, TOPIC_NOT_FOUND: No such topic (`TOPIC_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, TOPIC_EXISTS, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Another topic has this name (`TOPIC_EXISTS`), or `IDEMPOTENCY_KEY_REUSE`. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/topics/{topic_id}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-topics-topic-id\n * @example\n * ```ts\n * const topic = await mail.topics.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { description: \"string\" });\n * ```\n */\n update(topicId: string, params?: T.TopicUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.Topic>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/topics/{topic_id}\", pathParams: { topic_id: topicId }, body: params, idempotent: true }, options);\n }\n}\n\n/** `webhooks.attempts` */\nexport class WebhooksAttemptsResource extends APIResource {\n /**\n * Delivery attempts across all of this workspace's webhook endpoints, newest first, cursor-paginated, optionally for one event or one endpoint. Includes status code, latency, response body (truncated to 1KB), and error if any.\n *\n * @param params - `Mail.WebhookAttemptListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `limit`, `cursor`, `event_id` or `endpoint_id`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/webhooks/attempts\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-webhooks-attempts\n * @example\n * ```ts\n * for await (const attempt of mail.webhooks.attempts.list()) {\n * console.log(attempt);\n * }\n * const page = await mail.webhooks.attempts.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.WebhookAttemptListParams, options?: RequestOptions): PagePromise<T.OutboundWebhookAttempt> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/webhooks/attempts\", query: params }, options);\n }\n}\n\n/** `webhooks.endpoints` */\nexport class WebhooksEndpointsResource extends APIResource {\n /**\n * Add a webhook endpoint. Returns its signing secret once.\n *\n * Deliveries are signed with the Standard Webhooks headers `webhook-id`, `webhook-timestamp` and `webhook-signature` (`v1,<base64 HMAC-SHA256 of \"<id>.<timestamp>.<body>\">`); the returned `whsec_…` secret works unchanged with any Standard Webhooks library. Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h.\n *\n * @param params - `Mail.WebhookEndpointCreateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, WEBHOOK_EVENT_TYPE_UNKNOWN: Validation failure: URL not https with a public host, or an unknown event type (`WEBHOOK_EVENT_TYPE_UNKNOWN`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {ConflictError} 409 CONFLICT, WEBHOOK_ENDPOINT_LIMIT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Already 10 endpoints (`WEBHOOK_ENDPOINT_LIMIT`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: The URL points at a private, loopback or internal address.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/webhooks/endpoints\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-webhooks-endpoints\n * @example\n * ```ts\n * const webhookEndpointWithSecret = await mail.webhooks.endpoints.create({ url: \"https://api.acme.com/webhooks\" });\n * ```\n */\n create(params: T.WebhookEndpointCreateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WebhookEndpointWithSecret>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/webhooks/endpoints\", body: params, idempotent: true }, options);\n }\n /**\n * Delete a webhook endpoint.\n *\n * Queued retries are dropped. Its past attempts stay in the event log until the events expire.\n *\n * @param endpointId - Id of the endpoint.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `endpoint_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see DELETE /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}\n * @see https://productcraft.co/docs/mail/api-reference#delete-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id\n * @example\n * ```ts\n * await mail.webhooks.endpoints.delete(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n delete(endpointId: string, options?: RequestOptions): APIPromise<void> {\n return this._client.request({ method: \"DELETE\", path: \"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}\", pathParams: { endpoint_id: endpointId } }, options);\n }\n /**\n * List webhook endpoints, oldest first.\n *\n * At most 10, so this is always one page. Signing secrets are never returned here, only their last 4 characters.\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The scope id in the path is malformed.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/webhooks/endpoints\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-webhooks-endpoints\n * @example\n * ```ts\n * for await (const endpoint of mail.webhooks.endpoints.list()) {\n * console.log(endpoint);\n * }\n * ```\n */\n list(options?: RequestOptions): PagePromise<T.WebhookEndpoint> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/webhooks/endpoints\" }, options);\n }\n /**\n * Get one webhook endpoint (without its secret).\n *\n * The endpoint's URL, subscription, on/off state, failure streak and the last 4 characters of its signing secret. The full secret is only returned when the endpoint is created or its secret is rotated.\n *\n * @param endpointId - Id of the endpoint.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `endpoint_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id\n * @example\n * ```ts\n * const webhookEndpoint = await mail.webhooks.endpoints.retrieve(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\");\n * ```\n */\n retrieve(endpointId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WebhookEndpoint>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}\", pathParams: { endpoint_id: endpointId } }, options);\n }\n /**\n * Rotate the signing secret. The new one is returned once.\n *\n * For `grace_hours` (default 24) the previous secret keeps signing too: `webhook-signature` then lists one `v1,` signature per secret, so receivers can switch over without dropping a delivery.\n *\n * @param endpointId - Id of the endpoint.\n * @param params - `Mail.WebhookEndpointRotateSecretParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `grace_hours` out of range, or `endpoint_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/rotate-secret\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id-rotate-secret\n * @example\n * ```ts\n * const webhookEndpointWithSecret = await mail.webhooks.endpoints.rotateSecret(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { grace_hours: 24 });\n * ```\n */\n rotateSecret(endpointId: string, params?: T.WebhookEndpointRotateSecretParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WebhookEndpointWithSecret>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/rotate-secret\", pathParams: { endpoint_id: endpointId }, body: params, idempotent: true }, options);\n }\n /**\n * Send a test event to this endpoint now and return the result.\n *\n * Delivers the catalogue example of `event_type`, signed like any delivery, with `\"test\": true` in the body. Works while the endpoint is switched off or not subscribed to that type, is logged in the event log, and is never retried or counted toward an automatic disable. Waits up to 15 s for your receiver.\n *\n * @param endpointId - Id of the endpoint.\n * @param params - `Mail.WebhookEndpointTestParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `event_type`, or `endpoint_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/test\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id-test\n * @example\n * ```ts\n * const webhookDeliveryAttempt = await mail.webhooks.endpoints.test(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { event_type: \"email.sent\" });\n * ```\n */\n test(endpointId: string, params: T.WebhookEndpointTestParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WebhookDeliveryAttempt>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/test\", pathParams: { endpoint_id: endpointId }, body: params, idempotent: true }, options);\n }\n /**\n * Change a webhook endpoint: URL, description, events, on/off.\n *\n * Only the fields sent change. `enabled: true` (or a new URL) also clears an automatic disable. Switching off cancels queued retries. The secret is unchanged; rotate it with `POST …/rotate-secret`.\n *\n * @param endpointId - Id of the endpoint.\n * @param params - `Mail.WebhookEndpointUpdateParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure, or `endpoint_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY: The new URL points at a private, loopback or internal address.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see PATCH /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}\n * @see https://productcraft.co/docs/mail/api-reference#patch-v1-workspaces-workspace-id-webhooks-endpoints-endpoint-id\n * @example\n * ```ts\n * const webhookEndpoint = await mail.webhooks.endpoints.update(\"3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b\", { description: \"Production receiver\" });\n * ```\n */\n update(endpointId: string, params?: T.WebhookEndpointUpdateParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WebhookEndpoint>> {\n return this._client.request({ method: \"PATCH\", path: \"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}\", pathParams: { endpoint_id: endpointId }, body: params, idempotent: true }, options);\n }\n}\n\n/** `webhooks.eventTypes` */\nexport class WebhooksEventTypesResource extends APIResource {\n /**\n * List the events an endpoint can subscribe to.\n *\n * Each type with a plain description, its group and an example `data` object (what \"Send test\" delivers).\n *\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: A resource id in the path is not a UUID, or the request failed validation (`BAD_REQUEST` / `VALIDATION_ERROR`).\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/webhooks/event-types\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-webhooks-event-types\n * @example\n * ```ts\n * const listWebhookEventTypes = await mail.webhooks.eventTypes.list();\n * ```\n */\n list(options?: RequestOptions): APIPromise<T.WithLastResponse<T.ListWebhookEventTypes>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/webhooks/event-types\" }, options);\n }\n}\n\n/** `webhooks.events` */\nexport class WebhooksEventsResource extends APIResource {\n /**\n * List webhook events, newest first (kept for 30 days).\n *\n * Every event logged while at least one endpoint existed, with the latest state per endpoint and when the next retry is due.\n *\n * @param params - `Mail.WebhookEventListParams`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter value or cursor.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND: Workspace not found: no workspace has this `workspaceId`, or it is not a UUID (`NOT_FOUND`). A workspace the caller is not a member of answers 403. Routes that read a resource also answer 404 when the resource is missing.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/webhooks/events\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-webhooks-events\n * @example\n * ```ts\n * for await (const event of mail.webhooks.events.list()) {\n * console.log(event);\n * }\n * const page = await mail.webhooks.events.list({}, { timeout: 5_000 });\n * ```\n */\n list(params?: T.WebhookEventListParams, options?: RequestOptions): PagePromise<T.WebhookEvent> {\n return this._client.list({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/webhooks/events\", query: params }, options);\n }\n /**\n * Send a logged event again, to its endpoints or to one endpoint.\n *\n * Same body and `webhook-id`, freshly signed, to every switched-on endpoint that receives this event type now, or only to `endpoint_id`. Waits for the receivers (up to 15 s each) and returns the attempts. A success cancels a retry still queued for that endpoint.\n *\n * @param eventId - The event id, `evt_<uuid>`.\n * @param params - `Mail.WebhookEventReplayParams`.\n * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `event_id` is not `evt_<uuid>`, or `endpoint_id` is not a UUID.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_EVENT_NOT_FOUND, WEBHOOK_ENDPOINT_NOT_FOUND: No such event here (`WEBHOOK_EVENT_NOT_FOUND`); events are kept for 30 days. Or No such endpoint here (`WEBHOOK_ENDPOINT_NOT_FOUND`).\n * @throws {ConflictError} 409 CONFLICT, WEBHOOK_ENDPOINT_NOT_SUBSCRIBED, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `endpoint_id` is switched off or does not receive this event type (`WEBHOOK_ENDPOINT_NOT_SUBSCRIBED`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see POST /v1/workspaces/{workspace_id}/webhooks/events/{event_id}/replay\n * @see https://productcraft.co/docs/mail/api-reference#post-v1-workspaces-workspace-id-webhooks-events-event-id-replay\n * @example\n * ```ts\n * const replayWebhookEvent = await mail.webhooks.events.replay(\"event\");\n * ```\n */\n replay(eventId: string, params?: T.WebhookEventReplayParams, options?: RequestOptions): APIPromise<T.WithLastResponse<T.ReplayWebhookEvent>> {\n return this._client.request({ method: \"POST\", path: \"/v1/workspaces/{workspace_id}/webhooks/events/{event_id}/replay\", pathParams: { event_id: eventId }, query: params, idempotent: true }, options);\n }\n /**\n * Get one webhook event with every delivery attempt.\n *\n * The event as it was sent (`type`, `data`) and every delivery attempt to every endpoint, with its trigger, HTTP status, error and the start of the response body. Use it to debug a receiver, then `replay` to send it again.\n *\n * @param eventId - The event id, `evt_<uuid>`.\n * @param options - Per-request options.\n * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `event_id` is not `evt_<uuid>`.\n * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, expired or invalid bearer token.\n * @throws {PermissionDeniedError} 403 FORBIDDEN: The caller lacks the action this route requires on the resource, or Mail is not enabled for the workspace.\n * @throws {NotFoundError} 404 NOT_FOUND, WEBHOOK_EVENT_NOT_FOUND: No such event here (`WEBHOOK_EVENT_NOT_FOUND`); events are kept for 30 days.\n * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.\n * @see GET /v1/workspaces/{workspace_id}/webhooks/events/{event_id}\n * @see https://productcraft.co/docs/mail/api-reference#get-v1-workspaces-workspace-id-webhooks-events-event-id\n * @example\n * ```ts\n * const webhookEventDetail = await mail.webhooks.events.retrieve(\"event\");\n * ```\n */\n retrieve(eventId: string, options?: RequestOptions): APIPromise<T.WithLastResponse<T.WebhookEventDetail>> {\n return this._client.request({ method: \"GET\", path: \"/v1/workspaces/{workspace_id}/webhooks/events/{event_id}\", pathParams: { event_id: eventId } }, options);\n }\n}\n\n/** `webhooks` */\nexport class WebhooksResource extends APIResource {\n #attempts?: WebhooksAttemptsResource;\n #endpoints?: WebhooksEndpointsResource;\n #eventTypes?: WebhooksEventTypesResource;\n #events?: WebhooksEventsResource;\n get attempts(): WebhooksAttemptsResource {\n return (this.#attempts ??= new WebhooksAttemptsResource(this._client, this._b));\n }\n get endpoints(): WebhooksEndpointsResource {\n return (this.#endpoints ??= new WebhooksEndpointsResource(this._client, this._b));\n }\n get eventTypes(): WebhooksEventTypesResource {\n return (this.#eventTypes ??= new WebhooksEventTypesResource(this._client, this._b));\n }\n get events(): WebhooksEventsResource {\n return (this.#events ??= new WebhooksEventsResource(this._client, this._b));\n }\n /**\n * Verify a webhook's signature and parse it (Standard Webhooks, and the legacy `t=…,v1=…` scheme).\n *\n * @param params - The raw body, the request headers and optionally the secret.\n * @throws {WebhookVerificationError} The signature, timestamp or payload is invalid.\n * @throws {ConfigurationError} No secret was passed or configured.\n */\n unwrap(params: WebhookUnwrapParams): Promise<UnwrapWebhookEvent> {\n return this._client.unwrapWebhook<UnwrapWebhookEvent>(params, \"PRODUCTCRAFT_MAIL_WEBHOOK_SECRET\");\n }\n}\n\n/** `mail` */\nexport class MailResources extends APIResource {\n #brand?: BrandResource;\n #broadcasts?: BroadcastsResource;\n #contacts?: ContactsResource;\n #deliverability?: DeliverabilityResource;\n #domains?: DomainsResource;\n #emails?: EmailsResource;\n #integrations?: IntegrationsResource;\n #mailboxes?: MailboxesResource;\n #messages?: MessagesResource;\n #received?: ReceivedResource;\n #segments?: SegmentsResource;\n #sendingDefaults?: SendingDefaultsResource;\n #smtpConfig?: SmtpConfigResource;\n #stats?: StatsResource;\n #suppression?: SuppressionResource;\n #templates?: TemplatesResource;\n #topics?: TopicsResource;\n #webhooks?: WebhooksResource;\n get brand(): BrandResource {\n return (this.#brand ??= new BrandResource(this._client, this._b));\n }\n get broadcasts(): BroadcastsResource {\n return (this.#broadcasts ??= new BroadcastsResource(this._client, this._b));\n }\n get contacts(): ContactsResource {\n return (this.#contacts ??= new ContactsResource(this._client, this._b));\n }\n get deliverability(): DeliverabilityResource {\n return (this.#deliverability ??= new DeliverabilityResource(this._client, this._b));\n }\n get domains(): DomainsResource {\n return (this.#domains ??= new DomainsResource(this._client, this._b));\n }\n get emails(): EmailsResource {\n return (this.#emails ??= new EmailsResource(this._client, this._b));\n }\n get integrations(): IntegrationsResource {\n return (this.#integrations ??= new IntegrationsResource(this._client, this._b));\n }\n get mailboxes(): MailboxesResource {\n return (this.#mailboxes ??= new MailboxesResource(this._client, this._b));\n }\n get messages(): MessagesResource {\n return (this.#messages ??= new MessagesResource(this._client, this._b));\n }\n get received(): ReceivedResource {\n return (this.#received ??= new ReceivedResource(this._client, this._b));\n }\n get segments(): SegmentsResource {\n return (this.#segments ??= new SegmentsResource(this._client, this._b));\n }\n get sendingDefaults(): SendingDefaultsResource {\n return (this.#sendingDefaults ??= new SendingDefaultsResource(this._client, this._b));\n }\n get smtpConfig(): SmtpConfigResource {\n return (this.#smtpConfig ??= new SmtpConfigResource(this._client, this._b));\n }\n get stats(): StatsResource {\n return (this.#stats ??= new StatsResource(this._client, this._b));\n }\n get suppression(): SuppressionResource {\n return (this.#suppression ??= new SuppressionResource(this._client, this._b));\n }\n get templates(): TemplatesResource {\n return (this.#templates ??= new TemplatesResource(this._client, this._b));\n }\n get topics(): TopicsResource {\n return (this.#topics ??= new TopicsResource(this._client, this._b));\n }\n get webhooks(): WebhooksResource {\n return (this.#webhooks ??= new WebhooksResource(this._client, this._b));\n }\n}\n","// Generated by scripts/gen-sdk.mjs from Specs/mail.json. Do not edit.\n\nimport type { LastResponse } from \"@productcraft/core\";\nimport type { components, paths } from \"./paths.js\";\n\ntype IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;\ntype OpenString<T extends string> = string extends T ? T : true extends IsUnion<T> ? T | (string & {}) : T;\ntype OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ? Open<I>[] : T extends object ? { [K in keyof T]: Open<T[K]> } : T;\n/** A response type: string-literal unions also accept values added after this SDK was built. */\nexport type Open<T> = OpenValue<Exclude<T, null | undefined>> | Extract<T, null | undefined>;\n/** What a method resolves to: the parsed body plus non-enumerable `lastResponse`. */\nexport type WithLastResponse<T> = T & { readonly lastResponse: LastResponse };\n/** Params inside a scope bound with `.as(actorId)`: `actor_id` may be left out. */\nexport type WithOptionalActor<P> = P extends { actor_id: unknown } ? Omit<P, \"actor_id\"> & { actor_id?: P[\"actor_id\"] } : P;\n/** A polled model whose free-form `K` the caller types as `R` (`createAndPoll<R>`); optional and nullable stay as declared. */\nexport type WithResult<M, K extends keyof M, R> = Omit<M, K> & { [P in keyof M as P extends K ? P : never]: R | Extract<M[P], null> };\n\nexport type BounceSource = components[\"schemas\"][\"BounceSource\"];\nexport const BounceSource = { values: [\"relay\", \"ses\", \"mixed\", \"none\"] as const };\n\nexport type BounceType = components[\"schemas\"][\"BounceType\"];\nexport const BounceType = { values: [\"Permanent\", \"Transient\", \"Undetermined\"] as const };\n\nexport type BroadcastRecipientStatus = components[\"schemas\"][\"BroadcastRecipientStatus\"];\nexport const BroadcastRecipientStatus = { values: [\"pending\", \"sending\", \"sent\", \"skipped\", \"failed\", \"canceled\"] as const };\n\nexport type BroadcastStatus = components[\"schemas\"][\"BroadcastStatus\"];\nexport const BroadcastStatus = { values: [\"draft\", \"scheduled\", \"sending\", \"sent\", \"canceled\"] as const };\n\nexport type ContactCreatedVia = components[\"schemas\"][\"ContactCreatedVia\"];\nexport const ContactCreatedVia = { values: [\"api\", \"dashboard\", \"import\", \"unsubscribe\"] as const };\n\nexport type ContactImportConflictMode = components[\"schemas\"][\"ContactImportConflictMode\"];\nexport const ContactImportConflictMode = { values: [\"upsert\", \"skip\"] as const };\n\nexport type ContactImportStatus = components[\"schemas\"][\"ContactImportStatus\"];\nexport const ContactImportStatus = { values: [\"queued\", \"processing\", \"completed\", \"failed\"] as const };\n\nexport type ContactPropertyType = components[\"schemas\"][\"ContactPropertyType\"];\nexport const ContactPropertyType = { values: [\"string\", \"number\"] as const };\n\nexport type DeliverabilityVerdict = components[\"schemas\"][\"DeliverabilityVerdict\"];\nexport const DeliverabilityVerdict = { values: [\"no_data\", \"healthy\", \"unconfirmed\", \"degraded\", \"blocked\"] as const };\n\nexport type DmarcAlignmentMode = components[\"schemas\"][\"DmarcAlignmentMode\"];\nexport const DmarcAlignmentMode = { values: [\"r\", \"s\"] as const };\n\nexport type DmarcPolicy = components[\"schemas\"][\"DmarcPolicy\"];\nexport const DmarcPolicy = { values: [\"none\", \"quarantine\", \"reject\"] as const };\n\nexport type DmarcRecordLocation = components[\"schemas\"][\"DmarcRecordLocation\"];\nexport const DmarcRecordLocation = { values: [\"subdomain\", \"organizational\", \"none\"] as const };\n\nexport type DnsApplyAction = components[\"schemas\"][\"DnsApplyAction\"];\nexport const DnsApplyAction = { values: [\"create\", \"update\", \"skip\"] as const };\n\nexport type DnsApplyProvider = components[\"schemas\"][\"DnsApplyProvider\"];\nexport const DnsApplyProvider = { values: [\"cloudflare\", \"digitalocean\"] as const };\n\nexport type DnsApplyRecordResult = components[\"schemas\"][\"DnsApplyRecordResult\"];\nexport const DnsApplyRecordResult = { values: [\"created\", \"updated\", \"unchanged\", \"failed\"] as const };\n\nexport type DnsApplyWarning = components[\"schemas\"][\"DnsApplyWarning\"];\nexport const DnsApplyWarning = { values: [\"token_scope_broader_than_zone\", \"dmarc_lookup_failed\", \"partially_applied\"] as const };\n\nexport type DnsConflictCode = components[\"schemas\"][\"DnsConflictCode\"];\nexport const DnsConflictCode = { values: [\"spf_multiple\", \"spf_merge\", \"spf_lookup_limit\", \"cname_at_host\", \"mail_from_mx_multiple\", \"dmarc_duplicate\", \"dkim_selector_taken\", \"mx_foreign\"] as const };\n\nexport type DnsConflictSeverity = components[\"schemas\"][\"DnsConflictSeverity\"];\nexport const DnsConflictSeverity = { values: [\"blocking\", \"warning\"] as const };\n\nexport type DnsProviderId = components[\"schemas\"][\"DnsProviderId\"];\nexport const DnsProviderId = { values: [\"cloudflare\", \"digitalocean\", \"namecheap\", \"godaddy\", \"squarespace\", \"route53\", \"porkbun\", \"vercel\", \"netlify\", \"gandi\", \"hover\", \"other\"] as const };\n\nexport type DnsProviderLookupSource = components[\"schemas\"][\"DnsProviderLookupSource\"];\nexport const DnsProviderLookupSource = { values: [\"ns\", \"domain_connect\"] as const };\n\nexport type DnsProviderSource = components[\"schemas\"][\"DnsProviderSource\"];\nexport const DnsProviderSource = { values: [\"user\", \"detected\"] as const };\n\nexport type DnsRecordPurpose = components[\"schemas\"][\"DnsRecordPurpose\"];\nexport const DnsRecordPurpose = { values: [\"dkim\", \"mx\", \"verification\", \"spf\", \"mail_from_mx\", \"mail_from_spf\", \"dmarc\"] as const };\n\nexport type DnsRecordState = components[\"schemas\"][\"DnsRecordState\"];\nexport const DnsRecordState = { values: [\"missing\", \"mismatch\", \"conflict\", \"propagating\", \"verified\"] as const };\n\nexport type DnsRecordType = components[\"schemas\"][\"DnsRecordType\"];\nexport const DnsRecordType = { values: [\"TXT\", \"MX\"] as const };\n\nexport type DomainCapabilityState = components[\"schemas\"][\"DomainCapabilityState\"];\nexport const DomainCapabilityState = { values: [\"enabled\", \"disabled\"] as const };\n\nexport type DomainConnectUnavailableReason = components[\"schemas\"][\"DomainConnectUnavailableReason\"];\nexport const DomainConnectUnavailableReason = { values: [\"no_record\", \"settings_unreachable\", \"template_not_onboarded\", \"lookup_failed\", \"disabled\"] as const };\n\nexport type DomainEventType = components[\"schemas\"][\"DomainEventType\"];\nexport const DomainEventType = { values: [\"added\", \"records_found\", \"verified\", \"degraded\", \"failing\", \"recovered\", \"mail_from_verified\", \"dmarc_detected\", \"check_failed\", \"deleted\"] as const };\n\nexport type DomainHealth = components[\"schemas\"][\"DomainHealth\"];\nexport const DomainHealth = { values: [\"ok\", \"degraded\", \"failing\"] as const };\n\nexport type DomainIntent = components[\"schemas\"][\"DomainIntent\"];\nexport const DomainIntent = { values: [\"receive\", \"send\", \"both\"] as const };\n\nexport type DomainRecordKind = components[\"schemas\"][\"DomainRecordKind\"];\nexport const DomainRecordKind = { values: [\"DKIM\", \"SPF\", \"MX\", \"DMARC\", \"Verification\"] as const };\n\nexport type DomainRecordStatus = components[\"schemas\"][\"DomainRecordStatus\"];\nexport const DomainRecordStatus = { values: [\"not_started\", \"pending\", \"verified\", \"failed\", \"temporary_failure\"] as const };\n\nexport type DomainSetupMethod = components[\"schemas\"][\"DomainSetupMethod\"];\nexport const DomainSetupMethod = { values: [\"manual\", \"domain_connect\", \"provider_api\"] as const };\n\nexport type DomainStatus = components[\"schemas\"][\"DomainStatus\"];\nexport const DomainStatus = { values: [\"pending\", \"active\", \"disabled\"] as const };\n\nexport type DomainTlsMode = components[\"schemas\"][\"DomainTlsMode\"];\nexport const DomainTlsMode = { values: [\"opportunistic\"] as const };\n\nexport type DomainVerificationStatus = components[\"schemas\"][\"DomainVerificationStatus\"];\nexport const DomainVerificationStatus = { values: [\"not_started\", \"pending\", \"partially_verified\", \"verified\", \"temporary_failure\", \"failed\", \"disabled\"] as const };\n\nexport type EmailMetricsGranularity = components[\"schemas\"][\"EmailMetricsGranularity\"];\nexport const EmailMetricsGranularity = { values: [\"hourly\", \"daily\"] as const };\n\nexport type EmailMetricsObject = components[\"schemas\"][\"EmailMetricsObject\"];\nexport const EmailMetricsObject = { values: [\"metrics\"] as const };\n\nexport type IntegrationStatus = components[\"schemas\"][\"IntegrationStatus\"];\nexport const IntegrationStatus = { values: [\"active\", \"error\", \"revoked\"] as const };\n\nexport type IntegrationSyncState = components[\"schemas\"][\"IntegrationSyncState\"];\nexport const IntegrationSyncState = { values: [\"running\", \"completed\", \"failed\"] as const };\n\nexport type LintSeverity = components[\"schemas\"][\"LintSeverity\"];\nexport const LintSeverity = { values: [\"error\", \"warn\", \"info\"] as const };\n\nexport type MailboxStatus = components[\"schemas\"][\"MailboxStatus\"];\nexport const MailboxStatus = { values: [\"active\", \"disabled\"] as const };\n\nexport type MessageEventType = components[\"schemas\"][\"MessageEventType\"];\nexport const MessageEventType = { values: [\"queued\", \"sent\", \"delivered\", \"deferred\", \"bounced\", \"complained\", \"failed\", \"suppressed\"] as const };\n\nexport type MessageSource = components[\"schemas\"][\"MessageSource\"];\nexport const MessageSource = { values: [\"api_key\", \"dashboard\", \"platform\", \"test_send\"] as const };\n\nexport type MessageStatus = components[\"schemas\"][\"MessageStatus\"];\nexport const MessageStatus = { values: [\"queued\", \"sent\", \"delivered\", \"bounced\", \"complained\", \"failed\", \"suppressed\", \"deferred\"] as const };\n\nexport type MessageTransport = components[\"schemas\"][\"MessageTransport\"];\nexport const MessageTransport = { values: [\"smtp\", \"ses\"] as const };\n\nexport type SegmentMatch = components[\"schemas\"][\"SegmentMatch\"];\nexport const SegmentMatch = { values: [\"all\", \"any\"] as const };\n\nexport type SegmentOperator = components[\"schemas\"][\"SegmentOperator\"];\nexport const SegmentOperator = { values: [\"equals\", \"contains\", \"exists\"] as const };\n\nexport type SegmentType = components[\"schemas\"][\"SegmentType\"];\nexport const SegmentType = { values: [\"static\", \"rule\"] as const };\n\nexport type SendBatchRowState = components[\"schemas\"][\"SendBatchRowState\"];\nexport const SendBatchRowState = { values: [\"accepted\", \"rejected\"] as const };\n\nexport type SenderDomainStatus = components[\"schemas\"][\"SenderDomainStatus\"];\nexport const SenderDomainStatus = { values: [\"not_started\", \"pending\", \"partially_verified\", \"verified\", \"temporary_failure\", \"failed\", \"disabled\", \"deleted\", \"not_found\"] as const };\n\nexport type SesDkimStatus = components[\"schemas\"][\"SesDkimStatus\"];\nexport const SesDkimStatus = { values: [\"PENDING\", \"SUCCESS\", \"FAILED\", \"TEMPORARY_FAILURE\", \"NOT_STARTED\", \"not_enabled\"] as const };\n\nexport type SesMailFromStatus = components[\"schemas\"][\"SesMailFromStatus\"];\nexport const SesMailFromStatus = { values: [\"PENDING\", \"SUCCESS\", \"FAILED\", \"TEMPORARY_FAILURE\"] as const };\n\nexport type ShareLinkStatus = components[\"schemas\"][\"ShareLinkStatus\"];\nexport const ShareLinkStatus = { values: [\"active\", \"expired\", \"revoked\"] as const };\n\nexport type SmtpConfigStatus = components[\"schemas\"][\"SmtpConfigStatus\"];\nexport const SmtpConfigStatus = { values: [\"pending\", \"active\", \"failed\"] as const };\n\nexport type SpamVerdict = components[\"schemas\"][\"SpamVerdict\"];\nexport const SpamVerdict = { values: [\"ham\", \"junk\", \"reject\"] as const };\n\nexport type StatsGranularity = components[\"schemas\"][\"StatsGranularity\"];\nexport const StatsGranularity = { values: [\"day\"] as const };\n\nexport type StatsSeriesMetric = components[\"schemas\"][\"StatsSeriesMetric\"];\nexport const StatsSeriesMetric = { values: [\"sent\"] as const };\n\nexport type StatsWindow = components[\"schemas\"][\"StatsWindow\"];\nexport const StatsWindow = { values: [\"1d\", \"7d\", \"30d\"] as const };\n\nexport type Subscription = components[\"schemas\"][\"Subscription\"];\nexport const Subscription = { values: [\"opt_in\", \"opt_out\"] as const };\n\nexport type SubscriptionReason = components[\"schemas\"][\"SubscriptionReason\"];\nexport const SubscriptionReason = { values: [\"opted_in\", \"default_with_consent\", \"unsubscribed\", \"opted_out\", \"no_consent\", \"not_opted_in\"] as const };\n\nexport type SuppressionSource = components[\"schemas\"][\"SuppressionSource\"];\nexport const SuppressionSource = { values: [\"manual\", \"bounce\", \"complaint\"] as const };\n\nexport type TemplateKind = components[\"schemas\"][\"TemplateKind\"];\nexport const TemplateKind = { values: [\"template\", \"layout\", \"partial\"] as const };\n\nexport type TemplateSource = components[\"schemas\"][\"TemplateSource\"];\nexport const TemplateSource = { values: [\"manual\", \"github\"] as const };\n\nexport type TimelineMetric = components[\"schemas\"][\"TimelineMetric\"];\nexport const TimelineMetric = { values: [\"sent\", \"bounced\"] as const };\n\nexport type TopicVisibility = components[\"schemas\"][\"TopicVisibility\"];\nexport const TopicVisibility = { values: [\"public\", \"private\"] as const };\n\nexport type WebhookAttemptTrigger = components[\"schemas\"][\"WebhookAttemptTrigger\"];\nexport const WebhookAttemptTrigger = { values: [\"automatic\", \"replay\", \"test\"] as const };\n\nexport type WebhookEndpointDisabledReason = components[\"schemas\"][\"WebhookEndpointDisabledReason\"];\nexport const WebhookEndpointDisabledReason = { values: [\"manual\", \"failing\"] as const };\n\nexport type WebhookEndpointLegacySlot = components[\"schemas\"][\"WebhookEndpointLegacySlot\"];\nexport const WebhookEndpointLegacySlot = { values: [\"default\", \"domain\"] as const };\n\nexport type WebhookEndpointStatus = components[\"schemas\"][\"WebhookEndpointStatus\"];\nexport const WebhookEndpointStatus = { values: [\"enabled\", \"disabled\", \"auto_disabled\"] as const };\n\nexport type WebhookEventStatus = components[\"schemas\"][\"WebhookEventStatus\"];\nexport const WebhookEventStatus = { values: [\"pending\", \"delivered\", \"failed\", \"not_sent\"] as const };\n\n/**\n * Every event type this product sends; `x-webhooks` maps each to its payload schema. New types can be added, so treat it as open.\n */\nexport type WebhookEventType = components[\"schemas\"][\"WebhookEventType\"];\nexport const WebhookEventType = { values: [\"email.sent\", \"email.delivered\", \"email.delivery_delayed\", \"email.bounced\", \"email.complained\", \"email.failed\", \"email.suppressed\", \"email.skipped\", \"email.scheduled\", \"email.canceled\", \"email.opened\", \"email.clicked\", \"email.received\", \"domain.created\", \"domain.updated\", \"domain.verified\", \"domain.deleted\", \"suppression.added\", \"suppression.removed\", \"sending_defaults.updated\", \"contact.created\", \"contact.updated\", \"contact.deleted\"] as const };\n\nexport type Brand = Open<components[\"schemas\"][\"BrandResponseDto\"]>;\nexport type BroadcastAudience = Open<components[\"schemas\"][\"BroadcastAudienceDto\"]>;\nexport type BroadcastCounts = Open<components[\"schemas\"][\"BroadcastCountsDto\"]>;\nexport type Broadcast = Open<components[\"schemas\"][\"BroadcastDto\"]>;\nexport type BroadcastRecipient = Open<components[\"schemas\"][\"BroadcastRecipientDto\"]>;\nexport type BroadcastSettings = Open<components[\"schemas\"][\"BroadcastSettingsDto\"]>;\nexport type ClickedLink = Open<components[\"schemas\"][\"ClickedLinkDto\"]>;\nexport type ClickedLinks = Open<components[\"schemas\"][\"ClickedLinksResponseDto\"]>;\nexport type ConnectGitHub = Open<components[\"schemas\"][\"ConnectGitHubResponseDto\"]>;\nexport type ContactDeletedEventData = Open<components[\"schemas\"][\"ContactDeletedEventDataDto\"]>;\nexport type Contact = Open<components[\"schemas\"][\"ContactDto\"]>;\nexport type ContactEventData = Open<components[\"schemas\"][\"ContactEventDataDto\"]>;\nexport type ContactImport = Open<components[\"schemas\"][\"ContactImportDto\"]>;\nexport type ContactImportError = Open<components[\"schemas\"][\"ContactImportErrorDto\"]>;\nexport type ContactProperty = Open<components[\"schemas\"][\"ContactPropertyDto\"]>;\nexport type ContactSegments = Open<components[\"schemas\"][\"ContactSegmentsResponseDto\"]>;\nexport type ContactTopic = Open<components[\"schemas\"][\"ContactTopicDto\"]>;\nexport type ContactTopics = Open<components[\"schemas\"][\"ContactTopicsResponseDto\"]>;\nexport type CreatedShareLink = Open<components[\"schemas\"][\"CreatedShareLinkDto\"]>;\nexport type DefaultSender = Open<components[\"schemas\"][\"DefaultSenderDto\"]>;\nexport type DefaultSenderSkippedSends = Open<components[\"schemas\"][\"DefaultSenderSkippedSendsDto\"]>;\nexport type DeleteByRecipient = Open<components[\"schemas\"][\"DeleteByRecipientResponseDto\"]>;\nexport type DeliverabilityBlockSignal = Open<components[\"schemas\"][\"DeliverabilityBlockSignalDto\"]>;\nexport type DeliverabilityDomain = Open<components[\"schemas\"][\"DeliverabilityDomainDto\"]>;\nexport type Deliverability = Open<components[\"schemas\"][\"DeliverabilityDto\"]>;\nexport type DmarcGrade = Open<components[\"schemas\"][\"DmarcGradeDto\"]>;\nexport type DnsApplyConflict = Open<components[\"schemas\"][\"DnsApplyConflictDto\"]>;\nexport type DnsApplyCounts = Open<components[\"schemas\"][\"DnsApplyCountsDto\"]>;\nexport type DnsApplyPlanItem = Open<components[\"schemas\"][\"DnsApplyPlanItemDto\"]>;\nexport type DnsApplyResult = Open<components[\"schemas\"][\"DnsApplyResultDto\"]>;\nexport type DnsInstruction = Open<components[\"schemas\"][\"DnsInstructionDto\"]>;\nexport type DnsRecordConflict = Open<components[\"schemas\"][\"DnsRecordConflictDto\"]>;\nexport type DnsRecordStatus = Open<components[\"schemas\"][\"DnsRecordStatusDto\"]>;\nexport type DomainCapabilities = Open<components[\"schemas\"][\"DomainCapabilitiesDto\"]>;\nexport type DomainConnectStart = Open<components[\"schemas\"][\"DomainConnectStartDto\"]>;\nexport type DomainCreatedEventData = Open<components[\"schemas\"][\"DomainCreatedEventDataDto\"]>;\nexport type DomainDeletedEventData = Open<components[\"schemas\"][\"DomainDeletedEventDataDto\"]>;\nexport type DomainDetail = Open<components[\"schemas\"][\"DomainDetailDto\"]>;\nexport type DomainDnsProvider = Open<components[\"schemas\"][\"DomainDnsProviderDto\"]>;\nexport type DomainDnsRecords = Open<components[\"schemas\"][\"DomainDnsRecordsDto\"]>;\nexport type Domain = Open<components[\"schemas\"][\"DomainDto\"]>;\nexport type DomainEvent = Open<components[\"schemas\"][\"DomainEventDto\"]>;\nexport type DomainLookup = Open<components[\"schemas\"][\"DomainLookupDto\"]>;\nexport type DomainRecordChange = Open<components[\"schemas\"][\"DomainRecordChangeDto\"]>;\nexport type DomainRecord = Open<components[\"schemas\"][\"DomainRecordDto\"]>;\nexport type DomainSesStatus = Open<components[\"schemas\"][\"DomainSesStatusDto\"]>;\nexport type DomainUpdatedEventData = Open<components[\"schemas\"][\"DomainUpdatedEventDataDto\"]>;\nexport type DomainVerifiedEventData = Open<components[\"schemas\"][\"DomainVerifiedEventDataDto\"]>;\nexport type EmailBouncedEventData = Open<components[\"schemas\"][\"EmailBouncedEventDataDto\"]>;\nexport type EmailCanceledEventData = Open<components[\"schemas\"][\"EmailCanceledEventDataDto\"]>;\nexport type EmailClickedEventData = Open<components[\"schemas\"][\"EmailClickedEventDataDto\"]>;\nexport type EmailComplainedEventData = Open<components[\"schemas\"][\"EmailComplainedEventDataDto\"]>;\nexport type EmailDeliveredEventData = Open<components[\"schemas\"][\"EmailDeliveredEventDataDto\"]>;\nexport type EmailDeliveryDelayedEventData = Open<components[\"schemas\"][\"EmailDeliveryDelayedEventDataDto\"]>;\nexport type EmailDetail = Open<components[\"schemas\"][\"EmailDetailDto\"]>;\nexport type Email = Open<components[\"schemas\"][\"EmailDto\"]>;\nexport type EmailFailedEventData = Open<components[\"schemas\"][\"EmailFailedEventDataDto\"]>;\nexport type EmailMessageSummary = Open<components[\"schemas\"][\"EmailMessageSummaryDto\"]>;\nexport type EmailMetricsCounters = Open<components[\"schemas\"][\"EmailMetricsCountersDto\"]>;\nexport type EmailMetricsDataItem = Open<components[\"schemas\"][\"EmailMetricsDataItemDto\"]>;\nexport type EmailMetricsMeasured = Open<components[\"schemas\"][\"EmailMetricsMeasuredDto\"]>;\nexport type EmailMetrics = Open<components[\"schemas\"][\"EmailMetricsResponseDto\"]>;\nexport type EmailOpenedEventData = Open<components[\"schemas\"][\"EmailOpenedEventDataDto\"]>;\nexport type EmailPagination = Open<components[\"schemas\"][\"EmailPaginationDto\"]>;\nexport type EmailReceivedEventData = Open<components[\"schemas\"][\"EmailReceivedEventDataDto\"]>;\nexport type EmailScheduledEventData = Open<components[\"schemas\"][\"EmailScheduledEventDataDto\"]>;\nexport type EmailSentEventData = Open<components[\"schemas\"][\"EmailSentEventDataDto\"]>;\nexport type EmailSkippedEventData = Open<components[\"schemas\"][\"EmailSkippedEventDataDto\"]>;\nexport type EmailSuppressedEventData = Open<components[\"schemas\"][\"EmailSuppressedEventDataDto\"]>;\nexport type EmailTag = Open<components[\"schemas\"][\"EmailTagDto\"]>;\nexport type GetSmtpConfig = Open<components[\"schemas\"][\"GetSmtpConfigResponseDto\"]>;\nexport type GitHubBranch = Open<components[\"schemas\"][\"GitHubBranchDto\"]>;\nexport type GitHubRepo = Open<components[\"schemas\"][\"GitHubRepoDto\"]>;\nexport type IntegrationDetail = Open<components[\"schemas\"][\"IntegrationDetailDto\"]>;\nexport type IntegrationListItem = Open<components[\"schemas\"][\"IntegrationListItemDto\"]>;\nexport type LintFinding = Open<components[\"schemas\"][\"LintFindingDto\"]>;\nexport type LintResult = Open<components[\"schemas\"][\"LintResultDto\"]>;\nexport type ListBroadcastRecipients = Open<components[\"schemas\"][\"ListBroadcastRecipientsResponseDto\"]>;\nexport type ListBroadcasts = Open<components[\"schemas\"][\"ListBroadcastsResponseDto\"]>;\nexport type ListContactImports = Open<components[\"schemas\"][\"ListContactImportsResponseDto\"]>;\nexport type ListContactProperties = Open<components[\"schemas\"][\"ListContactPropertiesResponseDto\"]>;\nexport type ListContacts = Open<components[\"schemas\"][\"ListContactsResponseDto\"]>;\nexport type ListDomainEvents = Open<components[\"schemas\"][\"ListDomainEventsResponseDto\"]>;\nexport type ListDomains = Open<components[\"schemas\"][\"ListDomainsResponseDto\"]>;\nexport type ListEmails = Open<components[\"schemas\"][\"ListEmailsResponseDto\"]>;\nexport type ListIntegrations = Open<components[\"schemas\"][\"ListIntegrationsResponseDto\"]>;\nexport type ListMailboxes = Open<components[\"schemas\"][\"ListMailboxesResponseDto\"]>;\nexport type ListMessages = Open<components[\"schemas\"][\"ListMessagesResponseDto\"]>;\nexport type ListOutboundMessages = Open<components[\"schemas\"][\"ListOutboundMessagesResponseDto\"]>;\nexport type ListReceivedEmails = Open<components[\"schemas\"][\"ListReceivedEmailsResponseDto\"]>;\nexport type ListSegmentContacts = Open<components[\"schemas\"][\"ListSegmentContactsResponseDto\"]>;\nexport type ListSegments = Open<components[\"schemas\"][\"ListSegmentsResponseDto\"]>;\nexport type ListShareLinks = Open<components[\"schemas\"][\"ListShareLinksResponseDto\"]>;\nexport type ListSmtpConfigs = Open<components[\"schemas\"][\"ListSmtpConfigsResponseDto\"]>;\nexport type ListSuppression = Open<components[\"schemas\"][\"ListSuppressionResponseDto\"]>;\nexport type ListTemplateTags = Open<components[\"schemas\"][\"ListTemplateTagsResponseDto\"]>;\nexport type ListTemplates = Open<components[\"schemas\"][\"ListTemplatesResponseDto\"]>;\nexport type ListTopics = Open<components[\"schemas\"][\"ListTopicsResponseDto\"]>;\nexport type ListWebhookAttempts = Open<components[\"schemas\"][\"ListWebhookAttemptsResponseDto\"]>;\nexport type ListWebhookEndpoints = Open<components[\"schemas\"][\"ListWebhookEndpointsResponseDto\"]>;\nexport type ListWebhookEventTypes = Open<components[\"schemas\"][\"ListWebhookEventTypesResponseDto\"]>;\nexport type ListWebhookEvents = Open<components[\"schemas\"][\"ListWebhookEventsResponseDto\"]>;\nexport type LookupDmarc = Open<components[\"schemas\"][\"LookupDmarcDto\"]>;\nexport type LookupDomainConnect = Open<components[\"schemas\"][\"LookupDomainConnectDto\"]>;\nexport type LookupExisting = Open<components[\"schemas\"][\"LookupExistingDto\"]>;\nexport type LookupProvider = Open<components[\"schemas\"][\"LookupProviderDto\"]>;\nexport type LookupSpf = Open<components[\"schemas\"][\"LookupSpfDto\"]>;\nexport type LookupSuggestion = Open<components[\"schemas\"][\"LookupSuggestionDto\"]>;\nexport type MailStatsInWindow = Open<components[\"schemas\"][\"MailStatsInWindowDto\"]>;\nexport type MailStatsSeries = Open<components[\"schemas\"][\"MailStatsSeriesDto\"]>;\nexport type MailStatsTotals = Open<components[\"schemas\"][\"MailStatsTotalsDto\"]>;\nexport type MailWorkspaceStats = Open<components[\"schemas\"][\"MailWorkspaceStatsDto\"]>;\nexport type Mailbox = Open<components[\"schemas\"][\"MailboxDto\"]>;\nexport type MessageAttachment = Open<components[\"schemas\"][\"MessageAttachmentDto\"]>;\nexport type MessageDetail = Open<components[\"schemas\"][\"MessageDetailDto\"]>;\nexport type Message = Open<components[\"schemas\"][\"MessageDto\"]>;\nexport type MessageEvent = Open<components[\"schemas\"][\"MessageEventDto\"]>;\nexport type MessageTimeline = Open<components[\"schemas\"][\"MessageTimelineResponseDto\"]>;\nexport type OutboundMessageDetail = Open<components[\"schemas\"][\"OutboundMessageDetailDto\"]>;\nexport type OutboundMessage = Open<components[\"schemas\"][\"OutboundMessageDto\"]>;\nexport type OutboundMessagePagination = Open<components[\"schemas\"][\"OutboundMessagePaginationDto\"]>;\nexport type OutboundMessageSettings = Open<components[\"schemas\"][\"OutboundMessageSettingsDto\"]>;\nexport type OutboundMessageWithBody = Open<components[\"schemas\"][\"OutboundMessageWithBodyDto\"]>;\nexport type OutboundWebhookAttempt = Open<components[\"schemas\"][\"OutboundWebhookAttemptDto\"]>;\nexport type Pagination = Open<components[\"schemas\"][\"PaginationDto\"]>;\nexport type RawBrand = Open<components[\"schemas\"][\"RawBrandDto\"]>;\nexport type ReceivedEmailAttachment = Open<components[\"schemas\"][\"ReceivedEmailAttachmentDto\"]>;\nexport type ReceivedEmailDetail = Open<components[\"schemas\"][\"ReceivedEmailDetailDto\"]>;\nexport type ReceivedEmail = Open<components[\"schemas\"][\"ReceivedEmailDto\"]>;\nexport type RenderedMessage = Open<components[\"schemas\"][\"RenderedMessageDto\"]>;\nexport type ReplayWebhookEvent = Open<components[\"schemas\"][\"ReplayWebhookEventResponseDto\"]>;\nexport type ResolvedBrandTokens = Open<components[\"schemas\"][\"ResolvedBrandTokensDto\"]>;\nexport type SegmentCondition = Open<components[\"schemas\"][\"SegmentConditionDto\"]>;\nexport type Segment = Open<components[\"schemas\"][\"SegmentDto\"]>;\nexport type SegmentMembership = Open<components[\"schemas\"][\"SegmentMembershipDto\"]>;\nexport type SegmentMetrics = Open<components[\"schemas\"][\"SegmentMetricsDto\"]>;\nexport type SegmentPreview = Open<components[\"schemas\"][\"SegmentPreviewDto\"]>;\nexport type SegmentRule = Open<components[\"schemas\"][\"SegmentRuleDto\"]>;\nexport type SendAccepted = Open<components[\"schemas\"][\"SendAcceptedDto\"]>;\nexport type SendBatchOpenApi = Open<components[\"schemas\"][\"SendBatchOpenApiResponseDto\"]>;\nexport type SendBatchRowError = Open<components[\"schemas\"][\"SendBatchRowErrorDto\"]>;\nexport type SendBatchRowStatus = Open<components[\"schemas\"][\"SendBatchRowStatusDto\"]>;\nexport type SendBatchSummary = Open<components[\"schemas\"][\"SendBatchSummaryDto\"]>;\nexport type SendEmail = Open<components[\"schemas\"][\"SendEmailResponseDto\"]>;\nexport type SendingDefaults = Open<components[\"schemas\"][\"SendingDefaultsDto\"]>;\nexport type SendingDefaultsEventSender = Open<components[\"schemas\"][\"SendingDefaultsEventSenderDto\"]>;\nexport type SendingDefaultsUpdatedEventData = Open<components[\"schemas\"][\"SendingDefaultsUpdatedEventDataDto\"]>;\nexport type ShareLink = Open<components[\"schemas\"][\"ShareLinkDto\"]>;\nexport type SmtpConfig = Open<components[\"schemas\"][\"SmtpConfigDto\"]>;\nexport type SmtpVerifyError = Open<components[\"schemas\"][\"SmtpVerifyErrorDto\"]>;\nexport type SmtpVerifyResult = Open<components[\"schemas\"][\"SmtpVerifyResultDto\"]>;\nexport type StartSync = Open<components[\"schemas\"][\"StartSyncResponseDto\"]>;\nexport type StatsSeriesPoint = Open<components[\"schemas\"][\"StatsSeriesPointDto\"]>;\nexport type SuppressionAddedEventData = Open<components[\"schemas\"][\"SuppressionAddedEventDataDto\"]>;\nexport type SuppressionEntry = Open<components[\"schemas\"][\"SuppressionEntryDto\"]>;\nexport type SuppressionRemovedEventData = Open<components[\"schemas\"][\"SuppressionRemovedEventDataDto\"]>;\nexport type SyncStatus = Open<components[\"schemas\"][\"SyncStatusDto\"]>;\nexport type Template = Open<components[\"schemas\"][\"TemplateDto\"]>;\nexport type TemplateVariables = Open<components[\"schemas\"][\"TemplateVariablesResponseDto\"]>;\nexport type TimelinePoint = Open<components[\"schemas\"][\"TimelinePointDto\"]>;\nexport type Topic = Open<components[\"schemas\"][\"TopicDto\"]>;\nexport type WebhookDeliveryAttempt = Open<components[\"schemas\"][\"WebhookDeliveryAttemptDto\"]>;\nexport type WebhookEndpoint = Open<components[\"schemas\"][\"WebhookEndpointDto\"]>;\nexport type WebhookEndpointWithSecret = Open<components[\"schemas\"][\"WebhookEndpointWithSecretDto\"]>;\nexport type WebhookEventDelivery = Open<components[\"schemas\"][\"WebhookEventDeliveryDto\"]>;\nexport type WebhookEventDetail = Open<components[\"schemas\"][\"WebhookEventDetailDto\"]>;\nexport type WebhookEvent = Open<components[\"schemas\"][\"WebhookEventDto\"]>;\nexport type WebhookEventTypeInfo = Open<components[\"schemas\"][\"WebhookEventTypeDto\"]>;\nexport type WebhookPagination = Open<components[\"schemas\"][\"WebhookPaginationDto\"]>;\n\n/** Params for `brand.update` (PUT /v1/workspaces/{workspace_id}/brand). */\nexport type BrandUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/brand\"][\"put\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `broadcasts.settings.update` (PUT /v1/workspaces/{workspace_id}/broadcast-settings). */\nexport type BroadcastSettingsUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/broadcast-settings\"][\"put\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `broadcasts.list` (GET /v1/workspaces/{workspace_id}/broadcasts). */\nexport type BroadcastListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/broadcasts\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `broadcasts.create` (POST /v1/workspaces/{workspace_id}/broadcasts). */\nexport type BroadcastCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/broadcasts\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `broadcasts.audience` (GET /v1/workspaces/{workspace_id}/broadcasts/audience). */\nexport type BroadcastAudienceParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/broadcasts/audience\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `broadcasts.update` (PATCH /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}). */\nexport type BroadcastUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `broadcasts.recipients.list` (GET /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/recipients). */\nexport type BroadcastRecipientListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/recipients\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `broadcasts.send` (POST /v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/send). */\nexport type BroadcastSendParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/broadcasts/{broadcast_id}/send\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `contacts.properties.list` (GET /v1/workspaces/{workspace_id}/contact-properties). */\nexport type ContactPropertyListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contact-properties\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `contacts.properties.create` (POST /v1/workspaces/{workspace_id}/contact-properties). */\nexport type ContactPropertyCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contact-properties\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `contacts.properties.update` (PATCH /v1/workspaces/{workspace_id}/contact-properties/{property_id}). */\nexport type ContactPropertyUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contact-properties/{property_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `contacts.list` (GET /v1/workspaces/{workspace_id}/contacts). */\nexport type ContactListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contacts\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `contacts.create` (POST /v1/workspaces/{workspace_id}/contacts). */\nexport type ContactCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contacts\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `contacts.imports.list` (GET /v1/workspaces/{workspace_id}/contacts/imports). */\nexport type ContactImportListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contacts/imports\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `contacts.imports.create` (POST /v1/workspaces/{workspace_id}/contacts/imports). */\nexport type ContactImportCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contacts/imports\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `contacts.update` (PATCH /v1/workspaces/{workspace_id}/contacts/{contact}). */\nexport type ContactUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contacts/{contact}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `contacts.topics.update` (PATCH /v1/workspaces/{workspace_id}/contacts/{contact}/topics). */\nexport type ContactTopicUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/contacts/{contact}/topics\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `deliverability.retrieve` (GET /v1/workspaces/{workspace_id}/deliverability). */\nexport type DeliverabilityRetrieveParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/deliverability\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.list` (GET /v1/workspaces/{workspace_id}/domains). */\nexport type DomainListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.create` (POST /v1/workspaces/{workspace_id}/domains). */\nexport type DomainCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `domains.lookup` (GET /v1/workspaces/{workspace_id}/domains/lookup). */\nexport type DomainLookupParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/lookup\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.update` (PATCH /v1/workspaces/{workspace_id}/domains/{domain_id}). */\nexport type DomainUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `domains.dnsRecords.list` (GET /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records). */\nexport type DomainDnsRecordListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.dnsRecords.apply` (POST /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/apply). */\nexport type DomainDnsRecordApplyParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/apply\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `domains.dnsRecords.check` (POST /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/check). */\nexport type DomainDnsRecordCheckParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/check\"][\"post\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.dnsRecords.export` (GET /v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/export). */\nexport type DomainDnsRecordExportParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/dns-records/export\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.domainConnect.start` (POST /v1/workspaces/{workspace_id}/domains/{domain_id}/domain-connect/start). */\nexport type DomainDomainConnectStartParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/domain-connect/start\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `domains.events.list` (GET /v1/workspaces/{workspace_id}/domains/{domain_id}/events). */\nexport type DomainEventListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/events\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.shareLinks.list` (GET /v1/workspaces/{workspace_id}/domains/{domain_id}/share-links). */\nexport type DomainShareLinkListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/share-links\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `domains.shareLinks.create` (POST /v1/workspaces/{workspace_id}/domains/{domain_id}/share-links). */\nexport type DomainShareLinkCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/share-links\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `domains.smtpConfig.update` (PUT /v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config). */\nexport type DomainSmtpConfigUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/smtp-config\"][\"put\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `domains.testSend` (POST /v1/workspaces/{workspace_id}/domains/{domain_id}/test-send). */\nexport type DomainTestSendParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/domains/{domain_id}/test-send\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `emails.list` (GET /v1/workspaces/{workspace_id}/emails). */\nexport type EmailListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/emails\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `emails.send` (POST /v1/workspaces/{workspace_id}/emails). */\nexport type EmailSendParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/emails\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `emails.batch` (POST /v1/workspaces/{workspace_id}/emails/batch). */\nexport type EmailBatchParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/emails/batch\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `emails.metrics` (GET /v1/workspaces/{workspace_id}/emails/metrics). */\nexport type EmailMetricsParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/emails/metrics\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `integrations.github.connect` (POST /v1/workspaces/{workspace_id}/integrations/github/connect). */\nexport type IntegrationGithubConnectParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/integrations/github/connect\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Response of `integrations.github.repos.list`. */\nexport type IntegrationGithubRepoListResponse = Open<paths[\"/v1/workspaces/{workspace_id}/integrations/github/repos\"][\"get\"][\"responses\"][200][\"content\"][\"application/json\"]>;\n/** Response of `integrations.github.repos.branches.list`. */\nexport type IntegrationGithubRepoBranchListResponse = Open<paths[\"/v1/workspaces/{workspace_id}/integrations/github/repos/{owner}/{repo}/branches\"][\"get\"][\"responses\"][200][\"content\"][\"application/json\"]>;\n/** Params for `integrations.github.settings.update` (PUT /v1/workspaces/{workspace_id}/integrations/github/settings). */\nexport type IntegrationGithubSettingsUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/integrations/github/settings\"][\"put\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `mailboxes.list` (GET /v1/workspaces/{workspace_id}/mailboxes). */\nexport type MailboxListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/mailboxes\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `mailboxes.create` (POST /v1/workspaces/{workspace_id}/mailboxes). */\nexport type MailboxCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/mailboxes\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `mailboxes.update` (PATCH /v1/workspaces/{workspace_id}/mailboxes/{id}). */\nexport type MailboxUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/mailboxes/{id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `mailboxes.messages.list` (GET /v1/workspaces/{workspace_id}/mailboxes/{id}/messages). */\nexport type MailboxMessageListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/mailboxes/{id}/messages\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `messages.list` (GET /v1/workspaces/{workspace_id}/messages). */\nexport type MessageListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/messages\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `messages.erase` (DELETE /v1/workspaces/{workspace_id}/messages). */\nexport type MessageEraseParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/messages\"][\"delete\"][\"parameters\"][\"query\"]>;\n/** Params for `messages.export` (GET /v1/workspaces/{workspace_id}/messages/export). */\nexport type MessageExportParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/messages/export\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `messages.settings.update` (PATCH /v1/workspaces/{workspace_id}/messages/settings). */\nexport type MessageSettingsUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/messages/settings\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `messages.timeline` (GET /v1/workspaces/{workspace_id}/messages/timeline). */\nexport type MessageTimelineParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/messages/timeline\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `received.list` (GET /v1/workspaces/{workspace_id}/received). */\nexport type ReceivedListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/received\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `received.export` (GET /v1/workspaces/{workspace_id}/received/export). */\nexport type ReceivedExportParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/received/export\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `segments.list` (GET /v1/workspaces/{workspace_id}/segments). */\nexport type SegmentListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/segments\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `segments.create` (POST /v1/workspaces/{workspace_id}/segments). */\nexport type SegmentCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/segments\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `segments.preview` (POST /v1/workspaces/{workspace_id}/segments/preview). */\nexport type SegmentPreviewParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/segments/preview\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `segments.update` (PATCH /v1/workspaces/{workspace_id}/segments/{segment_id}). */\nexport type SegmentUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/segments/{segment_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `segments.contacts.list` (GET /v1/workspaces/{workspace_id}/segments/{segment_id}/contacts). */\nexport type SegmentContactListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/segments/{segment_id}/contacts\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `sendingDefaults.update` (PUT /v1/workspaces/{workspace_id}/sending-defaults). */\nexport type SendingDefaultUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/sending-defaults\"][\"put\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `smtpConfig.update` (PUT /v1/workspaces/{workspace_id}/smtp-config). */\nexport type SmtpConfigUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/smtp-config\"][\"put\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `smtpConfig.verify` (POST /v1/workspaces/{workspace_id}/smtp-config/verify). */\nexport type SmtpConfigVerifyParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/smtp-config/verify\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `stats.retrieve` (GET /v1/workspaces/{workspace_id}/stats). */\nexport type StatsRetrieveParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/stats\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `suppression.list` (GET /v1/workspaces/{workspace_id}/suppression). */\nexport type SuppressionListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/suppression\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `suppression.create` (POST /v1/workspaces/{workspace_id}/suppression). */\nexport type SuppressionCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/suppression\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `templates.list` (GET /v1/workspaces/{workspace_id}/templates). */\nexport type TemplateListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `templates.create` (POST /v1/workspaces/{workspace_id}/templates). */\nexport type TemplateCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `templates.lint` (POST /v1/workspaces/{workspace_id}/templates/lint). */\nexport type TemplateLintParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates/lint\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `templates.preview` (POST /v1/workspaces/{workspace_id}/templates/preview). */\nexport type TemplatePreviewParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates/preview\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `templates.render` (POST /v1/workspaces/{workspace_id}/templates/{name}/render). */\nexport type TemplateRenderParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates/{name}/render\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `templates.send` (POST /v1/workspaces/{workspace_id}/templates/{name}/send). */\nexport type TemplateSendParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates/{name}/send\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `templates.sendBatch` (POST /v1/workspaces/{workspace_id}/templates/{name}/send-batch). */\nexport type TemplateSendBatchParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates/{name}/send-batch\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `templates.testSend` (POST /v1/workspaces/{workspace_id}/templates/{name}/test-send). */\nexport type TemplateTestSendParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/templates/{name}/test-send\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `topics.list` (GET /v1/workspaces/{workspace_id}/topics). */\nexport type TopicListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/topics\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `topics.create` (POST /v1/workspaces/{workspace_id}/topics). */\nexport type TopicCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/topics\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `topics.update` (PATCH /v1/workspaces/{workspace_id}/topics/{topic_id}). */\nexport type TopicUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/topics/{topic_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `webhooks.attempts.list` (GET /v1/workspaces/{workspace_id}/webhooks/attempts). */\nexport type WebhookAttemptListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/webhooks/attempts\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `webhooks.endpoints.create` (POST /v1/workspaces/{workspace_id}/webhooks/endpoints). */\nexport type WebhookEndpointCreateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/webhooks/endpoints\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `webhooks.endpoints.update` (PATCH /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}). */\nexport type WebhookEndpointUpdateParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}\"][\"patch\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `webhooks.endpoints.rotateSecret` (POST /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/rotate-secret). */\nexport type WebhookEndpointRotateSecretParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/rotate-secret\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `webhooks.endpoints.test` (POST /v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/test). */\nexport type WebhookEndpointTestParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/webhooks/endpoints/{endpoint_id}/test\"][\"post\"][\"requestBody\"]>[\"content\"][\"application/json\"];\n/** Params for `webhooks.events.list` (GET /v1/workspaces/{workspace_id}/webhooks/events). */\nexport type WebhookEventListParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/webhooks/events\"][\"get\"][\"parameters\"][\"query\"]>;\n/** Params for `webhooks.events.replay` (POST /v1/workspaces/{workspace_id}/webhooks/events/{event_id}/replay). */\nexport type WebhookEventReplayParams = NonNullable<paths[\"/v1/workspaces/{workspace_id}/webhooks/events/{event_id}/replay\"][\"post\"][\"parameters\"][\"query\"]>;\n","// Generated by scripts/gen-sdk.mjs from Specs/mail.json. Do not edit.\n\nimport { APIClient, createOpenAPIClient, PC_BASE_URL, type ClientOptions, type PollOptions as CorePollOptions, type RequestOptions as CoreRequestOptions } from \"@productcraft/core\";\nimport type { Client } from \"openapi-fetch\";\nimport type * as E from \"./errors.js\";\nimport type { paths } from \"./paths.js\";\nimport { MailResources } from \"./resources.js\";\nimport * as T from \"./types.js\";\nimport type * as W from \"./webhooks.js\";\n\ndeclare const __PC_SDK_VERSION__: string | undefined;\nconst VERSION = typeof __PC_SDK_VERSION__ === \"string\" ? __PC_SDK_VERSION__ : \"0.0.0-dev\";\n\n/**\n * ProductCraft Mail API client (transactional email, templates, domains, contacts and broadcasts). Every method is generated from the API's OpenAPI document.\n *\n * @example\n * ```ts\n * import { Mail } from \"@productcraft/mail\";\n * const mail = new Mail({ apiKey: process.env.PRODUCTCRAFT_API_KEY });\n * ```\n */\n\nexport class Mail extends MailResources {\n #openapi?: Client<paths>;\n constructor(options: ClientOptions = {}) {\n super(new APIClient(options, PC_BASE_URL.mail, { name: \"mail\", version: VERSION }));\n }\n /** The typed `openapi-fetch` escape hatch over the same credential and base URL. It does not retry. */\n get client(): Client<paths> {\n return (this.#openapi ??= createOpenAPIClient<paths>(this._client));\n }\n}\n\ntype __RequestOptions = CoreRequestOptions;\ntype __PollOptions = CorePollOptions;\ntype __BounceSource = T.BounceSource;\ntype __BounceType = T.BounceType;\ntype __BroadcastRecipientStatus = T.BroadcastRecipientStatus;\ntype __BroadcastStatus = T.BroadcastStatus;\ntype __ContactCreatedVia = T.ContactCreatedVia;\ntype __ContactImportConflictMode = T.ContactImportConflictMode;\ntype __ContactImportStatus = T.ContactImportStatus;\ntype __ContactPropertyType = T.ContactPropertyType;\ntype __DeliverabilityVerdict = T.DeliverabilityVerdict;\ntype __DmarcAlignmentMode = T.DmarcAlignmentMode;\ntype __DmarcPolicy = T.DmarcPolicy;\ntype __DmarcRecordLocation = T.DmarcRecordLocation;\ntype __DnsApplyAction = T.DnsApplyAction;\ntype __DnsApplyProvider = T.DnsApplyProvider;\ntype __DnsApplyRecordResult = T.DnsApplyRecordResult;\ntype __DnsApplyWarning = T.DnsApplyWarning;\ntype __DnsConflictCode = T.DnsConflictCode;\ntype __DnsConflictSeverity = T.DnsConflictSeverity;\ntype __DnsProviderId = T.DnsProviderId;\ntype __DnsProviderLookupSource = T.DnsProviderLookupSource;\ntype __DnsProviderSource = T.DnsProviderSource;\ntype __DnsRecordPurpose = T.DnsRecordPurpose;\ntype __DnsRecordState = T.DnsRecordState;\ntype __DnsRecordType = T.DnsRecordType;\ntype __DomainCapabilityState = T.DomainCapabilityState;\ntype __DomainConnectUnavailableReason = T.DomainConnectUnavailableReason;\ntype __DomainEventType = T.DomainEventType;\ntype __DomainHealth = T.DomainHealth;\ntype __DomainIntent = T.DomainIntent;\ntype __DomainRecordKind = T.DomainRecordKind;\ntype __DomainRecordStatus = T.DomainRecordStatus;\ntype __DomainSetupMethod = T.DomainSetupMethod;\ntype __DomainStatus = T.DomainStatus;\ntype __DomainTlsMode = T.DomainTlsMode;\ntype __DomainVerificationStatus = T.DomainVerificationStatus;\ntype __EmailMetricsGranularity = T.EmailMetricsGranularity;\ntype __EmailMetricsObject = T.EmailMetricsObject;\ntype __IntegrationStatus = T.IntegrationStatus;\ntype __IntegrationSyncState = T.IntegrationSyncState;\ntype __LintSeverity = T.LintSeverity;\ntype __MailboxStatus = T.MailboxStatus;\ntype __MessageEventType = T.MessageEventType;\ntype __MessageSource = T.MessageSource;\ntype __MessageStatus = T.MessageStatus;\ntype __MessageTransport = T.MessageTransport;\ntype __SegmentMatch = T.SegmentMatch;\ntype __SegmentOperator = T.SegmentOperator;\ntype __SegmentType = T.SegmentType;\ntype __SendBatchRowState = T.SendBatchRowState;\ntype __SenderDomainStatus = T.SenderDomainStatus;\ntype __SesDkimStatus = T.SesDkimStatus;\ntype __SesMailFromStatus = T.SesMailFromStatus;\ntype __ShareLinkStatus = T.ShareLinkStatus;\ntype __SmtpConfigStatus = T.SmtpConfigStatus;\ntype __SpamVerdict = T.SpamVerdict;\ntype __StatsGranularity = T.StatsGranularity;\ntype __StatsSeriesMetric = T.StatsSeriesMetric;\ntype __StatsWindow = T.StatsWindow;\ntype __Subscription = T.Subscription;\ntype __SubscriptionReason = T.SubscriptionReason;\ntype __SuppressionSource = T.SuppressionSource;\ntype __TemplateKind = T.TemplateKind;\ntype __TemplateSource = T.TemplateSource;\ntype __TimelineMetric = T.TimelineMetric;\ntype __TopicVisibility = T.TopicVisibility;\ntype __WebhookAttemptTrigger = T.WebhookAttemptTrigger;\ntype __WebhookEndpointDisabledReason = T.WebhookEndpointDisabledReason;\ntype __WebhookEndpointLegacySlot = T.WebhookEndpointLegacySlot;\ntype __WebhookEndpointStatus = T.WebhookEndpointStatus;\ntype __WebhookEventStatus = T.WebhookEventStatus;\ntype __WebhookEventType = T.WebhookEventType;\ntype __Brand = T.Brand;\ntype __BroadcastAudience = T.BroadcastAudience;\ntype __BroadcastCounts = T.BroadcastCounts;\ntype __Broadcast = T.Broadcast;\ntype __BroadcastRecipient = T.BroadcastRecipient;\ntype __BroadcastSettings = T.BroadcastSettings;\ntype __ClickedLink = T.ClickedLink;\ntype __ClickedLinks = T.ClickedLinks;\ntype __ConnectGitHub = T.ConnectGitHub;\ntype __ContactDeletedEventData = T.ContactDeletedEventData;\ntype __Contact = T.Contact;\ntype __ContactEventData = T.ContactEventData;\ntype __ContactImport = T.ContactImport;\ntype __ContactImportError = T.ContactImportError;\ntype __ContactProperty = T.ContactProperty;\ntype __ContactSegments = T.ContactSegments;\ntype __ContactTopic = T.ContactTopic;\ntype __ContactTopics = T.ContactTopics;\ntype __CreatedShareLink = T.CreatedShareLink;\ntype __DefaultSender = T.DefaultSender;\ntype __DefaultSenderSkippedSends = T.DefaultSenderSkippedSends;\ntype __DeleteByRecipient = T.DeleteByRecipient;\ntype __DeliverabilityBlockSignal = T.DeliverabilityBlockSignal;\ntype __DeliverabilityDomain = T.DeliverabilityDomain;\ntype __Deliverability = T.Deliverability;\ntype __DmarcGrade = T.DmarcGrade;\ntype __DnsApplyConflict = T.DnsApplyConflict;\ntype __DnsApplyCounts = T.DnsApplyCounts;\ntype __DnsApplyPlanItem = T.DnsApplyPlanItem;\ntype __DnsApplyResult = T.DnsApplyResult;\ntype __DnsInstruction = T.DnsInstruction;\ntype __DnsRecordConflict = T.DnsRecordConflict;\ntype __DnsRecordStatus = T.DnsRecordStatus;\ntype __DomainCapabilities = T.DomainCapabilities;\ntype __DomainConnectStart = T.DomainConnectStart;\ntype __DomainCreatedEventData = T.DomainCreatedEventData;\ntype __DomainDeletedEventData = T.DomainDeletedEventData;\ntype __DomainDetail = T.DomainDetail;\ntype __DomainDnsProvider = T.DomainDnsProvider;\ntype __DomainDnsRecords = T.DomainDnsRecords;\ntype __Domain = T.Domain;\ntype __DomainEvent = T.DomainEvent;\ntype __DomainLookup = T.DomainLookup;\ntype __DomainRecordChange = T.DomainRecordChange;\ntype __DomainRecord = T.DomainRecord;\ntype __DomainSesStatus = T.DomainSesStatus;\ntype __DomainUpdatedEventData = T.DomainUpdatedEventData;\ntype __DomainVerifiedEventData = T.DomainVerifiedEventData;\ntype __EmailBouncedEventData = T.EmailBouncedEventData;\ntype __EmailCanceledEventData = T.EmailCanceledEventData;\ntype __EmailClickedEventData = T.EmailClickedEventData;\ntype __EmailComplainedEventData = T.EmailComplainedEventData;\ntype __EmailDeliveredEventData = T.EmailDeliveredEventData;\ntype __EmailDeliveryDelayedEventData = T.EmailDeliveryDelayedEventData;\ntype __EmailDetail = T.EmailDetail;\ntype __Email = T.Email;\ntype __EmailFailedEventData = T.EmailFailedEventData;\ntype __EmailMessageSummary = T.EmailMessageSummary;\ntype __EmailMetricsCounters = T.EmailMetricsCounters;\ntype __EmailMetricsDataItem = T.EmailMetricsDataItem;\ntype __EmailMetricsMeasured = T.EmailMetricsMeasured;\ntype __EmailMetrics = T.EmailMetrics;\ntype __EmailOpenedEventData = T.EmailOpenedEventData;\ntype __EmailPagination = T.EmailPagination;\ntype __EmailReceivedEventData = T.EmailReceivedEventData;\ntype __EmailScheduledEventData = T.EmailScheduledEventData;\ntype __EmailSentEventData = T.EmailSentEventData;\ntype __EmailSkippedEventData = T.EmailSkippedEventData;\ntype __EmailSuppressedEventData = T.EmailSuppressedEventData;\ntype __EmailTag = T.EmailTag;\ntype __GetSmtpConfig = T.GetSmtpConfig;\ntype __GitHubBranch = T.GitHubBranch;\ntype __GitHubRepo = T.GitHubRepo;\ntype __IntegrationDetail = T.IntegrationDetail;\ntype __IntegrationListItem = T.IntegrationListItem;\ntype __LintFinding = T.LintFinding;\ntype __LintResult = T.LintResult;\ntype __ListBroadcastRecipients = T.ListBroadcastRecipients;\ntype __ListBroadcasts = T.ListBroadcasts;\ntype __ListContactImports = T.ListContactImports;\ntype __ListContactProperties = T.ListContactProperties;\ntype __ListContacts = T.ListContacts;\ntype __ListDomainEvents = T.ListDomainEvents;\ntype __ListDomains = T.ListDomains;\ntype __ListEmails = T.ListEmails;\ntype __ListIntegrations = T.ListIntegrations;\ntype __ListMailboxes = T.ListMailboxes;\ntype __ListMessages = T.ListMessages;\ntype __ListOutboundMessages = T.ListOutboundMessages;\ntype __ListReceivedEmails = T.ListReceivedEmails;\ntype __ListSegmentContacts = T.ListSegmentContacts;\ntype __ListSegments = T.ListSegments;\ntype __ListShareLinks = T.ListShareLinks;\ntype __ListSmtpConfigs = T.ListSmtpConfigs;\ntype __ListSuppression = T.ListSuppression;\ntype __ListTemplateTags = T.ListTemplateTags;\ntype __ListTemplates = T.ListTemplates;\ntype __ListTopics = T.ListTopics;\ntype __ListWebhookAttempts = T.ListWebhookAttempts;\ntype __ListWebhookEndpoints = T.ListWebhookEndpoints;\ntype __ListWebhookEventTypes = T.ListWebhookEventTypes;\ntype __ListWebhookEvents = T.ListWebhookEvents;\ntype __LookupDmarc = T.LookupDmarc;\ntype __LookupDomainConnect = T.LookupDomainConnect;\ntype __LookupExisting = T.LookupExisting;\ntype __LookupProvider = T.LookupProvider;\ntype __LookupSpf = T.LookupSpf;\ntype __LookupSuggestion = T.LookupSuggestion;\ntype __MailStatsInWindow = T.MailStatsInWindow;\ntype __MailStatsSeries = T.MailStatsSeries;\ntype __MailStatsTotals = T.MailStatsTotals;\ntype __MailWorkspaceStats = T.MailWorkspaceStats;\ntype __Mailbox = T.Mailbox;\ntype __MessageAttachment = T.MessageAttachment;\ntype __MessageDetail = T.MessageDetail;\ntype __Message = T.Message;\ntype __MessageEvent = T.MessageEvent;\ntype __MessageTimeline = T.MessageTimeline;\ntype __OutboundMessageDetail = T.OutboundMessageDetail;\ntype __OutboundMessage = T.OutboundMessage;\ntype __OutboundMessagePagination = T.OutboundMessagePagination;\ntype __OutboundMessageSettings = T.OutboundMessageSettings;\ntype __OutboundMessageWithBody = T.OutboundMessageWithBody;\ntype __OutboundWebhookAttempt = T.OutboundWebhookAttempt;\ntype __Pagination = T.Pagination;\ntype __RawBrand = T.RawBrand;\ntype __ReceivedEmailAttachment = T.ReceivedEmailAttachment;\ntype __ReceivedEmailDetail = T.ReceivedEmailDetail;\ntype __ReceivedEmail = T.ReceivedEmail;\ntype __RenderedMessage = T.RenderedMessage;\ntype __ReplayWebhookEvent = T.ReplayWebhookEvent;\ntype __ResolvedBrandTokens = T.ResolvedBrandTokens;\ntype __SegmentCondition = T.SegmentCondition;\ntype __Segment = T.Segment;\ntype __SegmentMembership = T.SegmentMembership;\ntype __SegmentMetrics = T.SegmentMetrics;\ntype __SegmentPreview = T.SegmentPreview;\ntype __SegmentRule = T.SegmentRule;\ntype __SendAccepted = T.SendAccepted;\ntype __SendBatchOpenApi = T.SendBatchOpenApi;\ntype __SendBatchRowError = T.SendBatchRowError;\ntype __SendBatchRowStatus = T.SendBatchRowStatus;\ntype __SendBatchSummary = T.SendBatchSummary;\ntype __SendEmail = T.SendEmail;\ntype __SendingDefaults = T.SendingDefaults;\ntype __SendingDefaultsEventSender = T.SendingDefaultsEventSender;\ntype __SendingDefaultsUpdatedEventData = T.SendingDefaultsUpdatedEventData;\ntype __ShareLink = T.ShareLink;\ntype __SmtpConfig = T.SmtpConfig;\ntype __SmtpVerifyError = T.SmtpVerifyError;\ntype __SmtpVerifyResult = T.SmtpVerifyResult;\ntype __StartSync = T.StartSync;\ntype __StatsSeriesPoint = T.StatsSeriesPoint;\ntype __SuppressionAddedEventData = T.SuppressionAddedEventData;\ntype __SuppressionEntry = T.SuppressionEntry;\ntype __SuppressionRemovedEventData = T.SuppressionRemovedEventData;\ntype __SyncStatus = T.SyncStatus;\ntype __Template = T.Template;\ntype __TemplateVariables = T.TemplateVariables;\ntype __TimelinePoint = T.TimelinePoint;\ntype __Topic = T.Topic;\ntype __WebhookDeliveryAttempt = T.WebhookDeliveryAttempt;\ntype __WebhookEndpoint = T.WebhookEndpoint;\ntype __WebhookEndpointWithSecret = T.WebhookEndpointWithSecret;\ntype __WebhookEventDelivery = T.WebhookEventDelivery;\ntype __WebhookEventDetail = T.WebhookEventDetail;\ntype __WebhookEvent = T.WebhookEvent;\ntype __WebhookEventTypeInfo = T.WebhookEventTypeInfo;\ntype __WebhookPagination = T.WebhookPagination;\ntype __BrandUpdateParams = T.BrandUpdateParams;\ntype __BroadcastSettingsUpdateParams = T.BroadcastSettingsUpdateParams;\ntype __BroadcastListParams = T.BroadcastListParams;\ntype __BroadcastCreateParams = T.BroadcastCreateParams;\ntype __BroadcastAudienceParams = T.BroadcastAudienceParams;\ntype __BroadcastUpdateParams = T.BroadcastUpdateParams;\ntype __BroadcastRecipientListParams = T.BroadcastRecipientListParams;\ntype __BroadcastSendParams = T.BroadcastSendParams;\ntype __ContactPropertyListParams = T.ContactPropertyListParams;\ntype __ContactPropertyCreateParams = T.ContactPropertyCreateParams;\ntype __ContactPropertyUpdateParams = T.ContactPropertyUpdateParams;\ntype __ContactListParams = T.ContactListParams;\ntype __ContactCreateParams = T.ContactCreateParams;\ntype __ContactImportListParams = T.ContactImportListParams;\ntype __ContactImportCreateParams = T.ContactImportCreateParams;\ntype __ContactUpdateParams = T.ContactUpdateParams;\ntype __ContactTopicUpdateParams = T.ContactTopicUpdateParams;\ntype __DeliverabilityRetrieveParams = T.DeliverabilityRetrieveParams;\ntype __DomainListParams = T.DomainListParams;\ntype __DomainCreateParams = T.DomainCreateParams;\ntype __DomainLookupParams = T.DomainLookupParams;\ntype __DomainUpdateParams = T.DomainUpdateParams;\ntype __DomainDnsRecordListParams = T.DomainDnsRecordListParams;\ntype __DomainDnsRecordApplyParams = T.DomainDnsRecordApplyParams;\ntype __DomainDnsRecordCheckParams = T.DomainDnsRecordCheckParams;\ntype __DomainDnsRecordExportParams = T.DomainDnsRecordExportParams;\ntype __DomainDomainConnectStartParams = T.DomainDomainConnectStartParams;\ntype __DomainEventListParams = T.DomainEventListParams;\ntype __DomainShareLinkListParams = T.DomainShareLinkListParams;\ntype __DomainShareLinkCreateParams = T.DomainShareLinkCreateParams;\ntype __DomainSmtpConfigUpdateParams = T.DomainSmtpConfigUpdateParams;\ntype __DomainTestSendParams = T.DomainTestSendParams;\ntype __EmailListParams = T.EmailListParams;\ntype __EmailSendParams = T.EmailSendParams;\ntype __EmailBatchParams = T.EmailBatchParams;\ntype __EmailMetricsParams = T.EmailMetricsParams;\ntype __IntegrationGithubConnectParams = T.IntegrationGithubConnectParams;\ntype __IntegrationGithubRepoListResponse = T.IntegrationGithubRepoListResponse;\ntype __IntegrationGithubRepoBranchListResponse = T.IntegrationGithubRepoBranchListResponse;\ntype __IntegrationGithubSettingsUpdateParams = T.IntegrationGithubSettingsUpdateParams;\ntype __MailboxListParams = T.MailboxListParams;\ntype __MailboxCreateParams = T.MailboxCreateParams;\ntype __MailboxUpdateParams = T.MailboxUpdateParams;\ntype __MailboxMessageListParams = T.MailboxMessageListParams;\ntype __MessageListParams = T.MessageListParams;\ntype __MessageEraseParams = T.MessageEraseParams;\ntype __MessageExportParams = T.MessageExportParams;\ntype __MessageSettingsUpdateParams = T.MessageSettingsUpdateParams;\ntype __MessageTimelineParams = T.MessageTimelineParams;\ntype __ReceivedListParams = T.ReceivedListParams;\ntype __ReceivedExportParams = T.ReceivedExportParams;\ntype __SegmentListParams = T.SegmentListParams;\ntype __SegmentCreateParams = T.SegmentCreateParams;\ntype __SegmentPreviewParams = T.SegmentPreviewParams;\ntype __SegmentUpdateParams = T.SegmentUpdateParams;\ntype __SegmentContactListParams = T.SegmentContactListParams;\ntype __SendingDefaultUpdateParams = T.SendingDefaultUpdateParams;\ntype __SmtpConfigUpdateParams = T.SmtpConfigUpdateParams;\ntype __SmtpConfigVerifyParams = T.SmtpConfigVerifyParams;\ntype __StatsRetrieveParams = T.StatsRetrieveParams;\ntype __SuppressionListParams = T.SuppressionListParams;\ntype __SuppressionCreateParams = T.SuppressionCreateParams;\ntype __TemplateListParams = T.TemplateListParams;\ntype __TemplateCreateParams = T.TemplateCreateParams;\ntype __TemplateLintParams = T.TemplateLintParams;\ntype __TemplatePreviewParams = T.TemplatePreviewParams;\ntype __TemplateRenderParams = T.TemplateRenderParams;\ntype __TemplateSendParams = T.TemplateSendParams;\ntype __TemplateSendBatchParams = T.TemplateSendBatchParams;\ntype __TemplateTestSendParams = T.TemplateTestSendParams;\ntype __TopicListParams = T.TopicListParams;\ntype __TopicCreateParams = T.TopicCreateParams;\ntype __TopicUpdateParams = T.TopicUpdateParams;\ntype __WebhookAttemptListParams = T.WebhookAttemptListParams;\ntype __WebhookEndpointCreateParams = T.WebhookEndpointCreateParams;\ntype __WebhookEndpointUpdateParams = T.WebhookEndpointUpdateParams;\ntype __WebhookEndpointRotateSecretParams = T.WebhookEndpointRotateSecretParams;\ntype __WebhookEndpointTestParams = T.WebhookEndpointTestParams;\ntype __WebhookEventListParams = T.WebhookEventListParams;\ntype __WebhookEventReplayParams = T.WebhookEventReplayParams;\ntype __ErrorCode = E.MailErrorCode;\ntype __ContactCreatedEvent = W.ContactCreatedEvent;\ntype __ContactDeletedEvent = W.ContactDeletedEvent;\ntype __ContactUpdatedEvent = W.ContactUpdatedEvent;\ntype __DomainCreatedEvent = W.DomainCreatedEvent;\ntype __DomainDeletedEvent = W.DomainDeletedEvent;\ntype __DomainUpdatedEvent = W.DomainUpdatedEvent;\ntype __DomainVerifiedEvent = W.DomainVerifiedEvent;\ntype __EmailBouncedEvent = W.EmailBouncedEvent;\ntype __EmailCanceledEvent = W.EmailCanceledEvent;\ntype __EmailClickedEvent = W.EmailClickedEvent;\ntype __EmailComplainedEvent = W.EmailComplainedEvent;\ntype __EmailDeliveredEvent = W.EmailDeliveredEvent;\ntype __EmailDeliveryDelayedEvent = W.EmailDeliveryDelayedEvent;\ntype __EmailFailedEvent = W.EmailFailedEvent;\ntype __EmailOpenedEvent = W.EmailOpenedEvent;\ntype __EmailReceivedEvent = W.EmailReceivedEvent;\ntype __EmailScheduledEvent = W.EmailScheduledEvent;\ntype __EmailSentEvent = W.EmailSentEvent;\ntype __EmailSkippedEvent = W.EmailSkippedEvent;\ntype __EmailSuppressedEvent = W.EmailSuppressedEvent;\ntype __SendingDefaultsUpdatedEvent = W.SendingDefaultsUpdatedEvent;\ntype __SuppressionAddedEvent = W.SuppressionAddedEvent;\ntype __SuppressionRemovedEvent = W.SuppressionRemovedEvent;\ntype __UnknownWebhookEvent = W.UnknownWebhookEvent;\ntype __UnwrapWebhookEvent = W.UnwrapWebhookEvent;\ntype __WebhookUnwrapParams = W.WebhookUnwrapParams;\n/** Public types: `Mail.Brand`, `Mail.BrandUpdateParams`, … */\nexport namespace Mail {\n export type RequestOptions = __RequestOptions;\n export type PollOptions = __PollOptions;\n export type BounceSource = __BounceSource;\n export const BounceSource = T.BounceSource;\n export type BounceType = __BounceType;\n export const BounceType = T.BounceType;\n export type BroadcastRecipientStatus = __BroadcastRecipientStatus;\n export const BroadcastRecipientStatus = T.BroadcastRecipientStatus;\n export type BroadcastStatus = __BroadcastStatus;\n export const BroadcastStatus = T.BroadcastStatus;\n export type ContactCreatedVia = __ContactCreatedVia;\n export const ContactCreatedVia = T.ContactCreatedVia;\n export type ContactImportConflictMode = __ContactImportConflictMode;\n export const ContactImportConflictMode = T.ContactImportConflictMode;\n export type ContactImportStatus = __ContactImportStatus;\n export const ContactImportStatus = T.ContactImportStatus;\n export type ContactPropertyType = __ContactPropertyType;\n export const ContactPropertyType = T.ContactPropertyType;\n export type DeliverabilityVerdict = __DeliverabilityVerdict;\n export const DeliverabilityVerdict = T.DeliverabilityVerdict;\n export type DmarcAlignmentMode = __DmarcAlignmentMode;\n export const DmarcAlignmentMode = T.DmarcAlignmentMode;\n export type DmarcPolicy = __DmarcPolicy;\n export const DmarcPolicy = T.DmarcPolicy;\n export type DmarcRecordLocation = __DmarcRecordLocation;\n export const DmarcRecordLocation = T.DmarcRecordLocation;\n export type DnsApplyAction = __DnsApplyAction;\n export const DnsApplyAction = T.DnsApplyAction;\n export type DnsApplyProvider = __DnsApplyProvider;\n export const DnsApplyProvider = T.DnsApplyProvider;\n export type DnsApplyRecordResult = __DnsApplyRecordResult;\n export const DnsApplyRecordResult = T.DnsApplyRecordResult;\n export type DnsApplyWarning = __DnsApplyWarning;\n export const DnsApplyWarning = T.DnsApplyWarning;\n export type DnsConflictCode = __DnsConflictCode;\n export const DnsConflictCode = T.DnsConflictCode;\n export type DnsConflictSeverity = __DnsConflictSeverity;\n export const DnsConflictSeverity = T.DnsConflictSeverity;\n export type DnsProviderId = __DnsProviderId;\n export const DnsProviderId = T.DnsProviderId;\n export type DnsProviderLookupSource = __DnsProviderLookupSource;\n export const DnsProviderLookupSource = T.DnsProviderLookupSource;\n export type DnsProviderSource = __DnsProviderSource;\n export const DnsProviderSource = T.DnsProviderSource;\n export type DnsRecordPurpose = __DnsRecordPurpose;\n export const DnsRecordPurpose = T.DnsRecordPurpose;\n export type DnsRecordState = __DnsRecordState;\n export const DnsRecordState = T.DnsRecordState;\n export type DnsRecordType = __DnsRecordType;\n export const DnsRecordType = T.DnsRecordType;\n export type DomainCapabilityState = __DomainCapabilityState;\n export const DomainCapabilityState = T.DomainCapabilityState;\n export type DomainConnectUnavailableReason = __DomainConnectUnavailableReason;\n export const DomainConnectUnavailableReason = T.DomainConnectUnavailableReason;\n export type DomainEventType = __DomainEventType;\n export const DomainEventType = T.DomainEventType;\n export type DomainHealth = __DomainHealth;\n export const DomainHealth = T.DomainHealth;\n export type DomainIntent = __DomainIntent;\n export const DomainIntent = T.DomainIntent;\n export type DomainRecordKind = __DomainRecordKind;\n export const DomainRecordKind = T.DomainRecordKind;\n export type DomainRecordStatus = __DomainRecordStatus;\n export const DomainRecordStatus = T.DomainRecordStatus;\n export type DomainSetupMethod = __DomainSetupMethod;\n export const DomainSetupMethod = T.DomainSetupMethod;\n export type DomainStatus = __DomainStatus;\n export const DomainStatus = T.DomainStatus;\n export type DomainTlsMode = __DomainTlsMode;\n export const DomainTlsMode = T.DomainTlsMode;\n export type DomainVerificationStatus = __DomainVerificationStatus;\n export const DomainVerificationStatus = T.DomainVerificationStatus;\n export type EmailMetricsGranularity = __EmailMetricsGranularity;\n export const EmailMetricsGranularity = T.EmailMetricsGranularity;\n export type EmailMetricsObject = __EmailMetricsObject;\n export const EmailMetricsObject = T.EmailMetricsObject;\n export type IntegrationStatus = __IntegrationStatus;\n export const IntegrationStatus = T.IntegrationStatus;\n export type IntegrationSyncState = __IntegrationSyncState;\n export const IntegrationSyncState = T.IntegrationSyncState;\n export type LintSeverity = __LintSeverity;\n export const LintSeverity = T.LintSeverity;\n export type MailboxStatus = __MailboxStatus;\n export const MailboxStatus = T.MailboxStatus;\n export type MessageEventType = __MessageEventType;\n export const MessageEventType = T.MessageEventType;\n export type MessageSource = __MessageSource;\n export const MessageSource = T.MessageSource;\n export type MessageStatus = __MessageStatus;\n export const MessageStatus = T.MessageStatus;\n export type MessageTransport = __MessageTransport;\n export const MessageTransport = T.MessageTransport;\n export type SegmentMatch = __SegmentMatch;\n export const SegmentMatch = T.SegmentMatch;\n export type SegmentOperator = __SegmentOperator;\n export const SegmentOperator = T.SegmentOperator;\n export type SegmentType = __SegmentType;\n export const SegmentType = T.SegmentType;\n export type SendBatchRowState = __SendBatchRowState;\n export const SendBatchRowState = T.SendBatchRowState;\n export type SenderDomainStatus = __SenderDomainStatus;\n export const SenderDomainStatus = T.SenderDomainStatus;\n export type SesDkimStatus = __SesDkimStatus;\n export const SesDkimStatus = T.SesDkimStatus;\n export type SesMailFromStatus = __SesMailFromStatus;\n export const SesMailFromStatus = T.SesMailFromStatus;\n export type ShareLinkStatus = __ShareLinkStatus;\n export const ShareLinkStatus = T.ShareLinkStatus;\n export type SmtpConfigStatus = __SmtpConfigStatus;\n export const SmtpConfigStatus = T.SmtpConfigStatus;\n export type SpamVerdict = __SpamVerdict;\n export const SpamVerdict = T.SpamVerdict;\n export type StatsGranularity = __StatsGranularity;\n export const StatsGranularity = T.StatsGranularity;\n export type StatsSeriesMetric = __StatsSeriesMetric;\n export const StatsSeriesMetric = T.StatsSeriesMetric;\n export type StatsWindow = __StatsWindow;\n export const StatsWindow = T.StatsWindow;\n export type Subscription = __Subscription;\n export const Subscription = T.Subscription;\n export type SubscriptionReason = __SubscriptionReason;\n export const SubscriptionReason = T.SubscriptionReason;\n export type SuppressionSource = __SuppressionSource;\n export const SuppressionSource = T.SuppressionSource;\n export type TemplateKind = __TemplateKind;\n export const TemplateKind = T.TemplateKind;\n export type TemplateSource = __TemplateSource;\n export const TemplateSource = T.TemplateSource;\n export type TimelineMetric = __TimelineMetric;\n export const TimelineMetric = T.TimelineMetric;\n export type TopicVisibility = __TopicVisibility;\n export const TopicVisibility = T.TopicVisibility;\n export type WebhookAttemptTrigger = __WebhookAttemptTrigger;\n export const WebhookAttemptTrigger = T.WebhookAttemptTrigger;\n export type WebhookEndpointDisabledReason = __WebhookEndpointDisabledReason;\n export const WebhookEndpointDisabledReason = T.WebhookEndpointDisabledReason;\n export type WebhookEndpointLegacySlot = __WebhookEndpointLegacySlot;\n export const WebhookEndpointLegacySlot = T.WebhookEndpointLegacySlot;\n export type WebhookEndpointStatus = __WebhookEndpointStatus;\n export const WebhookEndpointStatus = T.WebhookEndpointStatus;\n export type WebhookEventStatus = __WebhookEventStatus;\n export const WebhookEventStatus = T.WebhookEventStatus;\n export type WebhookEventType = __WebhookEventType;\n export const WebhookEventType = T.WebhookEventType;\n export type Brand = __Brand;\n export type BroadcastAudience = __BroadcastAudience;\n export type BroadcastCounts = __BroadcastCounts;\n export type Broadcast = __Broadcast;\n export type BroadcastRecipient = __BroadcastRecipient;\n export type BroadcastSettings = __BroadcastSettings;\n export type ClickedLink = __ClickedLink;\n export type ClickedLinks = __ClickedLinks;\n export type ConnectGitHub = __ConnectGitHub;\n export type ContactDeletedEventData = __ContactDeletedEventData;\n export type Contact = __Contact;\n export type ContactEventData = __ContactEventData;\n export type ContactImport = __ContactImport;\n export type ContactImportError = __ContactImportError;\n export type ContactProperty = __ContactProperty;\n export type ContactSegments = __ContactSegments;\n export type ContactTopic = __ContactTopic;\n export type ContactTopics = __ContactTopics;\n export type CreatedShareLink = __CreatedShareLink;\n export type DefaultSender = __DefaultSender;\n export type DefaultSenderSkippedSends = __DefaultSenderSkippedSends;\n export type DeleteByRecipient = __DeleteByRecipient;\n export type DeliverabilityBlockSignal = __DeliverabilityBlockSignal;\n export type DeliverabilityDomain = __DeliverabilityDomain;\n export type Deliverability = __Deliverability;\n export type DmarcGrade = __DmarcGrade;\n export type DnsApplyConflict = __DnsApplyConflict;\n export type DnsApplyCounts = __DnsApplyCounts;\n export type DnsApplyPlanItem = __DnsApplyPlanItem;\n export type DnsApplyResult = __DnsApplyResult;\n export type DnsInstruction = __DnsInstruction;\n export type DnsRecordConflict = __DnsRecordConflict;\n export type DnsRecordStatus = __DnsRecordStatus;\n export type DomainCapabilities = __DomainCapabilities;\n export type DomainConnectStart = __DomainConnectStart;\n export type DomainCreatedEventData = __DomainCreatedEventData;\n export type DomainDeletedEventData = __DomainDeletedEventData;\n export type DomainDetail = __DomainDetail;\n export type DomainDnsProvider = __DomainDnsProvider;\n export type DomainDnsRecords = __DomainDnsRecords;\n export type Domain = __Domain;\n export type DomainEvent = __DomainEvent;\n export type DomainLookup = __DomainLookup;\n export type DomainRecordChange = __DomainRecordChange;\n export type DomainRecord = __DomainRecord;\n export type DomainSesStatus = __DomainSesStatus;\n export type DomainUpdatedEventData = __DomainUpdatedEventData;\n export type DomainVerifiedEventData = __DomainVerifiedEventData;\n export type EmailBouncedEventData = __EmailBouncedEventData;\n export type EmailCanceledEventData = __EmailCanceledEventData;\n export type EmailClickedEventData = __EmailClickedEventData;\n export type EmailComplainedEventData = __EmailComplainedEventData;\n export type EmailDeliveredEventData = __EmailDeliveredEventData;\n export type EmailDeliveryDelayedEventData = __EmailDeliveryDelayedEventData;\n export type EmailDetail = __EmailDetail;\n export type Email = __Email;\n export type EmailFailedEventData = __EmailFailedEventData;\n export type EmailMessageSummary = __EmailMessageSummary;\n export type EmailMetricsCounters = __EmailMetricsCounters;\n export type EmailMetricsDataItem = __EmailMetricsDataItem;\n export type EmailMetricsMeasured = __EmailMetricsMeasured;\n export type EmailMetrics = __EmailMetrics;\n export type EmailOpenedEventData = __EmailOpenedEventData;\n export type EmailPagination = __EmailPagination;\n export type EmailReceivedEventData = __EmailReceivedEventData;\n export type EmailScheduledEventData = __EmailScheduledEventData;\n export type EmailSentEventData = __EmailSentEventData;\n export type EmailSkippedEventData = __EmailSkippedEventData;\n export type EmailSuppressedEventData = __EmailSuppressedEventData;\n export type EmailTag = __EmailTag;\n export type GetSmtpConfig = __GetSmtpConfig;\n export type GitHubBranch = __GitHubBranch;\n export type GitHubRepo = __GitHubRepo;\n export type IntegrationDetail = __IntegrationDetail;\n export type IntegrationListItem = __IntegrationListItem;\n export type LintFinding = __LintFinding;\n export type LintResult = __LintResult;\n export type ListBroadcastRecipients = __ListBroadcastRecipients;\n export type ListBroadcasts = __ListBroadcasts;\n export type ListContactImports = __ListContactImports;\n export type ListContactProperties = __ListContactProperties;\n export type ListContacts = __ListContacts;\n export type ListDomainEvents = __ListDomainEvents;\n export type ListDomains = __ListDomains;\n export type ListEmails = __ListEmails;\n export type ListIntegrations = __ListIntegrations;\n export type ListMailboxes = __ListMailboxes;\n export type ListMessages = __ListMessages;\n export type ListOutboundMessages = __ListOutboundMessages;\n export type ListReceivedEmails = __ListReceivedEmails;\n export type ListSegmentContacts = __ListSegmentContacts;\n export type ListSegments = __ListSegments;\n export type ListShareLinks = __ListShareLinks;\n export type ListSmtpConfigs = __ListSmtpConfigs;\n export type ListSuppression = __ListSuppression;\n export type ListTemplateTags = __ListTemplateTags;\n export type ListTemplates = __ListTemplates;\n export type ListTopics = __ListTopics;\n export type ListWebhookAttempts = __ListWebhookAttempts;\n export type ListWebhookEndpoints = __ListWebhookEndpoints;\n export type ListWebhookEventTypes = __ListWebhookEventTypes;\n export type ListWebhookEvents = __ListWebhookEvents;\n export type LookupDmarc = __LookupDmarc;\n export type LookupDomainConnect = __LookupDomainConnect;\n export type LookupExisting = __LookupExisting;\n export type LookupProvider = __LookupProvider;\n export type LookupSpf = __LookupSpf;\n export type LookupSuggestion = __LookupSuggestion;\n export type MailStatsInWindow = __MailStatsInWindow;\n export type MailStatsSeries = __MailStatsSeries;\n export type MailStatsTotals = __MailStatsTotals;\n export type MailWorkspaceStats = __MailWorkspaceStats;\n export type Mailbox = __Mailbox;\n export type MessageAttachment = __MessageAttachment;\n export type MessageDetail = __MessageDetail;\n export type Message = __Message;\n export type MessageEvent = __MessageEvent;\n export type MessageTimeline = __MessageTimeline;\n export type OutboundMessageDetail = __OutboundMessageDetail;\n export type OutboundMessage = __OutboundMessage;\n export type OutboundMessagePagination = __OutboundMessagePagination;\n export type OutboundMessageSettings = __OutboundMessageSettings;\n export type OutboundMessageWithBody = __OutboundMessageWithBody;\n export type OutboundWebhookAttempt = __OutboundWebhookAttempt;\n export type Pagination = __Pagination;\n export type RawBrand = __RawBrand;\n export type ReceivedEmailAttachment = __ReceivedEmailAttachment;\n export type ReceivedEmailDetail = __ReceivedEmailDetail;\n export type ReceivedEmail = __ReceivedEmail;\n export type RenderedMessage = __RenderedMessage;\n export type ReplayWebhookEvent = __ReplayWebhookEvent;\n export type ResolvedBrandTokens = __ResolvedBrandTokens;\n export type SegmentCondition = __SegmentCondition;\n export type Segment = __Segment;\n export type SegmentMembership = __SegmentMembership;\n export type SegmentMetrics = __SegmentMetrics;\n export type SegmentPreview = __SegmentPreview;\n export type SegmentRule = __SegmentRule;\n export type SendAccepted = __SendAccepted;\n export type SendBatchOpenApi = __SendBatchOpenApi;\n export type SendBatchRowError = __SendBatchRowError;\n export type SendBatchRowStatus = __SendBatchRowStatus;\n export type SendBatchSummary = __SendBatchSummary;\n export type SendEmail = __SendEmail;\n export type SendingDefaults = __SendingDefaults;\n export type SendingDefaultsEventSender = __SendingDefaultsEventSender;\n export type SendingDefaultsUpdatedEventData = __SendingDefaultsUpdatedEventData;\n export type ShareLink = __ShareLink;\n export type SmtpConfig = __SmtpConfig;\n export type SmtpVerifyError = __SmtpVerifyError;\n export type SmtpVerifyResult = __SmtpVerifyResult;\n export type StartSync = __StartSync;\n export type StatsSeriesPoint = __StatsSeriesPoint;\n export type SuppressionAddedEventData = __SuppressionAddedEventData;\n export type SuppressionEntry = __SuppressionEntry;\n export type SuppressionRemovedEventData = __SuppressionRemovedEventData;\n export type SyncStatus = __SyncStatus;\n export type Template = __Template;\n export type TemplateVariables = __TemplateVariables;\n export type TimelinePoint = __TimelinePoint;\n export type Topic = __Topic;\n export type WebhookDeliveryAttempt = __WebhookDeliveryAttempt;\n export type WebhookEndpoint = __WebhookEndpoint;\n export type WebhookEndpointWithSecret = __WebhookEndpointWithSecret;\n export type WebhookEventDelivery = __WebhookEventDelivery;\n export type WebhookEventDetail = __WebhookEventDetail;\n export type WebhookEvent = __WebhookEvent;\n export type WebhookEventTypeInfo = __WebhookEventTypeInfo;\n export type WebhookPagination = __WebhookPagination;\n export type BrandUpdateParams = __BrandUpdateParams;\n export type BroadcastSettingsUpdateParams = __BroadcastSettingsUpdateParams;\n export type BroadcastListParams = __BroadcastListParams;\n export type BroadcastCreateParams = __BroadcastCreateParams;\n export type BroadcastAudienceParams = __BroadcastAudienceParams;\n export type BroadcastUpdateParams = __BroadcastUpdateParams;\n export type BroadcastRecipientListParams = __BroadcastRecipientListParams;\n export type BroadcastSendParams = __BroadcastSendParams;\n export type ContactPropertyListParams = __ContactPropertyListParams;\n export type ContactPropertyCreateParams = __ContactPropertyCreateParams;\n export type ContactPropertyUpdateParams = __ContactPropertyUpdateParams;\n export type ContactListParams = __ContactListParams;\n export type ContactCreateParams = __ContactCreateParams;\n export type ContactImportListParams = __ContactImportListParams;\n export type ContactImportCreateParams = __ContactImportCreateParams;\n export type ContactUpdateParams = __ContactUpdateParams;\n export type ContactTopicUpdateParams = __ContactTopicUpdateParams;\n export type DeliverabilityRetrieveParams = __DeliverabilityRetrieveParams;\n export type DomainListParams = __DomainListParams;\n export type DomainCreateParams = __DomainCreateParams;\n export type DomainLookupParams = __DomainLookupParams;\n export type DomainUpdateParams = __DomainUpdateParams;\n export type DomainDnsRecordListParams = __DomainDnsRecordListParams;\n export type DomainDnsRecordApplyParams = __DomainDnsRecordApplyParams;\n export type DomainDnsRecordCheckParams = __DomainDnsRecordCheckParams;\n export type DomainDnsRecordExportParams = __DomainDnsRecordExportParams;\n export type DomainDomainConnectStartParams = __DomainDomainConnectStartParams;\n export type DomainEventListParams = __DomainEventListParams;\n export type DomainShareLinkListParams = __DomainShareLinkListParams;\n export type DomainShareLinkCreateParams = __DomainShareLinkCreateParams;\n export type DomainSmtpConfigUpdateParams = __DomainSmtpConfigUpdateParams;\n export type DomainTestSendParams = __DomainTestSendParams;\n export type EmailListParams = __EmailListParams;\n export type EmailSendParams = __EmailSendParams;\n export type EmailBatchParams = __EmailBatchParams;\n export type EmailMetricsParams = __EmailMetricsParams;\n export type IntegrationGithubConnectParams = __IntegrationGithubConnectParams;\n export type IntegrationGithubRepoListResponse = __IntegrationGithubRepoListResponse;\n export type IntegrationGithubRepoBranchListResponse = __IntegrationGithubRepoBranchListResponse;\n export type IntegrationGithubSettingsUpdateParams = __IntegrationGithubSettingsUpdateParams;\n export type MailboxListParams = __MailboxListParams;\n export type MailboxCreateParams = __MailboxCreateParams;\n export type MailboxUpdateParams = __MailboxUpdateParams;\n export type MailboxMessageListParams = __MailboxMessageListParams;\n export type MessageListParams = __MessageListParams;\n export type MessageEraseParams = __MessageEraseParams;\n export type MessageExportParams = __MessageExportParams;\n export type MessageSettingsUpdateParams = __MessageSettingsUpdateParams;\n export type MessageTimelineParams = __MessageTimelineParams;\n export type ReceivedListParams = __ReceivedListParams;\n export type ReceivedExportParams = __ReceivedExportParams;\n export type SegmentListParams = __SegmentListParams;\n export type SegmentCreateParams = __SegmentCreateParams;\n export type SegmentPreviewParams = __SegmentPreviewParams;\n export type SegmentUpdateParams = __SegmentUpdateParams;\n export type SegmentContactListParams = __SegmentContactListParams;\n export type SendingDefaultUpdateParams = __SendingDefaultUpdateParams;\n export type SmtpConfigUpdateParams = __SmtpConfigUpdateParams;\n export type SmtpConfigVerifyParams = __SmtpConfigVerifyParams;\n export type StatsRetrieveParams = __StatsRetrieveParams;\n export type SuppressionListParams = __SuppressionListParams;\n export type SuppressionCreateParams = __SuppressionCreateParams;\n export type TemplateListParams = __TemplateListParams;\n export type TemplateCreateParams = __TemplateCreateParams;\n export type TemplateLintParams = __TemplateLintParams;\n export type TemplatePreviewParams = __TemplatePreviewParams;\n export type TemplateRenderParams = __TemplateRenderParams;\n export type TemplateSendParams = __TemplateSendParams;\n export type TemplateSendBatchParams = __TemplateSendBatchParams;\n export type TemplateTestSendParams = __TemplateTestSendParams;\n export type TopicListParams = __TopicListParams;\n export type TopicCreateParams = __TopicCreateParams;\n export type TopicUpdateParams = __TopicUpdateParams;\n export type WebhookAttemptListParams = __WebhookAttemptListParams;\n export type WebhookEndpointCreateParams = __WebhookEndpointCreateParams;\n export type WebhookEndpointUpdateParams = __WebhookEndpointUpdateParams;\n export type WebhookEndpointRotateSecretParams = __WebhookEndpointRotateSecretParams;\n export type WebhookEndpointTestParams = __WebhookEndpointTestParams;\n export type WebhookEventListParams = __WebhookEventListParams;\n export type WebhookEventReplayParams = __WebhookEventReplayParams;\n export type ErrorCode = __ErrorCode;\n export type ContactCreatedEvent = __ContactCreatedEvent;\n export type ContactDeletedEvent = __ContactDeletedEvent;\n export type ContactUpdatedEvent = __ContactUpdatedEvent;\n export type DomainCreatedEvent = __DomainCreatedEvent;\n export type DomainDeletedEvent = __DomainDeletedEvent;\n export type DomainUpdatedEvent = __DomainUpdatedEvent;\n export type DomainVerifiedEvent = __DomainVerifiedEvent;\n export type EmailBouncedEvent = __EmailBouncedEvent;\n export type EmailCanceledEvent = __EmailCanceledEvent;\n export type EmailClickedEvent = __EmailClickedEvent;\n export type EmailComplainedEvent = __EmailComplainedEvent;\n export type EmailDeliveredEvent = __EmailDeliveredEvent;\n export type EmailDeliveryDelayedEvent = __EmailDeliveryDelayedEvent;\n export type EmailFailedEvent = __EmailFailedEvent;\n export type EmailOpenedEvent = __EmailOpenedEvent;\n export type EmailReceivedEvent = __EmailReceivedEvent;\n export type EmailScheduledEvent = __EmailScheduledEvent;\n export type EmailSentEvent = __EmailSentEvent;\n export type EmailSkippedEvent = __EmailSkippedEvent;\n export type EmailSuppressedEvent = __EmailSuppressedEvent;\n export type SendingDefaultsUpdatedEvent = __SendingDefaultsUpdatedEvent;\n export type SuppressionAddedEvent = __SuppressionAddedEvent;\n export type SuppressionRemovedEvent = __SuppressionRemovedEvent;\n export type UnknownWebhookEvent = __UnknownWebhookEvent;\n export type UnwrapWebhookEvent = __UnwrapWebhookEvent;\n export type WebhookUnwrapParams = __WebhookUnwrapParams;\n}\n","// Generated by scripts/gen-sdk.mjs from Specs/mail.json. Do not edit.\n\nexport { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from \"@productcraft/core\";\n\n/** Error codes this API documents. Open: codes added later still type-check. See https://productcraft.co/docs/errors. */\nexport type MailErrorCode = \"BAD_REQUEST\" | \"VALIDATION_ERROR\" | \"UNAUTHORIZED\" | \"PAYMENT_REQUIRED\" | \"FORBIDDEN\" | \"NOT_FOUND\" | \"METHOD_NOT_ALLOWED\" | \"NOT_ACCEPTABLE\" | \"REQUEST_TIMEOUT\" | \"CONFLICT\" | \"GONE\" | \"PRECONDITION_FAILED\" | \"PAYLOAD_TOO_LARGE\" | \"UNSUPPORTED_MEDIA_TYPE\" | \"UNPROCESSABLE_ENTITY\" | \"PRECONDITION_REQUIRED\" | \"RATE_LIMITED\" | \"INTERNAL_SERVER_ERROR\" | \"NOT_IMPLEMENTED\" | \"BAD_GATEWAY\" | \"SERVICE_UNAVAILABLE\" | \"GATEWAY_TIMEOUT\" | \"SERVICE_NOT_ENABLED\" | \"INVALID_CREDENTIALS\" | \"SESSION_REVOKED\" | \"MCP_NOT_PERMITTED\" | \"MCP_WORKSPACE_MISMATCH\" | \"PAK_NOT_PERMITTED\" | \"ACTIONS_NOT_GRANTABLE\" | \"IDEMPOTENCY_KEY_REUSE\" | \"IDEMPOTENCY_KEY_REQUIRED\" | \"IDEMPOTENCY_IN_PROGRESS\" | \"WEBHOOK_ENDPOINT_LIMIT\" | \"WEBHOOK_ENDPOINT_NOT_FOUND\" | \"WEBHOOK_ENDPOINT_NOT_SUBSCRIBED\" | \"WEBHOOK_EVENT_NOT_FOUND\" | \"WEBHOOK_EVENT_TYPE_UNKNOWN\" | \"AUDIENCE_REQUIRED\" | \"BROADCAST_AUDIENCE_EMPTY\" | \"BROADCAST_CONTENT_CONFLICT\" | \"BROADCAST_NOT_CANCELABLE\" | \"BROADCAST_NOT_DELETABLE\" | \"BROADCAST_NOT_DRAFT\" | \"BROADCAST_NOT_FOUND\" | \"BROADCAST_NOT_READY\" | \"CAPABILITY_NOT_VERIFIED\" | \"CONTACT_EXISTS\" | \"CONTACT_LIMIT\" | \"CONTACT_NOT_FOUND\" | \"CONTACT_PROPERTY_EXISTS\" | \"CONTACT_PROPERTY_LIMIT\" | \"CONTACT_PROPERTY_NOT_FOUND\" | \"DATE_RANGE_BEYOND_RETENTION\" | \"DATE_RANGE_TOO_WIDE\" | \"DATE_WINDOW_TOO_WIDE\" | \"DKIM_KEY_MISSING\" | \"DNS_CONFLICTS\" | \"DOMAIN_CONNECT_DISABLED\" | \"DOMAIN_CONNECT_MAIL_FROM_LABEL\" | \"DOMAIN_CONNECT_NOT_SENDING\" | \"DOMAIN_CONNECT_UNAVAILABLE\" | \"DOMAIN_HAS_MAILBOXES\" | \"DOMAIN_NOT_FOUND\" | \"EMAIL_CONTENT_CONFLICT\" | \"EMAIL_NOT_FOUND\" | \"EMAIL_UNAVAILABLE\" | \"FROM_DOMAIN_MISMATCH\" | \"IDEMPOTENCY_KEY_CONFLICTS_WITH_ROW\" | \"IMPORT_IN_PROGRESS\" | \"IMPORT_NOT_FOUND\" | \"IMPORT_TOO_LARGE\" | \"INVALID_CAPABILITIES\" | \"INVALID_CONTACT_PROPERTY_VALUE\" | \"INVALID_CSV\" | \"INVALID_DATE\" | \"INVALID_DATE_RANGE\" | \"INVALID_DATE_WINDOW\" | \"INVALID_FORMAT\" | \"INVALID_FROM_ADDRESS\" | \"INVALID_SEGMENT_RULE\" | \"INVALID_TIMEZONE\" | \"INVALID_ZONE\" | \"MAIL_FROM_HOST_IN_USE\" | \"MAIL_FROM_NOT_SENDING\" | \"MAIL_HEADER_NOT_ALLOWED\" | \"PROVIDER_ERROR\" | \"PROVIDER_PERMISSION_DENIED\" | \"PROVIDER_TOKEN_REJECTED\" | \"PROVIDER_UNAVAILABLE\" | \"PROVIDER_ZONE_NOT_FOUND\" | \"RECIPIENT_LIMIT\" | \"RECIPIENT_SUPPRESSED\" | \"REGION_NOT_AVAILABLE\" | \"RESERVED_PROPERTY_KEY\" | \"SEGMENT_EXISTS\" | \"SEGMENT_LIMIT\" | \"SEGMENT_NOT_FOUND\" | \"SEGMENT_RULE_BASED\" | \"SEGMENT_TYPE_FIXED\" | \"SES_IDENTITY_DELETE_FAILED\" | \"SHARE_LINK_NOT_FOUND\" | \"SMTP_AUTH_PARTIAL\" | \"SMTP_CONFIG_NOT_FOUND\" | \"SMTP_PASSWORD_REQUIRED\" | \"TEMPLATE_DATA_INVALID\" | \"TEMPLATE_KIND_NOT_SENDABLE\" | \"TEMPLATE_NOT_FOUND\" | \"TEMPLATE_RENDER_FAILED\" | \"TLS_ENFORCED_NOT_AVAILABLE\" | \"TOPIC_EXISTS\" | \"TOPIC_LIMIT\" | \"TOPIC_NOT_FOUND\" | \"TRACKING_NOT_AVAILABLE\" | \"UNKNOWN_CONTACT_PROPERTY\" | \"UNSUBSCRIBE_LINK_REQUIRED\" | \"domain_not_verified_by_provider\" | \"from_domain_not_verified\" | \"no_default_sender\" | \"sender_domain_not_in_workspace\" | (string & {});\nexport const MailErrorCode = { values: [\"BAD_REQUEST\", \"VALIDATION_ERROR\", \"UNAUTHORIZED\", \"PAYMENT_REQUIRED\", \"FORBIDDEN\", \"NOT_FOUND\", \"METHOD_NOT_ALLOWED\", \"NOT_ACCEPTABLE\", \"REQUEST_TIMEOUT\", \"CONFLICT\", \"GONE\", \"PRECONDITION_FAILED\", \"PAYLOAD_TOO_LARGE\", \"UNSUPPORTED_MEDIA_TYPE\", \"UNPROCESSABLE_ENTITY\", \"PRECONDITION_REQUIRED\", \"RATE_LIMITED\", \"INTERNAL_SERVER_ERROR\", \"NOT_IMPLEMENTED\", \"BAD_GATEWAY\", \"SERVICE_UNAVAILABLE\", \"GATEWAY_TIMEOUT\", \"SERVICE_NOT_ENABLED\", \"INVALID_CREDENTIALS\", \"SESSION_REVOKED\", \"MCP_NOT_PERMITTED\", \"MCP_WORKSPACE_MISMATCH\", \"PAK_NOT_PERMITTED\", \"ACTIONS_NOT_GRANTABLE\", \"IDEMPOTENCY_KEY_REUSE\", \"IDEMPOTENCY_KEY_REQUIRED\", \"IDEMPOTENCY_IN_PROGRESS\", \"WEBHOOK_ENDPOINT_LIMIT\", \"WEBHOOK_ENDPOINT_NOT_FOUND\", \"WEBHOOK_ENDPOINT_NOT_SUBSCRIBED\", \"WEBHOOK_EVENT_NOT_FOUND\", \"WEBHOOK_EVENT_TYPE_UNKNOWN\", \"AUDIENCE_REQUIRED\", \"BROADCAST_AUDIENCE_EMPTY\", \"BROADCAST_CONTENT_CONFLICT\", \"BROADCAST_NOT_CANCELABLE\", \"BROADCAST_NOT_DELETABLE\", \"BROADCAST_NOT_DRAFT\", \"BROADCAST_NOT_FOUND\", \"BROADCAST_NOT_READY\", \"CAPABILITY_NOT_VERIFIED\", \"CONTACT_EXISTS\", \"CONTACT_LIMIT\", \"CONTACT_NOT_FOUND\", \"CONTACT_PROPERTY_EXISTS\", \"CONTACT_PROPERTY_LIMIT\", \"CONTACT_PROPERTY_NOT_FOUND\", \"DATE_RANGE_BEYOND_RETENTION\", \"DATE_RANGE_TOO_WIDE\", \"DATE_WINDOW_TOO_WIDE\", \"DKIM_KEY_MISSING\", \"DNS_CONFLICTS\", \"DOMAIN_CONNECT_DISABLED\", \"DOMAIN_CONNECT_MAIL_FROM_LABEL\", \"DOMAIN_CONNECT_NOT_SENDING\", \"DOMAIN_CONNECT_UNAVAILABLE\", \"DOMAIN_HAS_MAILBOXES\", \"DOMAIN_NOT_FOUND\", \"EMAIL_CONTENT_CONFLICT\", \"EMAIL_NOT_FOUND\", \"EMAIL_UNAVAILABLE\", \"FROM_DOMAIN_MISMATCH\", \"IDEMPOTENCY_KEY_CONFLICTS_WITH_ROW\", \"IMPORT_IN_PROGRESS\", \"IMPORT_NOT_FOUND\", \"IMPORT_TOO_LARGE\", \"INVALID_CAPABILITIES\", \"INVALID_CONTACT_PROPERTY_VALUE\", \"INVALID_CSV\", \"INVALID_DATE\", \"INVALID_DATE_RANGE\", \"INVALID_DATE_WINDOW\", \"INVALID_FORMAT\", \"INVALID_FROM_ADDRESS\", \"INVALID_SEGMENT_RULE\", \"INVALID_TIMEZONE\", \"INVALID_ZONE\", \"MAIL_FROM_HOST_IN_USE\", \"MAIL_FROM_NOT_SENDING\", \"MAIL_HEADER_NOT_ALLOWED\", \"PROVIDER_ERROR\", \"PROVIDER_PERMISSION_DENIED\", \"PROVIDER_TOKEN_REJECTED\", \"PROVIDER_UNAVAILABLE\", \"PROVIDER_ZONE_NOT_FOUND\", \"RECIPIENT_LIMIT\", \"RECIPIENT_SUPPRESSED\", \"REGION_NOT_AVAILABLE\", \"RESERVED_PROPERTY_KEY\", \"SEGMENT_EXISTS\", \"SEGMENT_LIMIT\", \"SEGMENT_NOT_FOUND\", \"SEGMENT_RULE_BASED\", \"SEGMENT_TYPE_FIXED\", \"SES_IDENTITY_DELETE_FAILED\", \"SHARE_LINK_NOT_FOUND\", \"SMTP_AUTH_PARTIAL\", \"SMTP_CONFIG_NOT_FOUND\", \"SMTP_PASSWORD_REQUIRED\", \"TEMPLATE_DATA_INVALID\", \"TEMPLATE_KIND_NOT_SENDABLE\", \"TEMPLATE_NOT_FOUND\", \"TEMPLATE_RENDER_FAILED\", \"TLS_ENFORCED_NOT_AVAILABLE\", \"TOPIC_EXISTS\", \"TOPIC_LIMIT\", \"TOPIC_NOT_FOUND\", \"TRACKING_NOT_AVAILABLE\", \"UNKNOWN_CONTACT_PROPERTY\", \"UNSUBSCRIBE_LINK_REQUIRED\", \"domain_not_verified_by_provider\", \"from_domain_not_verified\", \"no_default_sender\", \"sender_domain_not_in_workspace\"] as const };\n"]}