Versions in this module Expand all Collapse all v1 v1.0.0 Nov 5, 2026 Changes in this version + const CodeAIUnavailable + const CodeAPIRequiresPaidPlan + const CodeCustomerLimitReached + const CodeIdempotencyInProgress + const CodeIdempotencyKeyReused + const CodeInsufficientScope + const CodeInvalidAPIKey + const CodeInvalidIdempotencyKey + const CodeMissingAPIKey + const CodeRateLimited + const CodeResponseTooLargeReplay + const DefaultBaseURL + const DefaultWebhookTolerance + const EventDealStageChanged + const EventLeadCreated + const EventOutreachReplied + const EventOutreachSent + const EventSearchCancelled + const EventSearchCompleted + const EventSearchFailed + const EventWebhookTest + const SignatureHeader + const ToneCasual + const ToneProfessional + const ToneShort + const Version + var ErrWebhookMalformedSignature = errors.New("custfind: malformed Custfind-Signature header") + var ErrWebhookSignatureMismatch = errors.New("custfind: webhook signature mismatch") + var ErrWebhookTimestamp = errors.New("custfind: webhook timestamp outside tolerance") + func HasCode(err error, code string) bool + func IsNotFound(err error) bool + func IsPaymentRequired(err error) bool + func Ptr[T any](v T) *T + func VerifyWebhookSignature(payload []byte, header, secret string, tolerance time.Duration) error + type Balance struct + Credits map[string]int + FairUseHardReached bool + FairUseSoftReached bool + MonthlyCredits map[string]int + PeriodEnd *time.Time + Plan string + SubscriptionStatus string + type Call struct + CreatedAt time.Time + DurationSeconds int + ErrorMessage string + ID string + LeadID string + MinutesCharged int + RecordingURL string + Status string + Summary string + Transcript string + UpdatedAt time.Time + type Client struct + Customers *CustomersService + Deals *DealsService + Leads *LeadsService + Outreach *OutreachService + Pipelines *PipelinesService + Searches *SearchesService + SenderAccounts *SenderAccountsService + Webhooks *WebhooksService + func NewClient(opts ...Option) (*Client, error) + func (c *Client) Balance(ctx context.Context) (*Balance, error) + func (c *Client) Me(ctx context.Context) (*Me, error) + func (c *Client) Usage(ctx context.Context, params UsageParams) (*Usage, error) + type CreateDealParams struct + AssignedUserID string + Currency string + LeadID string + StageID string + Title string + ValueCents *int64 + type CreateSearchParams struct + CountryCode string + ExternalCustomerID string + Language string + Latitude *float64 + Limit int + Location string + Longitude *float64 + RadiusKm *float64 + SearchMode string + Sector string + SellerProfileID string + type CreateSenderAccountParams struct + Email string + ExternalCustomerID string + Name string + SMTPHost string + SMTPPass string + SMTPPort int + SMTPUser string + type CreateWebhookParams struct + Description string + Events []string + URL string + type Customer struct + ExternalCustomerID string + MonthlyCreditLimit *int + PeriodStart time.Time + Remaining *int + SpentThisMonth int + type CustomersService struct + func (s *CustomersService) Get(ctx context.Context, externalCustomerID string) (*Customer, error) + func (s *CustomersService) List(ctx context.Context) ([]Customer, error) + func (s *CustomersService) RemoveLimit(ctx context.Context, externalCustomerID string, opts ...RequestOption) error + func (s *CustomersService) SetLimit(ctx context.Context, externalCustomerID string, monthlyCredits int, ...) (*Customer, error) + type Deal struct + AssignedName string + AssignedUserID *string + ClosedAt *time.Time + CreatedAt time.Time + Currency string + ID string + LeadEmail string + LeadID string + LeadName string + LeadScore *int + PipelineID string + StageID string + Title string + UpdatedAt time.Time + ValueCents *int64 + type DealStageChangedData struct + ID string + IsLost bool + IsWon bool + LeadID string + PipelineID string + PreviousStageID *string + StageID string + StageName string + type DealsService struct + func (s *DealsService) Create(ctx context.Context, params CreateDealParams, opts ...RequestOption) (*Deal, error) + func (s *DealsService) Update(ctx context.Context, id string, params UpdateDealParams, opts ...RequestOption) (*Deal, error) + type Error struct + Code string + Message string + RetryAfter time.Duration + StatusCode int + func (e *Error) Error() string + func (e *Error) Unwrap() error + type Lead struct + Address string + AssignedName string + AssignedUserID string + Category string + ContactLocked bool + CreatedAt *time.Time + DealID string + DealStageID string + DealStageName string + Email string + ID string + Language string + Name string + Phone string + ProjectID string + Rating *float64 + RegionCode string + RegionName string + Score *int + SellerProfileID string + SellerProfileName string + Source string + UnsubscribedAt *time.Time + Website string + type LeadCRM struct + Deal *Deal + Meetings []Meeting + Notes []Note + Outreach []OutreachMessage + Tags []Tag + Tasks []Task + type LeadCreatedData struct + Address *string + Category *string + ExternalCustomerID *string + ID string + Language *string + Name string + Phone *string + Rating *float64 + RegionName *string + SearchID *string + Source string + Website *string + type LeadDetail struct + Calls []Call + Enrichment *LeadEnrichment + Lead Lead + Outreach []OutreachMessage + type LeadEnrichment struct + CreatedAt time.Time + Email string + EmailStatus string + EmailVerifiedAt *time.Time + ID string + LeadID string + Metadata map[string]any + Socials []string + type LeadListParams struct + Category string + Contact string + JobID string + Language string + MaxRating *float64 + MaxScore *int + MinRating *float64 + MinScore *int + OutreachStatus string + Page int + PageSize int + Q string + Region string + Sort string + Source string + StageID string + TagID string + Unsubscribed string + type LeadsService struct + func (s *LeadsService) AddNote(ctx context.Context, id, body string, opts ...RequestOption) (*Note, error) + func (s *LeadsService) All(ctx context.Context, params LeadListParams) iter.Seq2[Lead, error] + func (s *LeadsService) CRM(ctx context.Context, id string) (*LeadCRM, error) + func (s *LeadsService) Get(ctx context.Context, id string) (*LeadDetail, error) + func (s *LeadsService) List(ctx context.Context, params LeadListParams) (*Page[Lead], error) + func (s *LeadsService) Outreach(ctx context.Context, id string) ([]OutreachMessage, error) + func (s *LeadsService) WriteDraft(ctx context.Context, id string, regenerate bool, opts ...RequestOption) ([]OutreachMessage, error) + type Me struct + APIKeyID string + OrganizationID string + type Meeting struct + AttendeeEmail string + CreatedAt time.Time + Description string + EndsAt time.Time + ID string + LeadID string + MeetLink string + StartsAt time.Time + Title string + type Note struct + AuthorName string + Body string + CreatedAt time.Time + ID string + LeadID string + UpdatedAt time.Time + type Option func(*Client) + func WithAPIKey(key string) Option + func WithBaseURL(u 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 OutreachListParams struct + Channel string + JobID string + Page int + PageSize int + Q string + Sort string + Status OutreachStatus + type OutreachMessage struct + Channel string + ClickCount int + CreatedAt time.Time + EmailSubject string + EngagementScore int + ErrorMessage *string + FirstClickedAt *time.Time + ID string + LastClickedAt *time.Time + LastOpenedAt *time.Time + LeadEmail string + LeadEmailStatus string + LeadEmailSuppressed bool + LeadID string + LeadName string + Message string + OpenCount int + OpenedAt *time.Time + PromptVersion string + QualityIssues []string + ScheduledAt *time.Time + SenderAccountID *string + SentAt *time.Time + SequenceStepName string + SequenceTotalSteps int + StepPosition *int + type OutreachPage struct + Stats OutreachStats + type OutreachRepliedData struct + FromEmail string + FromName *string + ID string + LeadID *string + OutreachMessageID *string + ReceivedAt time.Time + Subject *string + Text *string + ThreadID string + type OutreachSentData struct + Channel string + EmailSubject *string + ID string + LeadID string + SentAt time.Time + type OutreachService struct + func (s *OutreachService) Get(ctx context.Context, id string) (*OutreachMessage, error) + func (s *OutreachService) List(ctx context.Context, params OutreachListParams) (*OutreachPage, error) + func (s *OutreachService) Rewrite(ctx context.Context, id string, params RewriteOutreachParams, ...) (*OutreachMessage, error) + func (s *OutreachService) Send(ctx context.Context, id string, scheduledAt time.Time, opts ...RequestOption) (*OutreachMessage, error) + func (s *OutreachService) Update(ctx context.Context, id string, params UpdateOutreachParams, ...) (*OutreachMessage, error) + type OutreachStats struct + AvgEngagement int + Draft int + EngagementRate int + Failed int + NeedsReview int + OpenRate int + Opened int + Scheduled int + Sent int + Total int + type OutreachStatus string + const OutreachDraft + const OutreachFailed + const OutreachScheduled + const OutreachSent + type Page struct + Items []T + Page int + PageSize int + Total int + type Pipeline struct + CreatedAt time.Time + ID string + IsDefault bool + Name string + Stages []Stage + type PipelinesService struct + func (s *PipelinesService) List(ctx context.Context) ([]Pipeline, error) + type RequestOption func(*requestConfig) + func WithIdempotencyKey(key string) RequestOption + type RewriteOutreachParams struct + Instruction string + Tone string + type Search struct + APIKeyID string + CountryCode string + CreatedAt time.Time + CreatedBy string + CreditsConsumed int + CreditsRefunded int + CreditsReserved int + ErrorMessage string + ExternalCustomerID string + ID string + Latitude *float64 + LeadsFound int + LeadsProcessed int + Limit int + Location string + Longitude *float64 + OrganizationID string + Progress int + ProjectID string + RadiusKm *float64 + SearchMode string + Sector string + SellerProfileID string + Source string + Status SearchStatus + UpdatedAt time.Time + type SearchCreated struct + JobID string + ProjectID string + Status SearchStatus + type SearchEventData struct + APIKeyID *string + CreditsConsumed int + CreditsReserved int + ErrorMessage *string + ExternalCustomerID *string + ID string + LeadsFound int + Location string + Sector string + Source string + Status SearchStatus + type SearchStatus string + const SearchCancelled + const SearchCompleted + const SearchFailed + const SearchProcessing + const SearchQueued + const SearchScraping + func (s SearchStatus) Done() bool + type SearchesService struct + func (s *SearchesService) AllLeads(ctx context.Context, id string, params LeadListParams) iter.Seq2[Lead, error] + func (s *SearchesService) Cancel(ctx context.Context, id string, opts ...RequestOption) (*Search, error) + func (s *SearchesService) Create(ctx context.Context, params CreateSearchParams, opts ...RequestOption) (*SearchCreated, error) + func (s *SearchesService) Get(ctx context.Context, id string) (*Search, error) + func (s *SearchesService) Leads(ctx context.Context, id string, params LeadListParams) (*Page[Lead], error) + func (s *SearchesService) List(ctx context.Context, limit int) ([]Search, error) + func (s *SearchesService) WaitForCompletion(ctx context.Context, id string, opts WaitOptions) (*Search, error) + type SenderAccount struct + CreatedAt time.Time + DailyLimit int + Email string + ExternalCustomerID string + ID string + IMAPSyncStatus string + IMAPSyncedAt *time.Time + Name string + SMTPHost string + SMTPPort int + SMTPUser string + type SenderAccountsService struct + func (s *SenderAccountsService) Create(ctx context.Context, params CreateSenderAccountParams, opts ...RequestOption) (*SenderAccount, error) + func (s *SenderAccountsService) Delete(ctx context.Context, id string, opts ...RequestOption) error + func (s *SenderAccountsService) List(ctx context.Context, externalCustomerID string) ([]SenderAccount, error) + type Stage struct + Color string + CreatedAt time.Time + ID string + IsLost bool + IsWon bool + Name string + PipelineID string + Position int + type Tag struct + Color string + ID string + Name string + type Task struct + AssignedName string + CompletedAt *time.Time + CreatedAt time.Time + DealID *string + DueAt *time.Time + ID string + LeadID string + Title string + type UpdateDealParams struct + AssignedUserID *string + Currency *string + PipelineID *string + StageID *string + Title *string + ValueCents *int64 + type UpdateOutreachParams struct + EmailSubject *string + Message string + type UpdateWebhookParams struct + Description *string + Enabled *bool + Events []string + URL *string + type Usage struct + From time.Time + GroupBy string + Rows []UsageRow + To time.Time + Total UsageRow + type UsageParams struct + ExternalCustomerID string + From string + GroupBy string + To string + type UsageRow struct + CreditsHeld int + CreditsUsed int + Group string + LeadsFound int + Searches int + type WaitOptions struct + Interval time.Duration + type WebhookDelivery struct + Attempts int + CreatedAt time.Time + DeliveredAt *time.Time + EventID string + EventType string + ID string + LastError string + LastStatusCode *int + NextAttemptAt *time.Time + Status string + type WebhookEndpoint struct + ConsecutiveFailures int + CreatedAt time.Time + Description string + DisabledAt *time.Time + Events []string + ID string + URL string + type WebhookEndpointCreated struct + Endpoint WebhookEndpoint + Secret string + type WebhookEvent struct + CreatedAt time.Time + Data json.RawMessage + ID string + OrganizationID string + Type string + func ConstructEvent(payload []byte, header, secret string) (*WebhookEvent, error) + func (e *WebhookEvent) Decode(v any) error + type WebhooksService struct + func (s *WebhooksService) Create(ctx context.Context, params CreateWebhookParams, opts ...RequestOption) (*WebhookEndpointCreated, error) + func (s *WebhooksService) Delete(ctx context.Context, id string, opts ...RequestOption) error + func (s *WebhooksService) Deliveries(ctx context.Context, id string, limit int) ([]WebhookDelivery, error) + func (s *WebhooksService) List(ctx context.Context) ([]WebhookEndpoint, error) + func (s *WebhooksService) SendTest(ctx context.Context, id string, opts ...RequestOption) (*WebhookDelivery, error) + func (s *WebhooksService) Update(ctx context.Context, id string, params UpdateWebhookParams, ...) (*WebhookEndpoint, error)