Back to Changelog
|v0.1.1

SDK Webhook and WebSocket Fixes

sdkbugfixbreaking

The TypeScript and Python SDKs have been updated to v0.1.1 with fixes to webhook delivery methods and WebSocket message formats. These changes align the SDKs with the actual API surface.

Webhook Delivery Methods

The webhook endpoint resource accessor has been renamed for consistency with the API path structure:

TypeScript SDK:

  • client.webhookEndpoints.create(...) (was client.webhooks.endpoints.create(...))
  • client.webhookEndpoints.list(...) (was client.webhooks.endpoints.list(...))
  • client.webhookEndpoints.get(id) (was client.webhooks.endpoints.get(id))
  • client.webhookEndpoints.update(id, data) (was client.webhooks.endpoints.update(id, data))
  • client.webhookEndpoints.delete(id) (was client.webhooks.endpoints.delete(id))
  • client.webhookEndpoints.listDeliveries(id, params?) (new -- replaces client.webhooks.deliveries.list(...))

Python SDK:

  • client.webhook_endpoints.create(...) (was client.webhooks.endpoints.create(...))
  • client.webhook_endpoints.list_deliveries(endpoint_id, ...) (new -- replaces client.webhooks.deliveries.list(...))

WebSocket Subscribe Format

The WebSocket subscribe message now uses type instead of action, event_types instead of events, and environment_ids (string array) instead of env_id (string):

{
  "type": "subscribe",
  "event_types": ["message.received"],
  "environment_ids": ["env_01JQ..."]
}

Previously, the subscribe message used "action": "subscribe" with "env_id" as a single string.

WebhookDelivery Type Alignment

The WebhookDelivery type fields have been aligned with the actual API response shape:

  • http_status (was response_status_code)
  • attempt_number (was attempt)
  • Added event_id, endpoint_id, response_body, created_at fields

Upgrade Guide

Update your SDK dependency to v0.1.1:

# TypeScript
npm install @agentpost/sdk@0.1.1

# Python
pip install agentpost==0.1.1

Then update any code that references the old accessor paths or field names. Search your codebase for client.webhooks.endpoints, client.webhooks.deliveries, response_status_code, and "action": "subscribe" to find all occurrences that need updating.