Retries

Retries are disabled by default in every SDK.

Why Retries Are Off

Send requests can queue email. If the API accepts a request but the client loses the response, retrying can queue a duplicate email. Enable retries only when your product accepts that risk.

Retryable Conditions

When explicitly enabled, SDKs retry transient transport failures and these HTTP statuses:

408, 425, 429, 500, 502, 503, 504

Validation errors, authentication errors, malformed responses, and known non-retryable API errors are not retried.

Python

client = Workonward(
    api_key=os.environ["WORKONWARD_API_KEY"],
    retry_config=RetryConfig(max_retries=2),
)

TypeScript

const client = new Workonward({
  apiKey: process.env.WORKONWARD_API_KEY!,
  retryConfig: { maxRetries: 2 },
});

Go

retry := workonward.DefaultRetryConfig()
retry.MaxRetries = 2
client, err := workonward.NewClient(apiKey, workonward.WithRetryConfig(retry))

Rust

let mut retry = RetryConfig::disabled();
retry.max_retries = 2;
let client = Client::builder(api_key).retry_config(retry).build()?;