Errors
The SDK throwsApiError for non-2xx API responses and network failures.
ApiError.status is 0 for network failures. For API responses, status is the HTTP status code, body contains the parsed response when available, and requestId is populated from the response headers when present.
WebhookSignatureError
webhooks.constructEvent throws WebhookSignatureError when the
x-tryagent-signature header fails HMAC verification. Treat it as a 401 — a
verified event is safe to act on, an unverified one is not.