Webhooks
For a number of events, you can subscribe to Webhooks to receive event data. Most information concerning the event itself is on the Webhook data. For most related entities, you may only receive its UUID, which then requires an API call to retrieve more data if needed.
A list of available Webhook events can be found below. If there's an event missing, you can request the addition of said event with our support team.
Event
Description
contact_createdcontact_updatedcredit_reception_createdprepaid_transaction_createdgiftcard_transaction_createdvoucher_createdvoucher_updatedvoucher_redeemedform_submission_completedreferral_completedcontact_identifier_createdreward_updatedpromotion_updatedList Webhook Subscriptions
Lists an Account's current Webhook Subscriptions.
https://api.piggy.eu/api//webhook-subscriptionsBearer {{ access_token | api_key }}application/jsonevent_typestringOPTIONALstatusstringOPTIONAL1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"data": [
{
"uuid": "f1dc2d67-caa8-4919-a537-66491a94ed2f",
"name": "New Krusty Krew Member",
"event_type": "contact_created",
"url": "http://api.example.com/piggy/webhooks",
"status": "ACTIVE",
"version": "V1",
"created_at": "2023-10-20T11:46:22+00:00"
},
{
"uuid": "5062eeac-bbeb-4903-b81e-2422793ff151",
"name": "Krabby Patty Special Updated",
"event_type": "promotion_updated",
"url": "http://api.example.com/piggy/webhooks",
"status": "ACTIVE",
"version": "V1",
"created_at": "2023-10-20T11:48:43+00:00"
},
{
"uuid": "33ee3999-4230-4e3e-b320-cbcbe719bc45",
"name": "Friend Brought to Krusty Krab",
"event_type": "referral_completed",
"url": "http://api.example.com/piggy/webhooks",
"status": "INACTIVE",
"version": "V1",
"created_at": "2023-10-20T11:49:19+00:00"
},
],
"meta": []
}Code
Message
1003Create Webhook Subscription
Subscribes to a specific Webhook event.
https://api.piggy.eu/api//webhook-subscriptionsBearer {{ access_token | api_key }}application/jsonBody
namestringREQUIREDevent_typestringREQUIREDurlstringREQUIREDsecretstringOPTIONAL1
2
3
4
5
6
7
8
9
10
11
12
{
"data": {
"uuid": "59165ef0-1afd-4baf-b1f7-ffee287aff32",
"name": "New Krusty Krew Member",
"event_type": "contact_created",
"url": "http://api.example.com/piggy/webhooks",
"status": "ACTIVE",
"version": "V1",
"created_at": "2023-11-13T12:32:43+00:00"
},
"meta": []
}Code
Message
1003Get Webhook Subscription
Retrieve a specific Webhook Subscription by specifying its UUID.
https://api.piggy.eu/api//webhook-subscriptions/{{webhook_subscription_uuid}}Bearer {{ access_token | api_key }}application/jsonwebhook_subscription_uuidstringREQUIRED1
2
3
4
5
6
7
8
9
10
11
12
13
{
"data": {
"uuid": "59165ef0-1afd-4baf-b1f7-ffee287aff32",
"name": "Bikini Bottom Alert",
"event_type": "contact_created",
"url": "http://yourwebsite.com/somethingsomething",
"properties": [],
"status": "ACTIVE",
"version": "V1",
"created_at": "2023-11-13T12:32:43+00:00"
},
"meta": []
}Code
Message
80300Update Webhook Subscription
Updates an existing Webhook Subscription. The subscription's event_typeand secretcannot be altered after creation.
https://api.piggy.eu/api//webhook-subscriptions/{{webhook_subscription_uuid}}Bearer {{ access_token | api_key }}application/jsonwebhook_subscription_uuidstringREQUIREDBody
namestringOPTIONALurlstringOPTIONALstatusstringOPTIONALattributesarrayREQUIRED | OPTIONAL1
2
3
4
5
6
7
8
9
10
11
12
13
{
"data": {
"uuid": "59165ef0-1afd-4baf-b1f7-ffee287aff32",
"name": "Updated Bikini Bottom Alert",
"event_type": "contact_created",
"url": "http://yourwebsite.com/somethingsomething",
"properties": [],
"status": "ACTIVE",
"version": "V1",
"created_at": "2023-11-13T12:32:43+00:00"
},
"meta": []
}Code
Message
100380300Delete Webhook Subscription
Removes an existing Webhook Subscription.
https://api.piggy.eu/api//webhook-subscriptions/{{webhook_subscription_uuid}}Bearer {{ access_token | api_key }}application/jsonwebhook_subscription_uuidstringREQUIRED1
2
3
4
{
"data": [],
"meta": []
}Code
Message
80300