Skip to main content
PUT
/
core
/
webhooks
/
{webhook_id}
Update Webhook
curl --request PUT \
  --url https://api.rootfi.dev/v3/core/webhooks/{webhook_id} \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "operations": [
    "CREATE"
  ],
  "name": "webhook 1",
  "type": "CONNECTION_CHANGED",
  "data_models": [
    "ACCOUNTS"
  ],
  "url": "https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697",
  "headers": {
    "api_key": "fhsjd"
  }
}
'
import requests

url = "https://api.rootfi.dev/v3/core/webhooks/{webhook_id}"

payload = {
"operations": ["CREATE"],
"name": "webhook 1",
"type": "CONNECTION_CHANGED",
"data_models": ["ACCOUNTS"],
"url": "https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697",
"headers": { "api_key": "fhsjd" }
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: ['CREATE'],
name: 'webhook 1',
type: 'CONNECTION_CHANGED',
data_models: ['ACCOUNTS'],
url: 'https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697',
headers: {api_key: 'fhsjd'}
})
};

fetch('https://api.rootfi.dev/v3/core/webhooks/{webhook_id}', 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.rootfi.dev/v3/core/webhooks/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
'CREATE'
],
'name' => 'webhook 1',
'type' => 'CONNECTION_CHANGED',
'data_models' => [
'ACCOUNTS'
],
'url' => 'https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697',
'headers' => [
'api_key' => 'fhsjd'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);

$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.rootfi.dev/v3/core/webhooks/{webhook_id}"

payload := strings.NewReader("{\n \"operations\": [\n \"CREATE\"\n ],\n \"name\": \"webhook 1\",\n \"type\": \"CONNECTION_CHANGED\",\n \"data_models\": [\n \"ACCOUNTS\"\n ],\n \"url\": \"https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697\",\n \"headers\": {\n \"api_key\": \"fhsjd\"\n }\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("api_key", "<api-key>")
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.put("https://api.rootfi.dev/v3/core/webhooks/{webhook_id}")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n \"CREATE\"\n ],\n \"name\": \"webhook 1\",\n \"type\": \"CONNECTION_CHANGED\",\n \"data_models\": [\n \"ACCOUNTS\"\n ],\n \"url\": \"https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697\",\n \"headers\": {\n \"api_key\": \"fhsjd\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.rootfi.dev/v3/core/webhooks/{webhook_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n \"CREATE\"\n ],\n \"name\": \"webhook 1\",\n \"type\": \"CONNECTION_CHANGED\",\n \"data_models\": [\n \"ACCOUNTS\"\n ],\n \"url\": \"https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697\",\n \"headers\": {\n \"api_key\": \"fhsjd\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "THBROZzWGuL3b8qEEdBF",
    "headers": {
      "api_key": "fhsjd"
    },
    "operations": [
      "CREATE"
    ],
    "data_models": [
      "ACCOUNTS"
    ],
    "name": "webhook 1",
    "created_at": "2024-04-15T04:52:25.309Z",
    "type": "CONNECTION_CHANGED",
    "url": "https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697"
  }
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}

Authorizations

api_key
string
header
required

Path Parameters

webhook_id
string
required

The ID of the webhook to update

Body

application/json

The data of the webhooks endpoint

operations
enum<string>[]
required

The operations of the webhook

Available options:
CREATE,
UPDATE,
DELETE
name
string
required

The name of the webhook

Example:

"webhook 1"

type
enum<string>
required

The type of the webhook

Available options:
DATA_MODEL_CHANGES,
CONNECTION_CHANGED,
SYNC_COMPLETED
data_models
enum<string>[]
required

The data models of the webhook

Available options:
ACCOUNTS,
BANK_ACCOUNTS,
BILLS,
BILL_PAYMENTS,
COMPANY_INFO,
CONTACTS,
BILL_CREDIT_NOTES,
INVOICE_CREDIT_NOTES,
DOCUMENTS,
EXPENSES,
INVOICES,
INVOICE_PAYMENTS,
ITEMS,
LINE_ITEMS,
TAX_RATES,
JOURNAL_ENTRIES,
BANK_TRANSACTIONS,
JOURNAL_LINES,
PURCHASE_ORDERS,
SALES_ORDERS,
PHONE_NUMBERS,
ADDRESSES,
EXTERNAL_LINKS,
CONTACT_PERSONS,
INCOME_STATEMENT,
BALANCE_SHEET,
TRACKING_CATEGORIES,
CASH_FLOW_STATEMENT,
CURRENCIES,
PAYMENT_CUSTOMERS,
PAYMENT_INVOICES,
PAYMENT_LINE_ITEMS,
PAYMENT_ITEMS,
PAYMENT_ORDERS,
PAYMENT_TAX_RATES,
PAYMENT_DISPUTES,
PAYMENT_PAYMENTS,
PAYMENT_REFUNDS,
PAYMENT_PAYMENT_LINKS,
PAYMENT_PAYOUTS,
PAYMENT_ADDRESSES,
PAYMENT_PHONE_NUMBERS,
PAYMENT_EXTERNAL_LINKS,
PAYMENT_TRANSACTIONS,
PAYMENT_BALANCES,
ECOMMERCE_ORDERS,
ECOMMERCE_CUSTOMERS,
ECOMMERCE_PRODUCTS,
ECOMMERCE_LINE_ITEMS,
CRM_CONTACTS,
CRM_COMPANIES,
CRM_DEALS,
CRM_LEADS,
CRM_NOTES,
CRM_PIPELINES,
CRM_STAGES,
CRM_ACTIVITIES,
CRM_TASKS,
CRM_USERS,
CRM_EXTERNAL_LINKS,
CRM_PHONE_NUMBERS,
CRM_ADDRESSES
url
string
required

The URL of the webhook

Example:

"https://webhook.site/eec24873-a381-4694-b684-a1d77d9e0697"

headers
object
required

The headers of the webhook

Response

The data of the invite link endpoint

data
coreWebhookData · object
required

The data of the webhook