SDK API Reference
Go SDK API Reference
Complete API reference for all functions in the Go SDK
Complete reference for all methods available in the github.com/buena-ai/sdk
package.
Installation & Setup
Core API Methods
All API methods are accessed through client.DefaultAPI.*
and require a context.
Lead Management Functions
ListLeads(ctx).Execute()
- Purpose: List all leads with filtering and pagination
- Parameters: limit, offset, sort, order, search, company, status
- Returns: ListLeads200Response with data array and pagination info
CreateLead(ctx).CreateLeadRequest(request).Execute()
- Purpose: Create a new lead
- Parameters: CreateLeadRequest with first_name, last_name, email (required)
- Returns: Lead object with generated ID and timestamps
GetLead(ctx, leadId).Execute()
- Purpose: Retrieve specific lead by ID
- Parameters: leadId string
- Returns: Lead object
UpdateLead(ctx, leadId).UpdateLeadRequest(request).Execute()
- Purpose: Update existing lead information
- Parameters: leadId string, UpdateLeadRequest with optional fields
- Returns: Updated Lead object
DeleteLead(ctx, leadId).Execute()
- Purpose: Permanently delete a lead
- Parameters: leadId string
- Returns: Success confirmation map
API Key Management Functions
ListApiKeys(ctx).Execute()
- Purpose: List all API keys for account
- Parameters: None
- Returns: ListApiKeysResponse with ApiKey array
CreateApiKey(ctx).CreateApiKeyRequest(request).Execute()
- Purpose: Create new API key
- Parameters: CreateApiKeyRequest with name, permissions
- Returns: ApiKey object with full key (only on creation)
System Health Functions
HealthCheck(ctx).Execute()
- Purpose: Check API system status
- Parameters: None
- Returns: HealthCheck200Response with status and service info
Error Handling
All methods return (result, *http.Response, error). Check error and response.StatusCode:
401
- Invalid API key403
- Insufficient permissions404
- Resource not found409
- Conflict (duplicate email)422
- Validation error429
- Rate limit exceeded500
- Server error
Utility Functions
Helper functions for working with pointers:
buena.PtrString(s)
- Convert string to *stringbuena.PtrStringValue(ptr)
- Convert *string to string (safe)buena.PtrInt32(i)
- Convert int32 to *int32buena.PtrBool(b)
- Convert bool to *boolbuena.PtrTime(t)
- Convert time.Time to *time.Time