Webhooks
Webhooks let NetOrca push event notifications to your systems in real time. When a change instance reaches a configured state, NetOrca sends an HTTP POST to your registered URL.
Accessed via client.webhooks.
Model properties
| Property | Type | Description |
|---|---|---|
id |
int |
Webhook ID |
name |
str |
Display name |
description |
str |
Optional description |
target_url |
str |
Destination URL NetOrca will call |
service |
str |
Service this webhook is scoped to |
active |
bool |
Whether the webhook is enabled |
authorization |
str |
Authorization header value sent with each call |
change_instance_state |
str |
Change instance state that triggers this webhook |
verify |
bool |
Whether to verify SSL on the destination URL |
timeout |
int |
Request timeout in seconds (0–60) |
trigger_wait_time |
int |
Seconds to wait before triggering (min 5) |
trigger_cooling_time |
int |
Cooldown seconds between triggers (min 5) |
created |
datetime |
Creation timestamp |
modified |
datetime |
Last modified timestamp |
Methods
list(**filters)
Returns a lazy generator of all registered webhooks.
Filters:
| Filter | Type | Description |
|---|---|---|
active |
bool |
Filter by active status |
ordering |
str |
Sort field — prefix with - for descending |
for webhook in client.webhooks.list():
print(webhook.id, webhook.target_url, webhook.active)
# Only active webhooks
for webhook in client.webhooks.list(active=True):
print(webhook.target_url)
filter(**filters)
Same as list() but returns all results as a list. Accepts the same filters.
get(id)
Retrieves a single webhook by ID. Raises NetorcaNotFoundError if not found.
webhook = client.webhooks.get(7)
print(webhook.id)
print(webhook.target_url)
print(webhook.active)
print(webhook.change_instance_state)
print(webhook.created)
create(data)
Registers a new webhook. target_url and service are required.
| Field | Type | Required | Description |
|---|---|---|---|
target_url |
str |
yes | The endpoint URL NetOrca will POST to |
service |
str/int |
yes | Service ID this webhook is scoped to |
name |
str |
no | Display name |
description |
str |
no | Optional description |
active |
bool |
no | Enable immediately (default: True) |
authorization |
str |
no | Value sent as the Authorization header |
change_instance_state |
str |
no | State that triggers the webhook |
verify |
bool |
no | Verify SSL certificate on destination (default: True) |
timeout |
int |
no | Request timeout in seconds (0–60) |
trigger_wait_time |
int |
no | Delay in seconds before triggering (min 5) |
trigger_cooling_time |
int |
no | Cooldown between triggers in seconds (min 5) |
webhook = client.webhooks.create({
"target_url": "https://your-service.example.com/netorca/events",
"service": 45,
"name": "Change Instance Notifier",
"active": True,
"change_instance_state": "PENDING",
"authorization": "Bearer your-token"
})
print(webhook.id)
update(id, data, partial=True)
Updates a webhook registration. Defaults to PATCH — only supplied fields change.
# Disable a webhook temporarily
client.webhooks.update(7, {"active": False})
# Re-enable and change the target URL
client.webhooks.update(7, {
"active": True,
"target_url": "https://new-endpoint.example.com/netorca"
})
delete(id)
Permanently removes a webhook. NetOrca stops sending events to that URL.
trigger(webhook_id)
Manually fires a webhook, sending a test payload to its target_url. Use this to verify your endpoint is reachable and handles the payload correctly.