Package-level declarations

Types

Link copied to clipboard

Main entry point for the AgentMail SDK. Holds all top-level API resources (inboxes, threads, drafts, domains, pods, webhooks, lists, metrics, apiKeys, organization). Created via companion object invoke with optional DSL configuration. Implements Closeable to release the underlying HTTP client. Supports scoped access via inboxes and pods for nested resources.

Link copied to clipboard
data class AgentMailConfig(val apiKey: String, val baseUrl: String, val timeout: TimeoutConfig, val retry: RetryConfig, val perSenderRateLimiter: RateLimiterConfig? = null, val perRecipientRateLimiter: RateLimiterConfig? = null)

Immutable configuration for the AgentMail HTTP client.

Link copied to clipboard

DSL builder for configuring an AgentMailClient instance. Allows setting the API key, base URL, timeout, and retry settings.

Link copied to clipboard
annotation class AgentMailDsl

DSL marker annotation used to restrict scope in AgentMail builder lambdas.

Link copied to clipboard

Action to take when a rate limit is exceeded.

Link copied to clipboard

DSL builder for configuring a per-key rate limiter with max messages and time window.

Link copied to clipboard
data class RateLimiterConfig(val maxMessages: Int, val window: Duration, val onLimitExceeded: RateLimitAction = RateLimitAction.STOP)

Immutable rate limiter configuration with max messages allowed within a sliding time window.

Link copied to clipboard
class RateLimitExceededException(val key: String, val maxMessages: Int, val window: Duration) : RuntimeException

Thrown when a rate limit is exceeded and the action is RateLimitAction.STOP.

Link copied to clipboard

DSL builder for configuring HTTP retry behavior.

Link copied to clipboard
data class RetryConfig(val maxRetries: Int, val retryOnServerErrors: Boolean)

Immutable retry configuration with max retries and server error retry toggle.

Link copied to clipboard

DSL builder for configuring HTTP timeout durations.

Link copied to clipboard
data class TimeoutConfig(val connect: Duration, val request: Duration, val socket: Duration)

Immutable timeout configuration with connect, request, and socket durations.