Subscriptions
Subscribe
Create a new subscription on a webhook.
The payload contains the following fields:
eventSource: the name of the webhook to subscribe for. Refer to the Events section to find the list of all available webhooks.targetUrl: the HTTP callback that will receive the webhook payloads.
The response contains the HTTP header Kiflo-Webhook-SigningKey. This is a randomly generated signing key used to sign webhook payloads.
You must store it securely on your end as it will not be returned again.
POST
/
v3
/
subscriptions
Subscribe
curl --request POST \
--url https://api.example.com/v3/subscriptions \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"targetUrl": "https://your-app.com/webhooks/kiflo"
}
'import requests
url = "https://api.example.com/v3/subscriptions"
payload = { "targetUrl": "https://your-app.com/webhooks/kiflo" }
headers = {"Content-Type": "application/json-patch+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({targetUrl: 'https://your-app.com/webhooks/kiflo'})
};
fetch('https://api.example.com/v3/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v3/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'targetUrl' => 'https://your-app.com/webhooks/kiflo'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v3/subscriptions"
payload := strings.NewReader("{\n \"targetUrl\": \"https://your-app.com/webhooks/kiflo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v3/subscriptions")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"targetUrl\": \"https://your-app.com/webhooks/kiflo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v3/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"targetUrl\": \"https://your-app.com/webhooks/kiflo\"\n}"
response = http.request(request)
puts response.read_body123Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Request body for creating a webhook subscription.
Available options:
Unknown, ContactNew, ContactUpdate, PartnerNew, PartnerUpdate, PartnerNote, PartnerOnboardingStageUpdate, PartnerApplicationNew, PartnerApplicationAccepted, PartnerApplicationRejected, PartnerOwnerChanged, TeamMemberAdded, TeamMemberDeleted, DealNew, DealUpdate, DealApprovalRequire, DealAccept, DealRefuse, DealNote, DealScheduledRewardValidation, DealAssign, DealStageChange, LeadNew, LeadShare, LeadAccept, LeadRefuse, LeadUpdate, LeadNote, LeadAssign, LeadAbandon, LeadOwnerChanged, LeadNewFromPartnerDirectory, DealExpiration, DealExpirationReminder, RewardNew, CustomerNew, CustomerUpdate, CustomerNote, TransactionNew, TransactionUpdate, ProgramNewPartnerInLevel, PayoutNote, PayoutValidated, PayoutAccepted, PayoutPaid, PayoutNew, PayoutStatusChange, PayoutInvoiceUploaded, TaskDueToday, TaskAssigned, DealQuoteRequested, DealClosedWon, DealOwnerChanged, AssetNew, NewsNew, OnboardingNewPartnerInStage, OnboardingActionWaitingForApproval, OnboardingActionValidated, OnboardingActionInvalidated, TeamMemberCertificationExpired, TeamMemberCertificationExpirationReminder, CommentNew, MentionNew, PartnerStatusUpdated, PartnerProspectionStageUpdated, OnboardingStatusChanged, OnboardingStageStatusChanged, BusinessPlanObjectiveUpdated, PartnerAttachment, LeadAttachment, DealAttachment, CustomerAttachment, TransactionAttachment, PayoutAttachment, CollaborationAttachment, AccountMappingOverlap, CollaborationNew, CollaborationAccepted, CollaborationRefused, CollaborationAbandoned, CollaborationReopened, CollaborationConvertedToLead, CollaborationConvertedToDeal, CollaborationNote Response
200 - application/json
Subscription created. Check the Kiflo-Webhook-SigningKey response header for your signing key.
The response is of type integer<int32>.
Subscribe
curl --request POST \
--url https://api.example.com/v3/subscriptions \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"targetUrl": "https://your-app.com/webhooks/kiflo"
}
'import requests
url = "https://api.example.com/v3/subscriptions"
payload = { "targetUrl": "https://your-app.com/webhooks/kiflo" }
headers = {"Content-Type": "application/json-patch+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({targetUrl: 'https://your-app.com/webhooks/kiflo'})
};
fetch('https://api.example.com/v3/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v3/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'targetUrl' => 'https://your-app.com/webhooks/kiflo'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v3/subscriptions"
payload := strings.NewReader("{\n \"targetUrl\": \"https://your-app.com/webhooks/kiflo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v3/subscriptions")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"targetUrl\": \"https://your-app.com/webhooks/kiflo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v3/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"targetUrl\": \"https://your-app.com/webhooks/kiflo\"\n}"
response = http.request(request)
puts response.read_body123
