Replay event
/v1/webhook-events/{eventId}/replayRequest example
curl -X POST 'https://api.affinityrx.com/v1/webhook-events/{eventId}/replay' \
-H "Authorization: Bearer $AFFINITY_API_KEY" \
-H 'Affinity-Version: 2026-09-28' \
-H 'Idempotency-Key: <Idempotency-Key>'Response example
These examples show the body structure. Values can differ. Select a status code to see its response.
{
"apiVersion": "<string>",
"createdAt": "<string>",
"eventType": "<string>",
"id": "evt_01j2y8m6jcc9tt24af5pw9x1bc",
"livemode": false,
"object": "webhook_event",
"resourceId": "<string>",
"resourceType": "<string>",
"status": "delivered",
"attempts": [
{
"deliveryId": "<string>",
"endpointId": "<string>",
"attemptNumber": "<string>",
"completedAt": "<string>",
"durationMs": 0,
"errorCode": "<string>",
"errorMessage": "<string>",
"id": "wha_01j2y8m6jcc9tt24af5pw9x1bc",
"requestedAt": "<string>",
"responseStatus": 0,
"trigger": "automatic"
}
],
"deliveries": [
{
"automaticAttemptCount": 0,
"endpointId": "whe_01j2y8m6jcc9tt24af5pw9x1bc",
"id": "whd_01j2y8m6jcc9tt24af5pw9x1bc",
"lastErrorCode": "<string>",
"lastErrorMessage": "<string>",
"nextAttemptAt": "<string>",
"status": "delivered"
}
],
"payload": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 400,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 401,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 403,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 404,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 409,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 422,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 429,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}Implementation specification
Use these field types and limits to build your integration. Download the OpenAPI document for the complete contract.
Path parameters
eventIdstringrequiredPattern: ^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$
Headers
Affinity-VersionstringSelects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default.
Pin requests to 2026-09-28.
X-Affinity-Organization-IdstringDefaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
Idempotency-KeystringrequiredResponse specifications
200Successful response
application/json
apiVersionstringrequiredcreatedAtstringrequiredeventTypestringrequiredidstringrequiredPattern: ^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$
livemodebooleanrequiredobjectstringrequiredAllowed: "webhook_event"
resourceIdstringrequiredresourceTypestringrequiredstatusstringrequiredAllowed: "delivered", "failed", "pending"
attemptsobject[]requiredShow attempts fields
Array items · object
deliveryIdstringrequiredendpointIdstringrequiredattemptNumberanyrequiredShow attemptNumber fields
All of · 1: any
any
Greater than: 0
completedAtstring | nullrequiredShow completedAt fields
Any of · 1: string
string
Any of · 2: null
null
durationMsnumber | string | nullrequiredShow durationMs fields
Any of · 1: number | string
Any of · 1: number
number
Any of · 2: string
string
Allowed: "Infinity", "-Infinity", "NaN"
Any of · 2: null
null
errorCodestring | nullrequiredShow errorCode fields
Any of · 1: string
string
Any of · 2: null
null
errorMessagestring | nullrequiredShow errorMessage fields
Any of · 1: string
string
Any of · 2: null
null
idanyrequiredShow id fields
All of · 1: any
any
Pattern: ^wha_[0-7][0-9a-hjkmnp-tv-z]{25}$
requestedAtstringrequiredresponseStatusnumber | string | nullrequiredShow responseStatus fields
Any of · 1: number | string
Any of · 1: number
number
Any of · 2: string
string
Allowed: "Infinity", "-Infinity", "NaN"
Any of · 2: null
null
triggerstringrequiredAllowed: "automatic", "manual", "test"
deliveriesobject[]requiredShow deliveries fields
Array items · object
automaticAttemptCountnumber | stringrequiredShow automaticAttemptCount fields
Any of · 1: number
number
Any of · 2: string
string
Allowed: "Infinity", "-Infinity", "NaN"
endpointIdanyrequiredShow endpointId fields
All of · 1: any
any
Pattern: ^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$
idanyrequiredShow id fields
All of · 1: any
any
Pattern: ^whd_[0-7][0-9a-hjkmnp-tv-z]{25}$
lastErrorCodestring | nullrequiredShow lastErrorCode fields
Any of · 1: string
string
Any of · 2: null
null
lastErrorMessagestring | nullrequiredShow lastErrorMessage fields
Any of · 1: string
string
Any of · 2: null
null
nextAttemptAtstring | nullrequiredShow nextAttemptAt fields
Any of · 1: string
string
Any of · 2: null
null
statusstringrequiredAllowed: "delivered", "failed", "pending", "retrying"
payloadobjectrequired400HTTP 400
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
401Unauthorized
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
403Forbidden
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
404Not found
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
409Conflict
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
422Validation error
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
429Too many requests
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri