SDK reference for the Webhooks API, available in Node.js and Python.
Webhooks
List Webhooks
Returns a page of webhooks in the current workspace. By default, the first 20 matching webhooks are ordered by creation time, newest first. Supplied filters are combined, count reports the total number of matches before pagination, and has_more indicates whether another page is available.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.webhooks.list() # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.webhooks.list(); console.log(result);}run();
Generates a signing secret for verifying webhook deliveries. The secret is not persisted until it is used to create or update a webhook; store it securely.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.webhooks.generate_secret() # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.webhooks.generateSecret(); console.log(result);}run();
Show Response
{ "secret": str,}
{ secret: string;}
Retrieve a Webhook
Retrieves a webhook in the current workspace by ID. The signing secret is returned masked; it is only shown in full when the webhook is created.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.webhooks.get(id="<id>") # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.webhooks.get({ id: "<id>", }); console.log(result);}run();
Deletes a webhook in the current workspace and returns the deleted webhook ID.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.webhooks.delete(id="<id>") # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.webhooks.delete({ id: "<id>", }); console.log(result);}run();
Show Parameters
{ "id": str, # required}
{ id: string; // required}
Show Response
{ "id": str,}
{ id: string;}
Update a Webhook
Updates the supplied fields on a webhook in the current workspace. Omitted fields are unchanged. The response contains the applied fields rather than the complete webhook.
from orq_ai_sdk import Orqimport oswith Orq( api_key=os.getenv("ORQ_API_KEY"),) as orq: res = orq.webhooks.update(id="<id>", request_body={"<key>": "<value>"}) # Handle response print(res)
import { Orq } from "@orq-ai/node";const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "",});async function run() { const result = await orq.webhooks.update({ id: "<id>", requestBody: { "<key>": "<value>", }, }); console.log(result);}run();