Subscribe to an event
const url = 'https://api.1up.gift/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"targetUrl":"example","event":"example"}'};
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.1up.gift/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "targetUrl": "example", "event": "example" }'Registers a URL to be called whenever the event happens on your account. The response carries a signing secret — store it, as it is shown only once, and use it to verify the signature on every delivery.
The target URL must be a publicly reachable HTTPS address.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A request to start receiving an event.
object
The publicly reachable HTTPS URL to POST each event to. Private, loopback and non-HTTPS addresses are rejected.
The event to subscribe to, for example order.created.
Examplegenerated
{ "targetUrl": "example", "event": "example"}A request to start receiving an event.
object
The publicly reachable HTTPS URL to POST each event to. Private, loopback and non-HTTPS addresses are rejected.
The event to subscribe to, for example order.created.
Examplegenerated
{ "targetUrl": "example", "event": "example"}A request to start receiving an event.
object
The publicly reachable HTTPS URL to POST each event to. Private, loopback and non-HTTPS addresses are rejected.
The event to subscribe to, for example order.created.
Examplegenerated
{ "targetUrl": "example", "event": "example"}Responses
Section titled “Responses”The subscription was created.
A created webhook subscription.
object
The subscription id. Pass it to DELETE /webhooks/{id} to stop deliveries.
The event this subscription receives.
The URL each event is POSTed to.
The signing secret for this subscription. Every delivery is signed with it, so store it now — it is returned only when the subscription is created and cannot be retrieved again.
A created webhook subscription.
object
The subscription id. Pass it to DELETE /webhooks/{id} to stop deliveries.
The event this subscription receives.
The URL each event is POSTed to.
The signing secret for this subscription. Every delivery is signed with it, so store it now — it is returned only when the subscription is created and cannot be retrieved again.
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "event": "example", "targetUrl": "example", "secret": "example"}A created webhook subscription.
object
The subscription id. Pass it to DELETE /webhooks/{id} to stop deliveries.
The event this subscription receives.
The URL each event is POSTed to.
The signing secret for this subscription. Every delivery is signed with it, so store it now — it is returned only when the subscription is created and cannot be retrieved again.
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "event": "example", "targetUrl": "example", "secret": "example"}The event is unknown, or the target URL was rejected.
object
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}