Documentation Index
Fetch the complete documentation index at: https://docs.monk.com/llms.txt
Use this file to discover all available pages before exploring further.
Error Handling
All SDK methods returnResult<T, MonkError>. The error enum provides typed variants so you can match on specific failure modes.
Error Variants
| Variant | Description | Retryable |
|---|---|---|
Validation | Bad input caught client-side before any request | No |
Api | Structured error returned by the Monk API | Depends |
Network | DNS, connection, or TLS failure | Yes |
Timeout | Request exceeded the configured deadline | Yes |
CircuitOpen | Circuit breaker is open, server assumed down | No |
BufferFull | In-memory buffer is at capacity | No |
Serialization | Failed to encode the request body | No |
Matching on Errors
Retryable Errors
Callis_retryable() on any MonkError to check whether the error is transient:
Network, Timeout, and Api errors with 5xx or 429 status codes. If you receive a retryable error, it means all retry attempts were exhausted.
Validation
The SDK validates events client-side before making a network call:event_namemust be non-empty- Exactly one of
customer_idorexternal_customer_idmust be provided - Batch size must not exceed 10,000 events
API Errors
MonkError::Api includes structured fields from the server response:
| Field | Type | Description |
|---|---|---|
status | u16 | HTTP status code |
code | String | Machine-readable error code (e.g. UNAUTHORIZED) |
message | String | Human-readable error description |
request_id | String | Unique request ID for debugging with Monk support |
retryable | bool | Whether this error is retryable |