External API Documentation
Overview
This API allows external companies to upload and manage contacts, companies, and engagement data in our system. All endpoints require proper authentication and follow RESTful conventions.
Base URL
https://pub-api.conversion.ai/api/v1Authentication
All requests must include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYContacts API
Batch Upsert Contacts
Create or update multiple contacts in a single request.
Endpoint: POST /contacts/batch
Request Body:
Response:
Field Requirements:
email(required): Valid email addressvariables(optional): Key-value pairs for custom contact fieldsexternalContact(optional): Your system's reference data
Get Contact by Email
Retrieve a contact using their email address.
Endpoint: GET /contacts/by-email/{email}
Response:
Delete Contact by Email
Remove a contact from the system using their email address.
Endpoint: DELETE /contacts/by-email/{email}
Response:
Batch Update Subscription Status
Update subscription status for multiple contacts.
Endpoint: POST /contacts/batch-subscription
Request Body:
Subscription Status Values:
SUBSCRIBEDUNSUBSCRIBEDPENDING
Response:
Track Custom Engagement
Record custom engagement activities for contacts.
Endpoint: POST /contacts/engagements
Request Body:
Field Requirements:
contactEmail(required): Email of the contacttype(required): Must be "ACTIVITY"name(required): Brief name for the engagementdescription(required): Detailed description of what happeneddata(optional): Additional JSON data with custom fields
Response:
Companies API
Batch Upsert Companies
Create or update multiple companies in a single request.
Endpoint: POST /companies/batch
Request Body:
Field Requirements:
id(required): Your unique identifier for this companybaseDomain(recommended): Company's primary domainvariables(optional): Key-value pairs for custom company fields
Response:
Get Company by ID
Retrieve a company using your system's ID.
Endpoint: GET /companies/by-external-id/{id}
Response:
Delete Company by ID
Remove a company from the system using your system's ID.
Endpoint: DELETE /companies/by-external-id/{id}
Response:
Response Format
All API responses follow this standard format:
Success Response:
Error Response:
Error Codes
VALIDATION_ERROR
Request data validation failed
NOT_FOUND
Requested resource not found
DUPLICATE_ERROR
Resource already exists
RATE_LIMIT_EXCEEDED
Too many requests
UNAUTHORIZED
Invalid or missing API key
INTERNAL_ERROR
Server error
Data Types and Validation
Contact Variables
Common variable names (use these keys for best integration):
first_name: Contact's first namelast_name: Contact's last namephone: Phone numbercompany_name: Company nametitle: Job titlelinkedin_url: LinkedIn profile URL
Company Variables
Common variable names:
company_name: Full company nameindustry: Industry classificationsize: Employee count range (e.g., "1-10", "11-50", "51-200")annual_revenue: Annual revenue in USDlocation: Primary business locationwebsite: Company website URL
Custom Engagement Data
The data field in engagement tracking accepts any JSON structure. Common fields:
duration_minutes: Length of interactionoutcome: Result of the engagementnext_steps: Planned follow-up actionspriority: Engagement priority leveltags: Array of tags for categorization
Best Practices
Batch Operations: Use batch endpoints when uploading multiple records to reduce API calls
Error Handling: Always check the
successfield before processing response dataData Consistency: Use consistent external IDs across all API calls
Validation: Validate email formats and required fields before sending requests
Monitoring: Monitor API response times and error rates for optimal performance
Last updated