SparkLoop
  • API v2
    • Endpoints
      • Subscribers
        • Events
      • Referral Campaigns
        • Campaign Memberships
        • Subscribers
      • Partner Profile
        • Recommendations
        • Payouts
      • Publications
      • Upscribe
        • Recommendations
      • Partner Programs
      • Partner Network
        • Publications
        • Partner Programs
      • Webhooks
    • Schemas
      • Partner Profile Object
      • Partner Program Object
      • Publication Object
      • Subscriber Object
      • Campaign Object
      • Upscribe Object
      • Recommendation Object
    • Guides
      • How to use Upscribe via API
  • API v1
    • Campaigns
    • Subscribers
    • Events
    • Webhooks
  • Webhooks
  • Changelog
Powered by GitBook
On this page
  • Create new webhook
  • Get webhooks
  • Get a webhook by UUID
  • Update a webhook
  • Delete a webhook

Was this helpful?

  1. API v2
  2. Endpoints

Webhooks

Create new webhook

POST https://api.sparkloop.app/v2/webhooks

Request Body

Name
Type
Description

url*

String

Webhook's URL

new_referral

boolean

If you want to receive webhook notifications for new referrals in referral programs

reward_unlocked

boolean

If you want to receive webhook notifications when rewards are unlocked

new_partner_referral

String

If you want to receive webhook notifications for new referrals from partners

reward_redeemed

String

If you want to receive webhook notifications when rewards are redeemed

{
    "webhook": {
        "uuid": "webhook_ac06a45cb5",
        "url": "https://webhook.site/6819636c-fd8d-45bd-a1bf-e154cd9f2d68",
        "events": {
            "new_referral": true,
            "reward_unlocked": false
        }
    }
}
{
    "error": "Url must start with https://"
}

Get webhooks

GET https://api.sparkloop.app/v2/webhooks

Webhooks are returned in descending order of creation.

{
    "webhooks": [
        {
            "uuid": "webhook_6f06b5421a",
            "url": "https://webhook.site/9a470b66-2d72-413e-b42d-c59c61cd4be6",
            "events": {
                "new_referral": false,
                "reward_unlocked": true
            }
        },
        {
            "uuid": "webhook_e4a23cc058",
            "url": "https://webhook.site/9a470b66-2d72-413e-b42d-c59c61cd4be6",
            "events": {
                "new_referral": true,
                "reward_unlocked": false
            }
        }
    ]
}
{
    "error": "Campaign MF9a7d8983d1c not found!"
}

Get a webhook by UUID

GET https://api.sparkloop.app/v2/webhooks/:identifier

Path Parameters

Name
Type
Description

identifier*

String

Webhook's UUID

{
    "webhook": {
        "uuid": "webhook_ac06a45cb5",
        "url": "https://webhook.site/6819636c-fd8d-45bd-a1bf-e154cd9f2d68",
        "events": {
            "new_referral": true,
            "new_partner_referral": null,
            "reward_unlocked": null,
            "reward_redeemed": true
        }
    }
}
{
    "error": "Webhook uuid blank!"
}
{
    "error": "Webhook webhook_ABC not found!"
}

Update a webhook

PUT https://api.sparkloop.app/v2/webhooks/:identifier

Path Parameters

Name
Type
Description

identifier*

String

Webhook's UUID

Request Body

Name
Type
Description

url

String

Webhook's URL

new_referral

boolean

If you want to receive webhook notifications for new referrals

reward_unlocked

boolean

If you want to receive webhook notifications when rewards are unlocked

new_partner_referral

String

If you want to receive webhook notifications for new referrals from partners

reward_redeemed

String

If you want to receive webhook notifications when rewards are redeemed

{
    "webhook": {
        "uuid": "webhook_ac06a45cb5",
        "url": "https://webhook.site/6819636c-fd8d-45bd-a1bf-e154cd9f2d68",
        "events": {
            "new_referral": true,
            "new_partner_referral": null,
            "reward_unlocked": null,
            "reward_redeemed": true
        }
    }
}
{
    "error": "Url must start with https://"
}

Delete a webhook

DELETE https://api.sparkloop.app/v2/webhooks/:identifier

Path Parameters

Name
Type
Description

identifier*

String

Webhook's UUID

{
    "message": "Successfully deleted webhook webhook_abc"
}
{
    "error": "Webhook uuid blank!"
}
{
    "error": "Webhook webhook_ABC not found!"
}
PreviousPartner ProgramsNextSchemas

Last updated 7 months ago

Was this helpful?