- list - List webhooks
- create - Create a webhook
- count - Count webhooks
query- Query webhooks⚠️ Deprecated- generate_secret - Generate a webhook secret
- get - Retrieve a webhook
- delete - Delete a webhook
- update - Update a webhook
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 Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.list()
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
page |
Optional[int] | ➖ | One-based page number. Defaults to 1 and must be between 1 and 1,000,000. |
limit |
Optional[int] | ➖ | Number of webhooks to return per page. Defaults to 20 and must be between 1 and 200. |
search |
Optional[str] | ➖ | Optional case-insensitive substring matched against display name, content type, and URL. Maximum length is 200 characters. |
event |
Optional[str] | ➖ | Optional event slug that must be present in the webhook's event subscriptions, for example llm.response. Maximum length is 200characters. |
sort |
Optional[str] | ➖ | Field used to order results. Allowed values are created, updated, anddisplay_name. Defaults to created. |
direction |
Optional[str] | ➖ | Sort direction. Allowed values are asc and desc. Defaults to desc. |
content_type |
Optional[str] | ➖ | Optional comma-separated content types to match, for exampleapplication/json,application/x-www-form-urlencoded. A webhook matcheswhen its content type equals any supplied value. |
enabled |
Optional[bool] | ➖ | Optional delivery status filter. When omitted, enabled and disabled webhooks are returned. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Creates a webhook that delivers the selected workspace events to an HTTPS endpoint. Generate a signing secret first with GET /v2/webhooks/secret.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.create(id="<id>", url="https://outlying-tenement.name/", content_type="application/json", display_name="June.Hand", events=[
"<value 1>",
"<value 2>",
], secret="<value>")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id |
str | ✔️ | Client-generated webhook ID. | |
url |
str | ✔️ | HTTPS endpoint that receives webhook deliveries. | https://hooks.example.com/webhooks/orq |
content_type |
models.CreateWebhookRequestContentType | ✔️ | Content type sent with webhook deliveries. | |
display_name |
str | ✔️ | Human-readable webhook name. | Deployment notifications |
events |
List[str] | ✔️ | One or more workspace event slugs that trigger a delivery, for example deployment.invoked or llm.response. |
|
secret |
str | ✔️ | Signing secret returned by GET /v2/webhooks/secret. Deliveries set X-Orq-Signature to the lowercase hexadecimal HMAC-SHA256 of the exact request body bytes. |
|
enabled |
Optional[bool] | ➖ | Whether webhook deliveries are enabled. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Returns the total number of enabled and disabled webhooks in the current workspace.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.count()
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Deprecated. Returns webhooks matching legacy query filters. Use GET /v2/webhooks for pagination, search, event filtering, and sorting.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.query()
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
pagination |
Optional[models.QueryParamsPagination] | ➖ | N/A |
sorting_props |
List[models.QueryParamsSort] | ➖ | N/A |
query |
Optional[models.Query] | ➖ | N/A |
filters |
List[models.Filters] | ➖ | N/A |
included_fields |
Dict[str, str] | ➖ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
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 Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.generate_secret()
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.GenerateWebhookSecretResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
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 Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.get(id="<id>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
Deletes a webhook in the current workspace and returns the deleted webhook ID.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.delete(id="<id>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |
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 Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.webhooks.update(id="<id>", request_body={})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | N/A |
request_body |
models.WebhookUpdateRequestBody | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.WebhookUpdateResponseBody
| Error Type | Status Code | Content Type |
|---|---|---|
| models.APIDefaultError | 4XX, 5XX | */* |