Webhooks

Webhooks allows you to receive real-time status updates any time an event happens on your account. For a complete description of these notifications, see Webhooks.

The Webhook object

Attribute

Description

id

Unique identifier for the object.

url

URL to which the notifications are posted.

events

List of events to subscribe to.

secret_key

Secret key used to sign the Webhook notifications.

metadata

JSON-encoded metadata.

post
Create a Webhook

https://api.gigapay.se/v2/webhooks/
Endpoint for creating Webhooks.
Request
Response
Request
Headers
Authentication
required
string
Authentication token.
Integration-ID
required
string
Integration ID.
Idempotency-Key
optional
string
Idempotency key.
Body Parameters
id
optional
string
Unique identifier for the object. If an identifier is not provided a UUID4 will be generated.
url
required
string
URL to which the notifications will be posted.
events
required
array
Array of events to provide notifications of.
secret_key
optional
string
Secret key used to sign the notifications. If a secret key is not provided, a 32 character random string will be generated.
metadata
optional
object
JSON-encoded metadata.
Response
201: Created
Webhook successfully created.
{
"id": "38a93e19-886a-4246-9cfe-471214ff6739",
"url": "https://gigatron.se/webhooks/payouts/,
"events": ["Payout.notified", "Payout.accepted"],
"secret_key": "c1329a085d65f7757838df5920fdcc9a",
"metadata": {}
}

get
List Webhooks

https://api.gigapay.se/v2/webhooks/
Endpoint for listing Webhooks.
Request
Response
Request
Headers
Authentication
required
string
Authentication Token.
Integration-ID
required
string
Integration ID.
Query Parameters
page
optional
number
Which page to return.
page_size
optional
number
The number of Webhooks per page.
Response
200: OK
Webhooks successfully listed.
{
"count": 4,
"next": null,
"previous": "https://api.gigapay.se/v2/webhooks/?page=2",
"results": [
{
"id": "38a93e19-886a-4246-9cfe-471214ff6739",
"url": "https://gigatron.se/webhooks/payouts/,
"events": ["Payout.notified", "Payout.accepted"],
"secret_key": "c1329a085d65f7757838df5920fdcc9a",
"metadata": {}
}, {
"id": "0630bfcf-ad0a-458a-9794-816b54b542b6",
"url": "https://gigatron.se/webhooks/employees/,
"events": ["Employee.verified"],
"secret_key": "1fc0ee40ecf33f83cbd3f930443074ca",
"metadata": {}
}
]
}

get
Retrieve a Webhook

https://api.gigapay.se/v2/webhooks/:id/
Endpoint for retrieving a specific Webhook.
Request
Response
Request
Path Parameters
id
required
string
The identifier of the Webhook to be retrieved.
Headers
Authentication
required
string
Authentication Token.
Integration-ID
required
string
Integration ID.
Response
200: OK
Webhook successfully retrieved.
{
"id": "0630bfcf-ad0a-458a-9794-816b54b542b6",
"url": "https://gigatron.se/webhooks/employees/,
"events": ["Employee.verified"],
"secret_key": "1fc0ee40ecf33f83cbd3f930443074ca",
"metadata": {}
}

post
Test a Webhook

https://api.gigapay.se/v2/webhooks/:id/test/
Send a test notification from a Webhook. Note that the notification will contain test data which does not match the live data.
Request
Response
Request
Path Parameters
id
required
string
The identifier of the Webhook to be tested.
Headers
Authentication
required
string
Authentication Token.
Integration-ID
required
string
Integration ID.
Body Parameters
event
required
string
Type of event to send a notification of.
Response
200: OK
Test event successfully sent.
{
"event": "Payout.created"
}

patch
Update a Webhook

https://api.gigapay.se/v2/webhooks/:id/
Endpoint for updating a Webhook.
Request
Response
Request
Path Parameters
id
required
string
The identifier of the Webhook to be updated.
Headers
Authentication
required
string
Authentication Token.
Integration-ID
required
string
Integration ID.
Body Parameters
id
optional
string
Unique identifier for the object. If one is not provided, the previous value will be retained.
url
optional
string
URL to which the notifications will be posted. If one is not provided, the previous value will be retained.
events
optional
array
Array of events able to provide notification of. If one is not provided, the previous value will be retained.
secret_key
optional
string
Secret key used to sign notifications. If one is not provided, the previous value will be retained.
metadata
optional
string
JSON-encoded metadata. If one is not provided the previous value will be retained.
Response
200: OK
Webhook successfully updated.
{
"id": "0630bfcf-ad0a-458a-9794-816b54b542b6",
"url": "https://gigatron.se/webhooks/employees/,
"events": ["Employee.created", "Employee.verified"],
"secret_key": "1fc0ee40ecf33f83cbd3f930443074ca",
"metadata": {}
}

put
Replace a Webhook

https://api.gigapay.se/v2/webhooks/:id/
Endpoint for replacing a Webhook.
Request
Response
Request
Path Parameters
id
required
string
The identifier of the Webhook to be replaced.
Headers
Authentication
required
string
Authentication Token.
Integration-ID
required
string
Integration ID.
Body Parameters
id
optional
string
Unique identifier for the object. If an identifier is not provided a UUID4 will be generated.
url
required
string
URL to which the notifications will be posted.
events
required
array
Array of events to provide notification of.
secret_key
optional
string
Secret key used to sign notifications. If a secret key is not provided a random 32 character string will be generated.
metadata
optional
string
JSON-encoded metadata.
Response
200: OK
{
"id": "77427a93-6d4f-428f-a371-31c756148436",
"url": "https://gigatron.fi/webhooks/palkansaaja/,
"events": ["Employee.created", "Employee.verified"],
"secret_key": "74917aec23e0e883a12f22fc22c557bc",
"metadata": {}
}

delete
Delete a Webhook

https://api.gigapay.se/v2/webhooks/:id/
Enpoint for deleting a Webhook.
Request
Response
Request
Path Parameters
id
required
string
The identifier of the Webhook to be deleted.
Headers
Authentication
required
string
Authentication Token.
Integration-ID
required
string
Integration ID.
Response
204: No Content
Webhook successfully deleted.