Versions in this module Expand all Collapse all v1 v1.0.0 Jul 5, 2026 Changes in this version + const DefaultBaseURL + const DefaultTimeout + var ErrInsufficientBalance = &Error + var ErrInvalidApiToken = &Error + var ErrRateLimit = &Error + var ErrServiceUnavailable = &Error + var ErrValidation = &Error + func Recipients(values ...string) []string + type Client struct + func NewClient(token string, opts ...Option) *Client + func (c *Client) Balance(ctx context.Context) (map[string]any, error) + func (c *Client) Campaign(ctx context.Context, id int) (map[string]any, error) + func (c *Client) CreateWebhook(ctx context.Context, webhookURL string, events []string) (map[string]any, error) + func (c *Client) DeleteWebhook(ctx context.Context, id int) (map[string]any, error) + func (c *Client) Lookup(ctx context.Context, numbers []string) (map[string]any, error) + func (c *Client) LookupResult(ctx context.Context, id int) (map[string]any, error) + func (c *Client) Lookups(ctx context.Context) (map[string]any, error) + func (c *Client) Message(ctx context.Context, id int) (map[string]any, error) + func (c *Client) OTP(ctx context.Context, to, sender, channel, purpose string, length, expiry int, ...) (map[string]any, error) + func (c *Client) Pricing(ctx context.Context, country string) (map[string]any, error) + func (c *Client) SMS(ctx context.Context, recipients []string, message, sender, gateway string) (map[string]any, error) + func (c *Client) Verify(ctx context.Context, to, code, channel string) (bool, error) + func (c *Client) VerifyEmail(ctx context.Context, emails []string) (map[string]any, error) + func (c *Client) VerifyOTP(ctx context.Context, to, code, channel string) (map[string]any, error) + func (c *Client) Voice(ctx context.Context, recipients []string, ...) (map[string]any, error) + func (c *Client) VoiceStatus(ctx context.Context, id int) (map[string]any, error) + func (c *Client) Webhooks(ctx context.Context) (map[string]any, error) + type Error struct + Body map[string]any + Kind Kind + Message string + StatusCode int + func (e *Error) Error() string + func (e *Error) Errors() map[string]any + func (e *Error) Is(target error) bool + type Kind int + const KindGeneric + const KindInsufficientBalance + const KindInvalidApiToken + const KindRateLimit + const KindServiceUnavailable + const KindValidation + type Option func(*Client) + func WithBaseURL(baseURL string) Option + func WithDefaultSender(sender string) Option + func WithHTTPClient(h *http.Client) Option + func WithTimeout(d time.Duration) Option