Create a webhook.
const url = 'https://api.pingram.io/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"webhook":"example","events":["EMAIL_OPEN"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pingram.io/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "webhook": "example", "events": [ "EMAIL_OPEN" ] }'Authorizations
Request Bodyrequired
Request body for creating or updating an events webhook endpoint.
object
Destination URL that receives webhook event payloads. Must be a valid http(s) URL.
List of event types that should be forwarded to the webhook URL.
Responses
200
Successful response
Destination URL that receives signed event payloads for a set of subscribed events.
object
Unique identifier for this endpoint within the account.
Destination URL that receives webhook event payloads.
List of subscribed event types for this endpoint.
HMAC secret for verifying webhook signatures. Use this with your X-Pingram-Signature verification.
Example
{ "events": [ "EMAIL_OPEN" ]}400
Bad Request - validation errors, invalid input
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}401
Unauthorized
402
Payment Required - usage limits exceeded
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}500
Internal Server Error
502
Bad Gateway - provider error
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}