API ReferenceMessages
Replay messages
Re-deliver messages from a time range to one or all subscriptions. Useful for recovery scenarios.
POST
/v1/channels/{channelId}/replayAuthorization
ApiKeyAuth AuthorizationBearer <token>
API key authentication. Keys are prefixed with environment:
npk_live_for productionnpk_test_for testing/staging
In: header
Path Parameters
channelId*string
Channel ID
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://api.npayload.com/v1/channels/string/replay" \ -H "Content-Type: application/json" \ -d '{ "since": "2024-01-01T00:00:00Z", "until": "2024-01-02T00:00:00Z", "subscriptionId": "sub_xyz789" }'{
"replayId": "string",
"messageCount": 0,
"status": "queued"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "Validation failed",
"details": {
"field": "name",
"reason": "Name is required"
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}Was this page helpful?
Publish messages in batch POST
Publish multiple messages in a single request. Maximum 100 messages per batch. All messages are published atomically - if any message fails validation, the entire batch is rejected.
Create a subscription POST
Create a webhook subscription to receive events from a channel.