Documentation ¶
Overview ¶
@openapi 3.0.0
@openapi 3.0.0
@openapi 3.0.0
@openapi 3.0.0
Index ¶
- func CreateBulkContacts(s *service.Services) gin.HandlerFunc
- func CreateContact(s *service.Services) gin.HandlerFunc
- func CreateOrganization(s *service.Services) gin.HandlerFunc
- func GetOrganization(s *service.Services) gin.HandlerFunc
- func ImportContacts(s *service.Services) gin.HandlerFunc
- func SetPrimaryExternalSystemId(s *service.Services) gin.HandlerFunc
- type BulkErrorDetails
- type BulkResponse
- type BulkResponseMultipleErrors
- type BulkSummary
- type ContactRecord
- type ContactsResponse
- type CreateOrganizationRequest
- type ExternalLink
- type ExternalSystemRecord
- type ExternalSystemResponse
- type OrganizationRecord
- type OrganizationResponse
- type OrganizationsResponse
- type SetPrimaryExternalSystemIdRequest
- type SingleContactResponse
- type SocialLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBulkContacts ¶
func CreateBulkContacts(s *service.Services) gin.HandlerFunc
@Summary Create multiple contacts @Description Creates multiple contacts from JSON input @Tags CustomerBASE API @Accept json @Produce json @Param contacts body []ContactRecord true "Array of contacts to create" @Success 201 {object} BulkResponse "All contacts created successfully" @Success 207 {object} BulkResponseMultipleErrors "Contacts created with some failures" @Failure 400 {object} rest.BaseResponse "Invalid request data" @Failure 401 {object} rest.BaseResponse "Unauthorized" @Failure 500 {object} rest.BaseResponse "Internal server error" @Router /customerbase/v1/contacts/bulk [post] @Security ApiKeyAuth
func CreateContact ¶
func CreateContact(s *service.Services) gin.HandlerFunc
@Summary Create a new contact @Description Creates a contact from either an email address or linkedin_url @Tags CustomerBASE API @Accept json @Produce json @Param contact body ContactRecord false "Contact information" @Success 200 {object} SingleContactResponse "Successfully created single contact" @Failure 400 {object} rest.BaseResponse "Invalid request data" @Failure 401 {object} rest.BaseResponse "Unauthorized" @Failure 500 {object} rest.BaseResponse "Internal server error" @Router /customerbase/v1/contacts [post] @Security ApiKeyAuth
func CreateOrganization ¶
func CreateOrganization(s *service.Services) gin.HandlerFunc
@Summary Create a new organization @Description Creates an organization if it doesn't exist based on website, custom ID, or LinkedIn URL. Returns existing organization if found. @Tags CustomerBASE API @Accept json @Produce json @Param body body CreateOrganizationRequest true "Organization creation request" @Success 201 {object} OrganizationResponse "Organization created successfully" @Success 206 {object} OrganizationResponse "Organization created with partial data" @Failure 400 {object} rest.BaseResponse "Invalid request - Missing required fields" @Failure 401 {object} rest.BaseResponse "Unauthorized - Invalid or missing API key" @Failure 409 {object} rest.BaseResponse "Conflict - Organization already exists with provided identifiers" @Failure 500 {object} rest.BaseResponse "Internal server error" @Router /customerbase/v1/organizations [post] @Security ApiKeyAuth
func GetOrganization ¶
func GetOrganization(s *service.Services) gin.HandlerFunc
@Summary Get organization details @Description Retrieves detailed organization information by ID or COS ID @Tags CustomerBASE API @Accept json @Produce json @Param id path string true "Organization ID or COS ID" example(org_123) @Success 200 {object} OrganizationResponse "Organization found" @Success 206 {object} OrganizationResponse "Organization found with partial data" @Failure 400 {object} rest.BaseResponse "Invalid organization ID format" @Failure 401 {object} rest.BaseResponse "Unauthorized - Invalid or missing API key" @Failure 404 {object} rest.BaseResponse "Organization not found" @Failure 500 {object} rest.BaseResponse "Internal server error" @Router /customerbase/v1/organizations/{id} [get] @Security ApiKeyAuth
func ImportContacts ¶
func ImportContacts(s *service.Services) gin.HandlerFunc
@Summary Import contacts from CSV @Description Creates multiple contacts from CSV file upload @Tags CustomerBASE API @Accept multipart/form-data @Produce json @Param file formData file true "CSV file with contact data (required headers: email, linkedin_url)" @Success 201 {object} BulkResponse "All contacts imported successfully" @Success 207 {object} BulkResponseMultipleErrors "Contacts imported with some failures" @Failure 400 {object} rest.BaseResponse "Invalid file format or data" @Failure 401 {object} rest.BaseResponse "Unauthorized" @Failure 415 {object} rest.BaseResponse "Unsupported content type" @Failure 500 {object} rest.BaseResponse "Internal server error" @Router /customerbase/v1/contacts/import [post] @Security ApiKeyAutl
func SetPrimaryExternalSystemId ¶
func SetPrimaryExternalSystemId(s *service.Services) gin.HandlerFunc
@Summary Set primary external system ID @Description Sets or updates the primary external system identifier for an organization @Tags CustomerBASE API @Accept json @Produce json @Param id path string true "Organization ID or COS ID" example(org_123) @Param externalSystem path string true "External system name" example(salesforce) @Param body body SetPrimaryExternalSystemIdRequest true "External system ID details" @Success 200 {object} ExternalSystemResponse "Primary ID set successfully" @Failure 400 {object} rest.BaseResponse "Invalid request parameters" @Failure 401 {object} rest.BaseResponse "Unauthorized - Invalid or missing API key" @Failure 404 {object} rest.BaseResponse "Organization or external system not found" @Failure 500 {object} rest.BaseResponse "Internal server error" @Router /customerbase/v1/organizations/{id}/links/{externalSystem}/primary [put] @Security ApiKeyAuth
Types ¶
type BulkErrorDetails ¶
type BulkErrorDetails struct { // The value that caused the error // example: invalid@email..com Value string `json:"value"` // The location of the record that caused the error // example: 17 RecordNumber int `json:"recordNumber"` // Description of the error // example: invalid email format Description string `json:"description"` }
BulkErrorDetails represents error details for bulk operations @Description Error details for failed operations in bulk processing
type BulkResponse ¶
type BulkResponse struct { // Inherits standard response fields enum.BaseResponse // Summary of the bulk operation Summary BulkSummary `json:"summary,omitempty"` // Error details if any Details BulkErrorDetails `json:"details,omitempty"` }
BulkResponse represents the response for bulk operations with single error @Description Response structure for bulk operations with single error detail
type BulkResponseMultipleErrors ¶
type BulkResponseMultipleErrors struct { // Inherits standard response fields enum.BaseResponse // Summary of the bulk operation Summary BulkSummary `json:"summary,omitempty"` // List of error details Details []BulkErrorDetails `json:"details,omitempty"` }
BulkResponseMultipleErrors represents the response for bulk operations with multiple errors @Description Response structure for bulk operations with multiple error details
type BulkSummary ¶
type BulkSummary struct { // Total number of records processed // example: 100 Total int `json:"total"` // Number of successfully processed records // example: 95 Success int `json:"success"` // Number of failed records // example: 5 Failed int `json:"failed"` }
BulkSummary represents the summary of a bulk operation @Description Summary statistics for bulk operations
type ContactRecord ¶
type ContactRecord struct { // Contact's unique identifier // example: contact-123 ContactId string `json:"contactId,omitempty"` // Contact's email address // example: john@example.com Email string `json:"email" csv:"email"` // Contact's LinkedIn profile URL // example: https://linkedin.com/in/john-doe LinkedInURL string `json:"linkedinUrl" csv:"linkedin_url"` }
ContactRecord represents the request structure for creating a contact @Description Request to create a contact
type ContactsResponse ¶
type ContactsResponse struct { // Inherits standard response fields enum.BaseResponse // List of contacts Contacts []ContactRecord `json:"contacts,omitempty"` }
ContactsResponse represents a response containing multiple contacts @Description Response structure for multiple contact operations
type CreateOrganizationRequest ¶
type CreateOrganizationRequest struct { // Organization's name // required: true // example: CustomerOS Name string `json:"name"` // Custom ID provided by the user // example: 12345 CustomId string `json:"customId"` // Organization's website URL // example: https://customeros.ai Website string `json:"website"` // Organization's LinkedIn profile URL // example: https://linkedin.com/company/openline LinkedinUrl string `json:"linkedinUrl"` // Lead source of the organization // example: Web Search LeadSource string `json:"leadSource"` // Relationship status of the organization // example: customer Relationship string `json:"relationship"` // Indicates if the organization is an ICP (Ideal Customer Profile) fit // example: true IcpFit bool `json:"icpFit"` }
CreateOrganizationRequest represents the request body for creating a new organization @Description Request to create an organization
type ExternalLink ¶
type ExternalLink struct { // External system name // example: stripe Name string `json:"name"` // External system identifier // example: cos-12345 Id string `json:"id"` // Indicates if this is the primary link // example: true Primary bool `json:"primary"` }
ExternalLink represents a link to an external system @Description External system link information
type ExternalSystemRecord ¶
type ExternalSystemRecord struct { // Associated organization ID // example: org-789 OrganizationId string `json:"organizationId,omitempty"` // Name of the external system // example: stripe ExternalSystem string `json:"externalSystem,omitempty"` // External system identifier // example: stripe-1234 ExternalId string `json:"externalId,omitempty"` // Indicates if this is the primary link // example: true Primary bool `json:"primary,omitempty"` }
ExternalSystemRecord represents external system information @Description External system information and its relationship to an organization
type ExternalSystemResponse ¶
type ExternalSystemResponse struct { // Inherits standard response fields enum.BaseResponse // The external system information Organization ExternalSystemRecord `json:"organization,omitempty"` }
ExternalSystemResponse represents a response containing external system information @Description Response structure for external system operations
type OrganizationRecord ¶
type OrganizationRecord struct { // Organization's unique identifier // example: 123e4567-e89b-12d3-a456-426614174000 ID string `json:"id,omitempty"` // Custom ID provided by the user // example: 12345 CustomId string `json:"customId,omitempty"` // CustomerOS unique identifier // example: C-A12-B45 CosId string `json:"cosId,omitempty"` // Organization name // example: CustomerOS Name string `json:"name,omitempty"` // Organization's website URL // example: https://customeros.ai Website string `json:"website,omitempty"` // Organization's LinkedIn profile URL // example: https://linkedin.com/company/openline LinkedinUrl string `json:"linkedinUrl"` // Lead source of the organization // example: Web Search LeadSource string `json:"leadSource,omitempty"` // Relationship status with the organization // example: customer Relationship string `json:"relationship,omitempty"` // Current stage in the organization lifecycle // example: lead Stage string `json:"stage,omitempty"` // ICP fit indicator // example: true IcpFit bool `json:"icpFit,omitempty"` // Associated domains // example: ["customeros.com","customeros.ai"] Domains []string `json:"domains,omitempty"` // External system links ExternalLinks []ExternalLink `json:"externalLinks,omitempty"` }
OrganizationRecord represents detailed organization information @Description Detailed organization information returned by API operations
type OrganizationResponse ¶
type OrganizationResponse struct { // Inherits standard response fields enum.BaseResponse // The organization information Organization OrganizationRecord `json:"organization,omitempty"` }
OrganizationResponse represents a response containing a single organization @Description Response structure for single organization operations
type OrganizationsResponse ¶
type OrganizationsResponse struct { // Inherits standard response fields enum.BaseResponse // List of organizations Organizations []OrganizationRecord `json:"organizations,omitempty"` }
OrganizationsResponse represents a response containing multiple organizations @Description Response structure for multiple organization operations
type SetPrimaryExternalSystemIdRequest ¶
type SetPrimaryExternalSystemIdRequest struct { // The ID of the external system to be set as primary // required: true // example: stripe-1234 ExternalId string `json:"externalId"` }
SetPrimaryExternalSystemIdRequest represents the request to set a primary external system ID @Description Request to set or replace the primary external system ID
type SingleContactResponse ¶
type SingleContactResponse struct { // Inherits standard response fields enum.BaseResponse // The contact information Contact ContactRecord `json:"contact,omitempty"` }
SingleContactResponse represents a response containing a single contact @Description Response structure for single contact operations
type SocialLink ¶
type SocialLink struct { // Social media profile URL // example: https://linkedin.com/company/openline Url string `json:"url"` // Number of followers // example: 1000 FollowerCount int `json:"followerCount"` }
SocialLink represents a social media link @Description Social media link information