Our API allows you to integrate with contacts, lead statuses, and user information. All endpoints require authentication using a secret key.
Authentication
All API endpoints require authentication using a secret key.
Contacts
Get Contacts
Retrieve a list of contacts from your organization with optional search functionality.
Endpoint: GET /api/connect/contacts
Query Parameters:
query
(optional): Search term to filter contacts by first name, last name, or email
Response:
attributes: ['id', 'email', 'photo', 'firstName', 'lastName', 'fullName', 'jobTitle', 'companyName','phoneNumbers', 'facebookUrl', 'instagramUrl', 'linkedinUrl', 'note', 'lastActivityAt', 'createdAt'],
Returns an array of contact objects with the following fields:
id
: Contact IDemail
: Contact email addressphoto
: Profile photo URLfirstName
: First namelastName
: Last namefullName
: Full namejobTitle
: Job titlecompanyName
: Company namephoneNumbers
: Phone numbersfacebookUrl
: Facebook profile URLinstagramUrl
: Instagram profile URLlinkedinUrl
: LinkedIn profile URLnote
: Notes about the contactlastActivityAt
: Last activity timestampcreatedAt
: Creation timestampleadStatus
: Associated lead status object withid
,label
, andcolor
Example Request:
GET /api/connect/contacts?query=john
Example Response:
[ { "id": 1, "email": "[email protected]", "firstName": "John", "lastName": "Doe", "fullName": "John Doe", "jobTitle": "Developer", "companyName": "Acme Corp", "createdAt": "2023-01-15T10:00:00Z", "leadStatus": { "id": 1, "label": "New Lead", "color": "#3B82F6" } } ]
Create Contact
Create a new contact in your organization.
Endpoint: POST /api/connect/contacts
Request Body: At least one of email
or firstName
is required. Available fields:
[ 'email', 'firstName', 'lastName', 'jobTitle', 'companyName', 'phoneNumbers', 'facebookUrl', 'instagramUrl', 'linkedinUrl', 'twitterUrl', 'note', ];
Additional fields:
leadStatus
: Lead status ID (optional)
Validation Rules:
email
: Must be a valid email address if providedfirstName
: Required if email is not providedleadStatus
: Must be a valid lead status ID for your organization
Example Request:
{ "email": "[email protected]", "firstName": "Jane", "lastName": "Smith", "jobTitle": "Marketing Manager", "companyName": "Tech Solutions Inc", "leadStatus": 1 }
Example Response:
{ "id": 2, "email": "[email protected]", "firstName": "Jane", "lastName": "Smith", "jobTitle": "Marketing Manager", "companyName": "Tech Solutions Inc", "createdAt": "2023-01-15T10:30:00Z" }
Error Responses:
400
: Invalid request data{ "error": "At least email or firstName is required" }
400
: Invalid email format{ "error": "Invalid email" }
400
: Invalid lead status{ "error": "Invalid lead status" }
Lead Statuses
Get Lead Statuses
Retrieve all available lead statuses for your organization.
Endpoint: GET /api/connect/contacts/lead-statuses
Response: Returns an array of lead status objects with the following fields:
id
: Lead status IDtype
: Status type (lead, qualified, or disqualified)label
: Display labelcolor
: Color code for UI displayorder
: Sort order
Example Response:
[ { "id": 1, "type": "lead", "label": "New Lead", "color": "#3B82F6", "order": 1 }, { "id": 2, "type": "qualified", "label": "Qualified Lead", "color": "#10B981", "order": 2 } ]
User Information
Get Current User
Retrieve information about the current authenticated user and their workspace.
Endpoint: GET /api/connect/me
Response: Returns an object with user details and workspace information:
details
: User information objectname
: User's full nameemail
: User's email address
workspace
: Organization information objectname
: Organization name
Example Response:
{ "details": { "name": "John Admin", "email": "[email protected]" }, "workspace": { "name": "Acme Corporation" } }
Error Handling
All endpoints return appropriate HTTP status codes:
200
: Success400
: Bad Request (validation errors)401
: Unauthorized (invalid secret key)500
: Internal Server Error
Error responses include a JSON object with an error
field containing the error message:
{ "error": "Error description" }