Skip to content

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

  • batchId number required: Unique identifier for the webhook batch.

Response

  • data WebhooksResendBatch | null nullable
    • batchId number guaranteed: Unique identifier for the webhook batch.
    • createdAt string guaranteed: Timestamp of when the webhook batch was created.
    • customerHandle string guaranteed: The customer handle associated with the webhook batch.
    • duration number | null nullable: Duration of the webhook batch in milliseconds. null indicates that no response was returned from the webhook endpoint.
    • eventCount number guaranteed: Number of events in the webhook batch.
    • statusCode number | null nullable: HTTP status code returned by the webhook endpoint.
    • webhook string guaranteed: Webhook endpoint to which events in the batch were posted.
  • error ErrorResponse | null nullable: Error information if the operation failed.
    • message string guaranteed: A human-readable description of the error.
    • statusCode number | null nullable: The HTTP status code from the API, or null if the error is not related to an HTTP request. This field is intended for diagnostic use only and should not be relied upon.
    • type string guaranteed: 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

SourcePlaygroundDocsTests

Released under the MIT License.