Resend Batch method 📢 Webhooks
Synchronously resends the webhook batch with the provided batchId for the customer. The result is returned in the response.
Usage
ts
import { MailChannelsClient, Webhooks } from 'mailchannels-sdk'
const mailchannels = new MailChannelsClient('your-api-key')
const webhooks = new Webhooks(mailchannels)
const { data, error } = await webhooks.resendBatch(123)ts
import { MailChannels } from 'mailchannels-sdk'
const mailchannels = new MailChannels('your-api-key')
const { data, error } = await mailchannels.webhooks.resendBatch(123)Params
batchIdnumberrequired: Unique identifier for the webhook batch.
Response
dataWebhooksResendBatch | nullnullablebatchIdnumberguaranteed: Unique identifier for the webhook batch.createdAtstringguaranteed: Timestamp of when the webhook batch was created.customerHandlestringguaranteed: The customer handle associated with the webhook batch.durationnumber | nullnullable: Duration of the webhook batch in milliseconds.nullindicates that no response was returned from the webhook endpoint.eventCountnumberguaranteed: Number of events in the webhook batch.statusCodenumber | nullnullable: HTTP status code returned by the webhook endpoint.webhookstringguaranteed: Webhook endpoint to which events in the batch were posted.
errorErrorResponse | nullnullable: Error information if the operation failed.messagestringguaranteed: A human-readable description of the error.statusCodenumber | nullnullable: The HTTP status code from the API, ornullif the error is not related to an HTTP request. This field is intended for diagnostic use only and should not be relied upon.typestringguaranteed: A string identifier for the type of error. This field is intended for diagnostic use only and should not be relied upon.
Type declarations
Signature
ts
async function resendBatch (batchId: number): Promise<WebhooksResendBatchResponse>Response type declarations
ts
interface ErrorResponse {
message: string;
statusCode: number | null;
type: ErrorType;
}ts
type DataResponse<T> = {
data: T;
error: null;
} | {
data: null;
error: ErrorResponse;
};Resend Batch type declarations
ts
interface WebhooksResendBatch {
batchId: number;
customerHandle: string;
webhook: string;
createdAt: string;
eventCount: number;
duration: number | null;
statusCode: number | null;
}ts
type WebhooksResendBatchResponse = DataResponse<WebhooksResendBatch>;Source
Source • Playground • Docs • Tests