Webhooks
List the webhook subscriptions on your account from Python.
The client.webhooks resource maps to the Webhooks listing endpoint.
In the current SDK release, webhooks is read-only. You can fetch the webhooks already configured on your account, but you create, update, and test them from the dashboard. Mutation methods will land here once they are part of the public REST surface.
List your webhooks¶
for hook in client.webhooks.list():
print(hook.id, hook.url, hook.event_types, hook.is_active)
REST equivalent: GET /api/v1/webhooks/.
What a Webhook contains¶
| Attribute | Type | What it is |
|---|---|---|
id |
str |
Webhook identifier. |
url |
str |
The endpoint Vilvik posts to. |
event_types |
list[str] |
The events this subscription receives. |
is_active |
bool |
Whether Vilvik is currently delivering to this hook. |
created_at |
datetime \| None |
When the subscription was created. |
raw |
dict |
The full server response, preserved for forward compatibility. |
How to use webhooks with the SDK¶
A common pattern: send a webhook URL with each submission so your service learns when a run finishes, then use the SDK to fetch the full result.
sub = client.submissions.create(
fitness_func=src,
num_genes=5,
webhook_url="https://example.com/vilvik/done",
)
# In your webhook handler:
result = client.results.list(submission_id=sub.id, limit=1).items[0]
See Webhooks for the payload shape and retry behaviour.