Versions in this module Expand all Collapse all v0 v0.1.0 Aug 4, 2026 Changes in this version + const DefaultBaseURL + const DefaultMaxRetries + const DefaultTimeout + const Version + func IsAuthError(err error) bool + func IsForbidden(err error) bool + func IsNotFound(err error) bool + func IsRateLimited(err error) bool + func IsServerError(err error) bool + func IsValidationError(err error) bool + func NewIdempotencyKey() (string, error) + func Paginate[T any](ctx context.Context, c *Client, path string, query url.Values, perPage int) iter.Seq2[T, error] + type APIError struct + Body []byte + Code int + Message string + StatusCode int + func (e *APIError) Error() string + type APIKey struct + AgentID string + AllowedIPs []string + CreatedAt time.Time + ExpiresAt *time.Time + ID string + IsActive bool + KeyPrefix string + KeyType string + LastUsedAt *time.Time + Name string + RevokedAt *time.Time + Scopes json.RawMessage + type APIKeyCreateResponse struct + Key APIKey + PlaintextKey string + type APIKeysService struct + func (s *APIKeysService) Create(ctx context.Context, req CreateAPIKeyRequest, opts ...RequestOption) (*APIKeyCreateResponse, error) + func (s *APIKeysService) List(ctx context.Context) ([]APIKey, error) + func (s *APIKeysService) Revoke(ctx context.Context, id string, opts ...RequestOption) error + type Assignee struct + AIAgentID *string + AgentID *string + Kind string + Name *string + type Client struct + APIKeys *APIKeysService + Contacts *ContactsService + Conversations *ConversationsService + Messages *MessagesService + Templates *TemplatesService + func NewClient(apiKey string, opts ...Option) (*Client, error) + func (c *Client) BaseURL() string + func (c *Client) Delete(ctx context.Context, path string, out any, opts ...RequestOption) error + func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error) + func (c *Client) Get(ctx context.Context, path string, query url.Values, out any, ...) error + func (c *Client) Post(ctx context.Context, path string, body, out any, opts ...RequestOption) error + func (c *Client) Request(ctx context.Context, method, path string, query url.Values, body, out any, ...) error + type Contact struct + ChannelSource string + CreatedAt time.Time + Email *string + ID string + Name *string + PhoneNumber *string + Tags []string + UpdatedAt time.Time + type ContactListParams struct + Page int + PerPage int + Search string + Tag string + type ContactPage struct + Data []Contact + Page int64 + PerPage int64 + Total int64 + TotalPages int64 + type ContactsService struct + func (s *ContactsService) All(ctx context.Context, params *ContactListParams) iter.Seq2[Contact, error] + func (s *ContactsService) List(ctx context.Context, params *ContactListParams) ([]Contact, error) + func (s *ContactsService) ListPage(ctx context.Context, params *ContactListParams) (*ContactPage, error) + type Conversation struct + AssignedAgentID *string + AssignedAgentName *string + Assignees []Assignee + ContactChannel string + ContactID string + ContactName *string + ContactPhone *string + CreatedAt time.Time + ID string + LastMessageAt time.Time + Status ConversationStatus + UnreadCount int + UpdatedAt time.Time + type ConversationListParams struct + AssignedAgentID string + Page int + PerPage int + Status ConversationStatus + type ConversationStatus string + const ConversationOpen + const ConversationResolved + const ConversationSnoozed + type ConversationsService struct + func (s *ConversationsService) All(ctx context.Context, params *ConversationListParams) iter.Seq2[Conversation, error] + func (s *ConversationsService) Get(ctx context.Context, id string) (*Conversation, error) + func (s *ConversationsService) List(ctx context.Context, params *ConversationListParams) ([]Conversation, error) + func (s *ConversationsService) Messages(ctx context.Context, id string, params *MessageListParams) (*MessageListResponse, error) + func (s *ConversationsService) SendMessage(ctx context.Context, id string, req SendMessageRequest, opts ...RequestOption) (*Message, error) + type CreateAPIKeyRequest struct + AllowedIPs []string + ExpiresAt *time.Time + KeyType string + Name string + type Message struct + Content json.RawMessage + ConversationID string + CreatedAt time.Time + Direction MessageDirection + ErrorCode *string + ErrorDetails json.RawMessage + ErrorMessage *string + ErrorSource *string + ExternalID *string + ID string + SenderPhone *string + SentByAgentID *string + SentByAgentName *string + Status MessageStatus + Type MessageType + func (m *Message) UnmarshalJSON(data []byte) error + func (m Message) Text() (string, bool) + type MessageDirection string + const DirectionInbound + const DirectionOutbound + type MessageListParams struct + Cursor string + Limit int + type MessageListResponse struct + HasMore bool + Messages []Message + NextCursor *string + type MessageSearchPage struct + Page int64 + PerPage int64 + Results []MessageSearchResult + Total int64 + TotalPages int64 + type MessageSearchParams struct + Channel string + ConversationID string + Direction MessageDirection + From string + Page int + PerPage int + Query string + To string + type MessageSearchResult struct + Channel *string + ContactName *string + ContactPhone *string + Content json.RawMessage + ConversationID string + CreatedAt time.Time + Direction MessageDirection + ID string + Snippet string + Type MessageType + type MessageStatus string + const StatusDelivered + const StatusFailed + const StatusPending + const StatusRead + const StatusSent + type MessageType string + const MessageTypeAudio + const MessageTypeContacts + const MessageTypeDocument + const MessageTypeImage + const MessageTypeLocation + const MessageTypePostback + const MessageTypeSticker + const MessageTypeTemplate + const MessageTypeText + const MessageTypeUnknown + const MessageTypeVideo + type MessagesService struct + func (s *MessagesService) Search(ctx context.Context, params *MessageSearchParams) (*MessageSearchPage, error) + type NetworkError struct + Err error + Op string + TimedOut bool + func (e *NetworkError) Error() string + func (e *NetworkError) Unwrap() error + type Option func(*Client) error + func WithBaseURL(raw string) Option + func WithHTTPClient(hc *http.Client) Option + func WithMaxRetries(n int) Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(ua string) Option + type RequestOption func(*requestConfig) + func WithIdempotencyKey(key string) RequestOption + func WithRequestRetries(n int) RequestOption + type SendMessageRequest struct + Content json.RawMessage + Type MessageType + func ImageMessage(url, caption string) SendMessageRequest + func TextMessage(text string) SendMessageRequest + type TemplateListParams struct + Category string + Status string + WabaID string + type TemplatesService struct + func (s *TemplatesService) List(ctx context.Context, params *TemplateListParams) ([]WaTemplate, error) + type WaTemplate struct + Category string + Components json.RawMessage + CreatedAt time.Time + HeaderMediaURL *string + ID string + Language string + MetaTemplateID *string + Name string + Status string + UpdatedAt time.Time + WabaID string