メインコンテンツへスキップ
POST
/
webhooks
/
v3
/
{appId}
/
subscriptions
/
batch
/
update
イベント配信登録をバッチ作成
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

承認

Authorization
string
header
必須

The access token received from the authorization server in the OAuth 2.0 flow.

パスパラメータ

appId
integer<int32>
必須

ターゲットアプリのID。

ボディ

application/json

Updated details for the specified subscriptions.

inputs
object[]
必須

SubscriptionBatchUpdateRequestオブジェクトの配列。各オブジェクトは、バッチ処理における特定のWebhook配信登録の更新済み設定を表します。

レスポンス

successful operation

completedAt
string<date-time>
必須

バッチ処理が完了した時刻のタイムスタンプ(ISO 8601形式)。

results
object[]
必須

バッチ処理で正常に処理されたWebhook配信登録が含まれる配列。

startedAt
string<date-time>
必須

バッチ処理が開始された時刻のタイムスタンプ(ISO 8601形式)。

status
enum<string>
必須

バッチ処理のステータス。取り得る値は「PENDING」、「PROCESSING」、「CANCELED」、または「COMPLETE」です。

利用可能なオプション:
CANCELED,
COMPLETE,
PENDING,
PROCESSING

関連リソースまたは処理のURLが含まれるオブジェクト。

requestedAt
string<date-time>

バッチ処理が要求された時刻のタイムスタンプ(ISO 8601形式)。

最終更新日 2026年4月10日