gohighlevel

package module
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2025 License: MIT Imports: 8 Imported by: 0

README

GoHighLevel Go SDK

A comprehensive, production-ready Go SDK for the GoHighLevel API. This SDK provides a clean, resource-based interface for interacting with GoHighLevel's CRM platform, with full OAuth 2.0 support.

Built by CheckoutJoy - Simplifying payment solutions

CI Go Report Card GoDoc

Features

  • OAuth 2.0 Authentication - Full support for GoHighLevel's OAuth flow
  • Resource-Based API - Clean, intuitive interface organized by resources
  • Type-Safe - Comprehensive Go types for all API entities
  • Connection Pooling - Efficient HTTP client with connection reuse
  • Comprehensive Testing - Full integration test suite
  • Production Ready - Built with best practices for Go SDKs

Installation

go get github.com/checkoutjoy/gohighlevel-go

Quick Start

Simple Usage (With Access Token Only)

If you already have an access token, you don't need to provide client credentials:

package main

import (
    "fmt"
    "log"

    ghl "github.com/checkoutjoy/gohighlevel-go"
)

func main() {
    // Create a client without OAuth credentials (simpler and more secure)
    client, err := ghl.NewClient(ghl.Config{})
    if err != nil {
        log.Fatal(err)
    }

    // Just set your access token
    client.SetAccessToken("your-access-token")

    // Create a contact
    contact, err := client.Contacts.Create(&ghl.CreateContactRequest{
        LocationID: "location-id",
        FirstName:  "John",
        LastName:   "Doe",
        Email:      "john.doe@example.com",
        Phone:      "+1234567890",
        Tags:       []string{"lead", "website"},
    })
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Created contact: %s\n", contact.ID)
}

Authentication

The SDK supports OAuth 2.0 authentication with multiple authorization methods.

Important: When Do You Need Client ID & Secret?

You DON'T need them if:

  • You already have a valid access token
  • You manage token refresh externally
  • You're building a client-side application (they should NEVER be exposed client-side)

You DO need them if:

  • You're implementing OAuth authorization code flow
  • You want the SDK to automatically refresh tokens using a refresh token
  • You're building a server-side application that handles OAuth
Security Best Practices

⚠️ Never expose client secrets in client-side code (mobile apps, SPAs, browser extensions) ✅ Only use client secrets in secure server-side environmentsIf you only have access tokens, you can use the SDK without any client credentials

Most secure for applications that already have tokens:

// No client credentials needed!
client, _ := ghl.NewClient(ghl.Config{
    AccessToken: "your-access-token",
    LocationID:  "your-location-id", // Optional: set default location ID
})

// Start making API calls immediately
contact, err := client.Contacts.Get("contact-id")

// Or set location ID dynamically
client.SetLocationID("your-location-id")

If you want the SDK to automatically refresh expired tokens and save them to your storage:

// Define a callback to save tokens when they're refreshed
func saveTokens(tokenResp ghl.TokenResponse) {
    // Save to your database, Redis, file, etc.
    // The TokenResponse includes all OAuth metadata
    db.SaveUserTokens(userID, tokenResp.AccessToken, tokenResp.RefreshToken,
        time.Now().Add(time.Duration(tokenResp.ExpiresIn)*time.Second))

    // You also have access to additional metadata:
    log.Printf("Tokens refreshed - UserType: %s, CompanyID: %s, UserID: %s",
        tokenResp.UserType, tokenResp.CompanyID, tokenResp.UserID)
}

// Create client with automatic token refresh
client, _ := ghl.NewClient(ghl.Config{
    ClientID:         "your-client-id",
    ClientSecret:     "your-client-secret",
    AccessToken:      "your-access-token",
    RefreshToken:     "your-refresh-token",
    LocationID:       "your-location-id",
    OnTokenRefresh:   saveTokens,        // Callback to save new tokens
    AutoRefreshOn401: true,              // Enable automatic refresh on 401 errors
})

// Now use the client normally - it handles token expiration automatically!
contact, err := client.Contacts.Get("contact-id")
// If token expires:
// 1. SDK detects 401 error
// 2. Automatically refreshes using refresh token
// 3. Calls saveTokens() with new tokens
// 4. Retries the request
// 5. Returns the result seamlessly
Method 3: Manual Token Refresh

If you prefer manual control over token refresh:

client, _ := ghl.NewClient(ghl.Config{
    ClientID:     "your-client-id",
    ClientSecret: "your-client-secret",
    AccessToken:  "your-access-token",
    RefreshToken: "your-refresh-token",
})

// Manually refresh when needed
err := client.AuthorizeWithRefreshToken(client.GetRefreshToken())
if err == nil {
    // Save the new tokens
    newAccessToken := client.GetAccessToken()
    newRefreshToken := client.GetRefreshToken()
    // Save to your storage
}

// Or set tokens dynamically
client.SetTokens("access-token", "refresh-token", 3600)
Method 4: Full OAuth Authorization Code Flow

For server-side apps implementing OAuth from scratch:

client, _ := ghl.NewClient(ghl.Config{
    ClientID:     "your-client-id",
    ClientSecret: "your-client-secret",
})

// Exchange authorization code for access token
err := client.AuthorizeWithCode("auth-code", "redirect-uri")

Resources

Contacts

The Contacts resource provides full CRUD operations for managing contacts in GoHighLevel.

Create a Contact
contact, err := client.Contacts.Create(&ghl.CreateContactRequest{
    LocationID:  "location-id",
    FirstName:   "Jane",
    LastName:    "Smith",
    Email:       "jane@example.com",
    Phone:       "+1987654321",
    CompanyName: "Acme Corp",
    Tags:        []string{"customer", "vip"},
    CustomFields: []ghl.CustomField{
        {Key: "industry", Value: "Technology"},
    },
})

Required Scope: contacts.write

Get a Contact
contact, err := client.Contacts.Get("contact-id")

Required Scope: contacts.readonly

Update a Contact
updated, err := client.Contacts.Update("contact-id", &ghl.UpdateContactRequest{
    LastName:    "Johnson",
    CompanyName: "New Company Inc",
})

Required Scope: contacts.write

Delete a Contact
err := client.Contacts.Delete("contact-id")

Required Scope: contacts.write

Upsert a Contact

Create or update a contact based on duplicate detection settings:

contact, err := client.Contacts.Upsert(&ghl.UpsertContactRequest{
    LocationID: "location-id",
    Email:      "user@example.com",
    FirstName:  "John",
    LastName:   "Doe",
})

Required Scope: contacts.write

Note: The Upsert API adheres to the "Allow Duplicate Contact" setting at the Location level. If both email and phone match different contacts, it updates the first field in the configured sequence.

List Contacts
contacts, err := client.Contacts.List(&ghl.GetContactsOptions{
    LocationID: "location-id",
    Limit:      50,
    Query:      "search-term",
})

fmt.Printf("Found %d of %d contacts\n", contacts.Count, contacts.Total)
for _, contact := range contacts.Contacts {
    fmt.Printf("- %s (%s)\n", contact.ContactName, contact.Email)
}

Required Scope: contacts.readonly

Note: This endpoint is deprecated. Use the Search Contacts endpoint for new implementations.

Get Contacts by Business ID
contacts, err := client.Contacts.GetByBusinessID("business-id")

Required Scope: contacts.readonly

Contact Tags
Add Tags to a Contact
err := client.Contacts.AddTags("contact-id", []string{"qualified", "hot-lead"})

Required Scope: contacts.write

Remove Tags from a Contact
err := client.Contacts.RemoveTags("contact-id", []string{"cold-lead"})

Required Scope: contacts.write

OAuth Scopes

The following OAuth scopes are required for different operations:

Scope Description Operations
contacts.readonly Read access to contacts Get Contact, List Contacts, Get Contacts by Business ID
contacts.write Write access to contacts Create Contact, Update Contact, Delete Contact, Upsert Contact, Add Tags, Remove Tags
Requesting Scopes

When setting up your OAuth application, request the appropriate scopes based on your needs:

  • Read-only access: contacts.readonly
  • Full access: contacts.readonly contacts.write

Configuration

Custom HTTP Client

Provide your own HTTP client with custom settings:

import (
    "net/http"
    "time"
)

customClient := &http.Client{
    Timeout: 60 * time.Second,
    Transport: &http.Transport{
        MaxIdleConns:        200,
        MaxIdleConnsPerHost: 20,
        IdleConnTimeout:     120 * time.Second,
    },
}

client, err := ghl.NewClient(ghl.Config{
    ClientID:     "your-client-id",
    ClientSecret: "your-client-secret",
    HTTPClient:   customClient,
})
Custom Base URL

For testing or custom deployments:

client, err := ghl.NewClient(ghl.Config{
    ClientID:     "your-client-id",
    ClientSecret: "your-client-secret",
    BaseURL:      "https://custom-api.example.com",
})

Development

Prerequisites
  • Go 1.24 or higher
  • Make (optional, for using Makefile)
Building
make build

Or without Make:

go build ./...
Running Tests
Unit Tests
make test-unit

Or:

go test -short ./...
Integration Tests

Integration tests require valid GoHighLevel credentials:

export GHL_CLIENT_ID="your-client-id"
export GHL_CLIENT_SECRET="your-client-secret"
export GHL_ACCESS_TOKEN="your-access-token"
export GHL_LOCATION_ID="your-location-id"

make test-integration

Or:

go test -v ./...
All Tests with Coverage
make test

This generates a coverage report in coverage.html.

Linting
make lint

Or:

golangci-lint run ./...
Formatting
make fmt

Examples

See the examples directory for complete working examples:

1. Simple Usage (Access Token Only)

examples/simple_token - Use the SDK with just an access token (no client credentials needed)

export GHL_ACCESS_TOKEN="your-access-token"
export GHL_LOCATION_ID="your-location-id"
go run examples/simple_token/main.go
2. With Token Refresh

examples/refresh_token - Use the SDK with automatic token refresh capability

export GHL_CLIENT_ID="your-client-id"
export GHL_CLIENT_SECRET="your-client-secret"
export GHL_ACCESS_TOKEN="your-access-token"
export GHL_REFRESH_TOKEN="your-refresh-token"
export GHL_LOCATION_ID="your-location-id"
go run examples/refresh_token/main.go
3. Full OAuth Flow

examples/basic - Comprehensive example covering all major operations including OAuth flow

export GHL_CLIENT_ID="your-client-id"
export GHL_CLIENT_SECRET="your-client-secret"
export GHL_ACCESS_TOKEN="your-access-token"
export GHL_LOCATION_ID="your-location-id"
go run examples/basic/main.go

API Documentation

For detailed API documentation, refer to:

Error Handling

The SDK returns descriptive errors for all operations:

contact, err := client.Contacts.Get("invalid-id")
if err != nil {
    // Handle error
    log.Printf("Failed to get contact: %v", err)
    return
}
Automatic Token Refresh on 401 Errors

When AutoRefreshOn401 is enabled, the SDK automatically handles token expiration:

client, _ := ghl.NewClient(ghl.Config{
    ClientID:         "your-client-id",
    ClientSecret:     "your-client-secret",
    AccessToken:      "your-access-token",
    RefreshToken:     "your-refresh-token",
    OnTokenRefresh:   saveTokensFunc,
    AutoRefreshOn401: true,
})

// This request may trigger automatic token refresh if token is expired
contact, err := client.Contacts.Get("contact-id")
if err != nil {
    // Error here means either:
    // 1. Refresh token is also expired (need to re-authenticate)
    // 2. Other API error (not 401)
    // 3. Network error
    log.Printf("Failed: %v", err)
}

How it works:

  1. API request returns 401 Unauthorized
  2. SDK automatically calls refresh token endpoint
  3. New tokens are saved via OnTokenRefresh callback
  4. Original request is retried with new token
  5. Result is returned (or error if refresh failed)

When automatic refresh is NOT attempted:

  • AutoRefreshOn401 is false (default)
  • No refresh token available
  • No client credentials configured
  • Already attempted refresh once (prevents infinite loops)
Common error scenarios:
  • Missing or invalid access token
  • Token expired (auto-refreshed if enabled, otherwise returns 401 error)
  • Invalid request parameters
  • API rate limiting
  • Network errors
  • Invalid credentials

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

Built by CheckoutJoy

Documentation

Overview

Package gohighlevel provides a Go SDK for the GoHighLevel API with OAuth 2.0 authentication.

Index

Constants

View Source
const (
	// DefaultBaseURL is the default base URL for the GoHighLevel API
	DefaultBaseURL = "https://services.leadconnectorhq.com"
	// OAuthTokenURL is the OAuth token endpoint
	OAuthTokenURL = "https://services.leadconnectorhq.com/oauth/token"
	// DefaultTimeout is the default HTTP client timeout
	DefaultTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributionSource

type AttributionSource struct {
	Campaign          string `json:"campaign,omitempty"`
	CampaignID        string `json:"campaignId,omitempty"`
	Medium            string `json:"medium,omitempty"`
	MediumID          string `json:"mediumId,omitempty"`
	Source            string `json:"source,omitempty"`
	Referrer          string `json:"referrer,omitempty"`
	AdGroup           string `json:"adGroup,omitempty"`
	AdGroupID         string `json:"adGroupId,omitempty"`
	FBCLId            string `json:"fbclid,omitempty"`
	GCLId             string `json:"gclid,omitempty"`
	MSCLKId           string `json:"msclkid,omitempty"`
	DCLID             string `json:"dclid,omitempty"`
	FBC               string `json:"fbc,omitempty"`
	FBP               string `json:"fbp,omitempty"`
	UserAgent         string `json:"userAgent,omitempty"`
	GAPClientID       string `json:"gapClientId,omitempty"`
	GoogleAnalyticsID string `json:"googleAnalyticsId,omitempty"`
}

AttributionSource represents the attribution source for a contact

type Client

type Client struct {
	// BaseURL is the base URL for API requests
	BaseURL string

	// HTTPClient is the underlying HTTP client used for requests
	HTTPClient *http.Client

	// Resources
	Contacts *ContactsService
	// contains filtered or unexported fields
}

Client is the main GoHighLevel API client

func NewClient

func NewClient(config Config) (*Client, error)

NewClient creates a new GoHighLevel API client. ClientID and ClientSecret are optional - only required for OAuth flows and token refresh. If you only need to make API calls with an existing access token, you can omit them.

func (*Client) AuthorizeWithCode

func (c *Client) AuthorizeWithCode(code, redirectURI string) error

AuthorizeWithCode exchanges an authorization code for an access token. Requires ClientID and ClientSecret to be set in the client config.

func (*Client) AuthorizeWithRefreshToken

func (c *Client) AuthorizeWithRefreshToken(refreshToken string) error

AuthorizeWithRefreshToken refreshes the access token using a refresh token. Requires ClientID and ClientSecret to be set in the client config.

func (*Client) GetAccessToken

func (c *Client) GetAccessToken() string

GetAccessToken returns the current access token

func (*Client) GetLocationID

func (c *Client) GetLocationID() string

GetLocationID returns the current default location ID

func (*Client) GetRefreshToken

func (c *Client) GetRefreshToken() string

GetRefreshToken returns the current refresh token

func (*Client) SetAccessToken

func (c *Client) SetAccessToken(token string)

SetAccessToken manually sets the access token

func (*Client) SetLocationID

func (c *Client) SetLocationID(locationID string)

SetLocationID sets the default location ID for API requests

func (*Client) SetTokens

func (c *Client) SetTokens(accessToken, refreshToken string, expiresIn int)

SetTokens manually sets both access and refresh tokens

type Config

type Config struct {
	ClientID         string
	ClientSecret     string
	AccessToken      string
	RefreshToken     string
	LocationID       string
	BaseURL          string
	HTTPClient       *http.Client
	OnTokenRefresh   TokenRefreshCallback // Called when tokens are automatically refreshed on 401
	AutoRefreshOn401 bool                 // Enable automatic token refresh on 401 errors (default: false)
}

Config holds configuration for the GoHighLevel client

type Contact

type Contact struct {
	ID                   string             `json:"id,omitempty"`
	LocationID           string             `json:"locationId,omitempty"`
	ContactName          string             `json:"contactName,omitempty"`
	FirstName            string             `json:"firstName,omitempty"`
	LastName             string             `json:"lastName,omitempty"`
	Email                string             `json:"email,omitempty"`
	Phone                string             `json:"phone,omitempty"`
	Type                 string             `json:"type,omitempty"`
	Source               string             `json:"source,omitempty"`
	AssignedTo           string             `json:"assignedTo,omitempty"`
	Address1             string             `json:"address1,omitempty"`
	City                 string             `json:"city,omitempty"`
	State                string             `json:"state,omitempty"`
	Country              string             `json:"country,omitempty"`
	PostalCode           string             `json:"postalCode,omitempty"`
	CompanyName          string             `json:"companyName,omitempty"`
	Website              string             `json:"website,omitempty"`
	Tags                 []string           `json:"tags,omitempty"`
	DateOfBirth          string             `json:"dateOfBirth,omitempty"`
	DateAdded            time.Time          `json:"dateAdded,omitempty"`
	DateUpdated          time.Time          `json:"dateUpdated,omitempty"`
	CustomFields         []CustomField      `json:"customField,omitempty"`
	BusinessID           string             `json:"businessId,omitempty"`
	AttributionSource    *AttributionSource `json:"attributionSource,omitempty"`
	AdditionalEmails     []string           `json:"additionalEmails,omitempty"`
	AdditionalPhones     []string           `json:"additionalPhones,omitempty"`
	SSN                  string             `json:"ssn,omitempty"`
	Gender               string             `json:"gender,omitempty"`
	Timezone             string             `json:"timezone,omitempty"`
	DND                  bool               `json:"dnd,omitempty"`
	DNDSettings          *DNDSettings       `json:"dndSettings,omitempty"`
	InboundDNDSettings   *DNDSettings       `json:"inboundDndSettings,omitempty"`
	ConversationID       string             `json:"conversationId,omitempty"`
	ConversationProvider string             `json:"conversationProvider,omitempty"`
	ConversationAgencyID string             `json:"conversationAgencyId,omitempty"`
	Followers            []string           `json:"followers,omitempty"`
}

Contact represents a GoHighLevel contact

type ContactResponse

type ContactResponse struct {
	Contact *Contact `json:"contact,omitempty"`
}

ContactResponse represents a single contact API response

type ContactsResponse

type ContactsResponse struct {
	Contacts []Contact `json:"contacts,omitempty"`
	Total    int       `json:"total,omitempty"`
	Count    int       `json:"count,omitempty"`
}

ContactsResponse represents a list of contacts API response

type ContactsService

type ContactsService struct {
	// contains filtered or unexported fields
}

ContactsService handles operations related to contacts

func (*ContactsService) AddTags

func (s *ContactsService) AddTags(contactID string, tags []string) error

AddTags adds tags to a contact Required scope: contacts.write

func (*ContactsService) Create

func (s *ContactsService) Create(req *CreateContactRequest) (*Contact, error)

Create creates a new contact Required scope: contacts.write

func (*ContactsService) Delete

func (s *ContactsService) Delete(contactID string) error

Delete deletes a contact Required scope: contacts.write

func (*ContactsService) Get

func (s *ContactsService) Get(contactID string) (*Contact, error)

Get retrieves a contact by ID Required scope: contacts.readonly

func (*ContactsService) GetByBusinessID

func (s *ContactsService) GetByBusinessID(businessID string) (*ContactsResponse, error)

GetByBusinessID retrieves contacts by business ID Required scope: contacts.readonly

func (*ContactsService) List

List retrieves a list of contacts with optional filters Required scope: contacts.readonly Note: This endpoint is deprecated, use Search instead for new implementations

func (*ContactsService) RemoveTags

func (s *ContactsService) RemoveTags(contactID string, tags []string) error

RemoveTags removes tags from a contact Required scope: contacts.write

func (*ContactsService) Update

func (s *ContactsService) Update(contactID string, req *UpdateContactRequest) (*Contact, error)

Update updates an existing contact Required scope: contacts.write

func (*ContactsService) Upsert

func (s *ContactsService) Upsert(req *UpsertContactRequest) (*Contact, error)

Upsert creates or updates a contact based on duplicate detection settings Required scope: contacts.write

type CreateContactRequest

type CreateContactRequest struct {
	FirstName         string             `json:"firstName,omitempty"`
	LastName          string             `json:"lastName,omitempty"`
	Name              string             `json:"name,omitempty"`
	Email             string             `json:"email,omitempty"`
	LocationID        string             `json:"locationId"`
	Phone             string             `json:"phone,omitempty"`
	Address1          string             `json:"address1,omitempty"`
	City              string             `json:"city,omitempty"`
	State             string             `json:"state,omitempty"`
	PostalCode        string             `json:"postalCode,omitempty"`
	Country           string             `json:"country,omitempty"`
	CompanyName       string             `json:"companyName,omitempty"`
	Website           string             `json:"website,omitempty"`
	Source            string             `json:"source,omitempty"`
	Tags              []string           `json:"tags,omitempty"`
	CustomFields      []CustomField      `json:"customField,omitempty"`
	AttributionSource *AttributionSource `json:"attributionSource,omitempty"`
}

CreateContactRequest represents a request to create a contact

type CustomField

type CustomField struct {
	ID    string      `json:"id,omitempty"`
	Key   string      `json:"key,omitempty"`
	Value interface{} `json:"field_value,omitempty"`
}

CustomField represents a custom field on a contact

type DNDSetting

type DNDSetting struct {
	Status  string `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
	Code    string `json:"code,omitempty"`
}

DNDSetting represents individual DND setting

type DNDSettings

type DNDSettings struct {
	Call     *DNDSetting `json:"Call,omitempty"`
	SMS      *DNDSetting `json:"SMS,omitempty"`
	Email    *DNDSetting `json:"Email,omitempty"`
	WhatsApp *DNDSetting `json:"WhatsApp,omitempty"`
	GMB      *DNDSetting `json:"GMB,omitempty"`
	FB       *DNDSetting `json:"FB,omitempty"`
}

DNDSettings represents do not disturb settings

type GetContactsOptions

type GetContactsOptions struct {
	LocationID   string
	Query        string
	Limit        int
	Skip         int
	StartAfter   string
	StartAfterID string
}

GetContactsOptions represents query options for listing contacts

type TokenRefreshCallback

type TokenRefreshCallback func(tokenResponse TokenResponse)

TokenRefreshCallback is called whenever tokens are automatically refreshed due to 401 errors. This allows you to save the new tokens to your external storage (database, cache, etc.). The callback receives the complete token response with all metadata.

type TokenResponse added in v0.0.2

type TokenResponse struct {
	AccessToken       string `json:"access_token"`
	TokenType         string `json:"token_type"`
	ExpiresIn         int    `json:"expires_in"`
	RefreshToken      string `json:"refresh_token"`
	Scope             string `json:"scope"`
	RefreshTokenID    string `json:"refreshTokenId"`
	UserType          string `json:"userType"`
	CompanyID         string `json:"companyId"`
	IsBulkInstall     bool   `json:"isBulkInstallation"`
	UserID            string `json:"userId"`
	LocationID        string `json:"locationId,omitempty"`        // Only present in some responses
	AgencyID          string `json:"agencyId,omitempty"`          // Only present in some responses
	PlanID            string `json:"planId,omitempty"`            // Only present in some responses
	ApprovalRequestID string `json:"approvalRequestId,omitempty"` // Only present in some responses
}

TokenResponse represents the complete OAuth token response from GoHighLevel

type UpdateContactRequest

type UpdateContactRequest struct {
	FirstName         string             `json:"firstName,omitempty"`
	LastName          string             `json:"lastName,omitempty"`
	Name              string             `json:"name,omitempty"`
	Email             string             `json:"email,omitempty"`
	Phone             string             `json:"phone,omitempty"`
	Address1          string             `json:"address1,omitempty"`
	City              string             `json:"city,omitempty"`
	State             string             `json:"state,omitempty"`
	PostalCode        string             `json:"postalCode,omitempty"`
	Country           string             `json:"country,omitempty"`
	CompanyName       string             `json:"companyName,omitempty"`
	Website           string             `json:"website,omitempty"`
	Source            string             `json:"source,omitempty"`
	Tags              []string           `json:"tags,omitempty"`
	CustomFields      []CustomField      `json:"customField,omitempty"`
	AttributionSource *AttributionSource `json:"attributionSource,omitempty"`
}

UpdateContactRequest represents a request to update a contact

type UpsertContactRequest

type UpsertContactRequest struct {
	FirstName         string             `json:"firstName,omitempty"`
	LastName          string             `json:"lastName,omitempty"`
	Name              string             `json:"name,omitempty"`
	Email             string             `json:"email,omitempty"`
	LocationID        string             `json:"locationId"`
	Phone             string             `json:"phone,omitempty"`
	Address1          string             `json:"address1,omitempty"`
	City              string             `json:"city,omitempty"`
	State             string             `json:"state,omitempty"`
	PostalCode        string             `json:"postalCode,omitempty"`
	Country           string             `json:"country,omitempty"`
	CompanyName       string             `json:"companyName,omitempty"`
	Website           string             `json:"website,omitempty"`
	Source            string             `json:"source,omitempty"`
	Tags              []string           `json:"tags,omitempty"`
	CustomFields      []CustomField      `json:"customField,omitempty"`
	AttributionSource *AttributionSource `json:"attributionSource,omitempty"`
}

UpsertContactRequest represents a request to upsert a contact

Directories

Path Synopsis
examples
basic command
refresh_token command
simple_token command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL