curl --request POST \
--url https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"active": true,
"id": 12
}
]
}
'import requests
url = "https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload = { "inputs": [
{
"active": True,
"id": 12
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: [{active: true, id: 12}]})
};
fetch('https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update', 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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update",
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([
'inputs' => [
[
'active' => true,
'id' => 12
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"completedAt": "2020-04-17T02:19:26.283Z",
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
},
{
"active": false,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.create",
"id": "4567",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"completedAt": "2020-04-17T02:19:26.283Z",
"errors": [
{
"category": "SUBSCRIPTION_ID_NOT_FOUND",
"context": {
"subscriptionIds": [
"4567"
]
},
"message": "Failed to find subscriptions by id `4567`. Try again using a different subscriptionId.",
"status": "error",
"subCategory": "SubscriptionErrors.SUBSCRIPTION_IDS_NOT_FOUND"
}
],
"numErrors": 1,
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Batch create event subscriptions
Batch create event subscriptions for the specified app.
curl --request POST \
--url https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"active": true,
"id": 12
}
]
}
'import requests
url = "https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload = { "inputs": [
{
"active": True,
"id": 12
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: [{active: true, id: 12}]})
};
fetch('https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update', 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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update",
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([
'inputs' => [
[
'active' => true,
'id' => 12
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update"
payload := strings.NewReader("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/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.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/webhooks/v3/{appId}/subscriptions/batch/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n {\n \"active\": true,\n \"id\": 12\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"completedAt": "2020-04-17T02:19:26.283Z",
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
},
{
"active": false,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.create",
"id": "4567",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"completedAt": "2020-04-17T02:19:26.283Z",
"errors": [
{
"category": "SUBSCRIPTION_ID_NOT_FOUND",
"context": {
"subscriptionIds": [
"4567"
]
},
"message": "Failed to find subscriptions by id `4567`. Try again using a different subscriptionId.",
"status": "error",
"subCategory": "SubscriptionErrors.SUBSCRIPTION_IDS_NOT_FOUND"
}
],
"numErrors": 1,
"results": [
{
"active": true,
"createdAt": "2019-06-06T16:56:16.652Z",
"eventType": "contact.propertyChange",
"id": "1234",
"propertyName": "firstname",
"updatedAt": "2019-08-06T16:56:16.652Z"
}
],
"startedAt": "2020-04-17T02:19:26.256Z",
"status": "COMPLETE"
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Supported products
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The ID of the target app.
Body
Updated details for the specified subscriptions.
An array of SubscriptionBatchUpdateRequest objects, each representing the updated settings for a specific webhook subscription in the batch operation.
Show child attributes
Show child attributes
Response
successful operation
The timestamp when the batch operation completed, in ISO 8601 format.
An array containing the successfully processed webhook subscriptions from the batch operation.
Show child attributes
Show child attributes
The timestamp when the batch operation started processing, in ISO 8601 format.
The status of the batch operation. Accepted values are 'PENDING', 'PROCESSING', 'CANCELED', or 'COMPLETE'.
CANCELED, COMPLETE, PENDING, PROCESSING An object containing URLs for related resources or operations.
Show child attributes
Show child attributes
The timestamp when the batch operation was requested, in ISO 8601 format.
Was this page helpful?