# API Reference
Source: https://docs.intentgpt.ai/api-reference/introduction
Complete reference documentation for the IntentGPT B2B Intent API
## Overview
The IntentGPT B2B Intent API provides comprehensive intent analysis, lead generation, and company intelligence capabilities for B2B companies. Our API enables you to analyze intent signals, generate leads, manage customer data, and access powerful business intelligence tools.
## Base URL
All API requests should be made to:
```bash
https://api.intentgpt.ai
```
## Authentication
The API supports multiple authentication methods:
### API Key Authentication
Use the `X-API-Key` header:
```bash
X-API-Key: your_api_key_here
```
### Bearer Token Authentication
Use JWT tokens from Clerk authentication or API keys:
```bash
Authorization: Bearer your_token_here
```
Never share your API key or commit it to version control. New API keys are automatically generated with 5000 free credits.
## Rate Limits
The API provides the following rate limits by endpoint:
* Intent & Analysis endpoints: Up to 1000 results per request
* Lead generation: 1000 leads maximum per request
* API key management: Standard rate limiting applied
* Health & testing endpoints: No authentication required
## API Endpoint Categories
### Intelligence Analysis
* `GET /company` - Company intelligence (GTM-optimized by default)
* `GET /company-gtm` - Explicit GTM company analysis
* `GET /person` - Person intelligence (GTM-optimized by default)
* `GET /person-gtm` - Explicit GTM person analysis
### Lead Generation
* `GET /leadgen` - Generate leads with customizable criteria
* `GET /leadgen/lists` - Retrieve lead lists
* `POST /leadgen/lists` - Create new lead lists
* `PUT /leadgen/lists/{id}` - Update existing lead lists
* `DELETE /leadgen/lists/{id}` - Delete lead lists
### Person & List Management
* `GET /person/list` - Person list management
* `GET /swipemagic` - SwipeMagic functionality
### Account Management
* `GET /api/credits` - Check user credit balance
### System & Testing
* `GET /health` - System health check
* `GET /test-auth` - Test authentication methods
* `GET /cors-test` - Test CORS configuration
## Core Intelligence Endpoints
### Company Intelligence
Get GTM-focused insights into companies with lead scoring and competitive analysis.
#### Example Request
```bash
curl -X GET "https://api.intentgpt.ai/company?website=asana.com" \
-H "Authorization: Bearer your_api_key"
```
### Person Intelligence
Analyze individual prospects with buying signals and decision-power assessment.
#### Example Request
```bash
curl -X GET "https://api.intentgpt.ai/person?linkedin=john-doe" \
-H "Authorization: Bearer your_api_key"
```
## Lead Generation
### GET /leadgen
Generate leads based on specified criteria.
#### Example Request
```bash
curl -X GET "https://api.intentgpt.ai/leadgen?objective=find_marketing_leaders&domain=tech&limit=50" \
-H "X-API-Key: your_api_key"
```
#### Parameters
| Parameter | Type | Description |
| -------------- | ------- | ----------------------------------------- |
| objective | string | Lead generation objective |
| domain/website | string | Company domain filter |
| topic/t | string | Topic filter |
| keyword/k | string | Keyword filter |
| limit | integer | Max leads to return (1-1000, default: 10) |
## Lead List Management
### Create Lead List
```bash
curl -X POST "https://api.intentgpt.ai/leadgen/lists" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing Leaders Q1",
"objective": "Find marketing decision makers",
"domain": "saas",
"limit": 100
}'
```
### Update Lead List
```bash
curl -X PUT "https://api.intentgpt.ai/leadgen/lists/list_123" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated List Name",
"replace_leads": true,
"leads": [...]
}'
```
## Priority Levels
| Level | Description |
| ----- | ---------------------------------------------------------------------------- |
| Hot | High-priority prospects with strong buying signals and immediate opportunity |
| Warm | Qualified prospects showing moderate intent, worth nurturing |
| Cold | Early-stage prospects requiring long-term relationship building |
## Error Handling
The API uses standardized error responses:
```json
{
"success": false,
"error": {
"code": "AUTH_001",
"message": "Authentication required"
}
}
```
Common error codes:
* `AUTH_001` - Authentication error
* `CRED_001` - Insufficient credits
* `RATE_001` - Rate limit exceeded
* `REQ_001` - Invalid request
* `SYS_001` - Internal error
## Health Check
Check API system status:
```bash
curl -X GET "https://api.intentgpt.ai/health"
```
Returns detailed health information including database connectivity and service status.
## SDKs and Libraries
Official SDKs available:
* [JavaScript/TypeScript](https://github.com/intentgpt/sdk-js)
* [Python](https://github.com/intentgpt/sdk-python)
## Support
Need help? Contact our support team:
* Email: [support@intentgpt.ai](mailto:support@intentgpt.ai)
* Developer Community: [community.intentgpt.ai](https://community.intentgpt.ai)
New users receive 5000 free credits upon API key creation. For enterprise-level usage or custom limits, contact [sales@intentgpt.ai](mailto:sales@intentgpt.ai).
# Lead Generation
Source: https://docs.intentgpt.ai/api-reference/lead-generation
Generate and manage leads using the IntentGPT Lead Generation API
## Overview
The Lead Generation API provides powerful tools to generate qualified leads based on specific criteria and manage lead lists. This enables you to build targeted prospect lists for your sales and marketing teams.
## Generate Leads
### GET /leadgen
Generate leads based on customizable criteria.
#### Parameters
| Parameter | Type | Required | Description |
| -------------- | ------- | -------- | ---------------------------------------------------------- |
| objective | string | Yes\* | Lead generation objective (e.g., "find marketing leaders") |
| website/domain | string | No | Company website or domain to filter by |
| topic/t | string | No | Topic filter for lead generation |
| keyword/k | string | No | Keyword filter for more specific targeting |
| limit | integer | No | Maximum leads to return (1-1000, default: 10) |
\*Required when generating new leads. If no objective is provided, falls back to person intent analysis.
#### Example: Generate Marketing Leaders
```bash
curl -X GET "https://api.intentgpt.ai/leadgen" \
-H "X-API-Key: your_api_key" \
-G --data-urlencode "objective=find marketing leaders in SaaS companies" \
--data-urlencode "domain=saas" \
--data-urlencode "topic=marketing automation" \
--data-urlencode "limit=50"
```
#### Response
```json
{
"status": "success",
"objective": "find marketing leaders in SaaS companies",
"leads": [
{
"name": "John Smith",
"title": "VP of Marketing",
"company": "TechCorp",
"email": "john.smith@techcorp.com",
"linkedin": "https://linkedin.com/in/johnsmith",
"intent_score": "HOT"
}
],
"count": 50
}
```
## Lead Lists Management
### Get Lead Lists
#### GET /leadgen/lists
Retrieve existing lead lists, optionally filtered by user or specific list ID.
#### Parameters
| Parameter | Type | Description |
| --------- | ------ | ------------------------- |
| user\_id | string | Filter lists by user ID |
| list\_id | string | Get a specific list by ID |
#### Example: Get All Lists
```bash
curl -X GET "https://api.intentgpt.ai/leadgen/lists" \
-H "X-API-Key: your_api_key"
```
#### Example: Get Specific List
```bash
curl -X GET "https://api.intentgpt.ai/leadgen/lists?list_id=list_abc123" \
-H "X-API-Key: your_api_key"
```
### Create Lead List
#### POST /leadgen/lists
Create a new lead list with optional automatic lead generation.
#### Request Body
```json
{
"name": "Q1 Marketing Prospects",
"objective": "Find marketing decision makers in mid-market SaaS",
"domain": "saas",
"topic": "marketing automation",
"keyword": "martech",
"user_id": "user_123",
"limit": 100,
"leads": [] // Optional: pre-existing leads to add
}
```
#### Example Request
```bash
curl -X POST "https://api.intentgpt.ai/leadgen/lists" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing Leaders Q1",
"objective": "Find CMOs and VPs of Marketing",
"domain": "enterprise-software",
"limit": 200
}'
```
#### Response
```json
{
"status": "success",
"message": "Lead list created successfully",
"lead_list": {
"list_id": "list_def456",
"name": "Marketing Leaders Q1",
"objective": "Find CMOs and VPs of Marketing",
"created_date": "2024-01-15T10:30:00Z",
"lead_count": 200
}
}
```
### Update Lead List
#### PUT /leadgen/lists/{listId}
Update an existing lead list's metadata or leads.
#### Parameters
* `listId` (path) - ID of the lead list to update
#### Request Body
```json
{
"name": "Updated List Name",
"objective": "Updated objective",
"domain": "new-domain",
"topic": "new-topic",
"keyword": "new-keyword",
"user_id": "user_123",
"leads": [
{
"name": "Jane Doe",
"title": "CMO",
"company": "NewCorp"
}
],
"replace_leads": true // If true, replaces all leads. If false, adds to existing
}
```
#### Example Request
```bash
curl -X PUT "https://api.intentgpt.ai/leadgen/lists/list_def456" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Q1 Marketing Prospects - Updated",
"replace_leads": false,
"leads": [
{
"name": "Sarah Johnson",
"title": "Director of Marketing",
"company": "StartupXYZ",
"email": "sarah@startupxyz.com"
}
]
}'
```
### Delete Lead List
#### DELETE /leadgen/lists/{listId}
Delete a lead list permanently.
#### Parameters
* `listId` (path) - ID of the lead list to delete
#### Example Request
```bash
curl -X DELETE "https://api.intentgpt.ai/leadgen/lists/list_def456" \
-H "X-API-Key: your_api_key"
```
#### Response
```json
{
"status": "success",
"message": "Lead list list_def456 deleted successfully"
}
```
## Error Responses
### Partial Success (207)
When a lead list is created but leads fail to be added:
```json
{
"status": "partial_success",
"error": "Created list but failed to add leads: Invalid lead data",
"list_id": "list_ghi789"
}
```
### Not Found (404)
```json
{
"error": "Lead list not found",
"status": "failed"
}
```
### Bad Request (400)
```json
{
"error": "Missing required fields: name and objective",
"status": "failed"
}
```
## Best Practices
### Lead Generation Tips
1. **Be Specific with Objectives**: Use detailed objectives like "Find CTOs at Series B SaaS companies" rather than just "find executives"
2. **Use Multiple Filters**: Combine domain, topic, and keyword filters for more targeted results
3. **Start Small**: Begin with smaller limits (10-50) to test your criteria before generating larger lists
4. **Iterate on Criteria**: Refine your search criteria based on the quality of initial results
### List Management
1. **Organize by Campaign**: Create separate lists for different campaigns or time periods
2. **Use Descriptive Names**: Include timeframe, target persona, and purpose in list names
3. **Regular Updates**: Update lists regularly to maintain data freshness
4. **Backup Important Lists**: Export critical lists before making major updates
## Use Cases
### Sales Prospecting
Generate targeted prospect lists for outbound sales campaigns:
```bash
curl -X GET "https://api.intentgpt.ai/leadgen" \
-H "X-API-Key: your_api_key" \
-G --data-urlencode "objective=find sales directors at companies showing CRM intent" \
--data-urlencode "topic=CRM" \
--data-urlencode "keyword=salesforce alternative" \
--data-urlencode "limit=100"
```
### Event Marketing
Build attendee lists for webinars or events:
```bash
curl -X POST "https://api.intentgpt.ai/leadgen/lists" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "AI Webinar Prospects",
"objective": "Find IT leaders interested in AI and machine learning",
"topic": "artificial intelligence",
"limit": 500
}'
```
### Account-Based Marketing
Create targeted lists for specific accounts:
```bash
curl -X GET "https://api.intentgpt.ai/leadgen" \
-H "X-API-Key: your_api_key" \
-G --data-urlencode "objective=find decision makers at Fortune 500 companies" \
--data-urlencode "domain=enterprise" \
--data-urlencode "topic=digital transformation" \
--data-urlencode "limit=200"
```
# System & Testing
Source: https://docs.intentgpt.ai/api-reference/system-testing
Health checks, testing, and system monitoring endpoints
## Overview
The System & Testing endpoints provide tools for monitoring API health, testing authentication, and ensuring proper system functionality. These endpoints are essential for monitoring and debugging integrations.
## Health Check
### GET /health
Comprehensive system health check that verifies API server status, database connectivity, and authentication services. This endpoint does not require authentication.
#### Example Request
```bash
curl -X GET "https://api.intentgpt.ai/health"
```
#### Response Statuses
* **200 OK**: All systems operational
* **207 Multi-Status**: Some systems degraded but API functional
* **503 Service Unavailable**: Critical systems down
#### Healthy Response (200)
```json
{
"status": "OK",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"response_time_ms": 45,
"checks": {
"api_server": {
"status": "OK"
},
"database": {
"status": "OK",
"connection": "OK",
"tables": {
"api_management.api_keys": {
"status": "OK",
"exists": true,
"num_rows": 1250,
"created": "2023-01-01T00:00:00.000Z",
"modified": "2024-01-15T09:45:00.000Z"
},
"api_management.user_credits": {
"status": "OK",
"exists": true,
"num_rows": 1250
},
"api_management.usage_logs": {
"status": "OK",
"exists": true,
"num_rows": 125000
}
}
},
"authentication": {
"status": "OK"
}
}
}
```
#### Degraded Response (207)
```json
{
"status": "DEGRADED",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"response_time_ms": 1200,
"message": "Missing required tables: api_management.usage_logs",
"checks": {
"api_server": {
"status": "OK"
},
"database": {
"status": "DEGRADED",
"connection": "OK",
"missing_tables": ["api_management.usage_logs"],
"tables": {
"api_management.api_keys": {
"status": "OK",
"exists": true
},
"api_management.user_credits": {
"status": "OK",
"exists": true
},
"api_management.usage_logs": {
"status": "OK",
"exists": false,
"error": "Table api_management.usage_logs not found"
}
}
},
"authentication": {
"status": "OK"
}
}
}
```
#### Error Response (503)
```json
{
"status": "ERROR",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"error": "Health check failed",
"details": "Database connection timeout",
"checks": {
"api_server": {
"status": "OK"
},
"database": {
"status": "ERROR",
"error": "Connection timeout after 30 seconds"
},
"authentication": {
"status": "UNKNOWN"
}
}
}
```
## Authentication Testing
### GET /test-auth
Test endpoint to verify that your authentication is working correctly. Supports both API key and JWT token authentication methods.
#### Authentication Methods
The endpoint will detect and test whichever authentication method you provide:
1. **API Key**: Use `X-API-Key` header
2. **JWT Token**: Use `Authorization: Bearer` header
3. **Legacy API Key**: Use `Authorization: Bearer` with legacy key
#### Example: Test API Key
```bash
curl -X GET "https://api.intentgpt.ai/test-auth" \
-H "X-API-Key: your_api_key"
```
#### Example: Test JWT Token
```bash
curl -X GET "https://api.intentgpt.ai/test-auth" \
-H "Authorization: Bearer your_jwt_token"
```
#### Success Response (200)
**API Key Authentication:**
```json
{
"message": "Authenticated via API Key",
"auth_method": "api_key",
"user_id": "user_abc123def456"
}
```
**JWT Authentication:**
```json
{
"message": "Authenticated via Clerk",
"auth_method": "clerk",
"user_id": "user_clerk_xyz789"
}
```
**Legacy API Key:**
```json
{
"message": "Authenticated via API Key",
"auth_method": "legacy_api_key",
"user_id": "legacy_key_abcdef12..."
}
```
#### Error Response (401)
```json
{
"error": "Authentication required",
"details": "Use either X-API-Key header or Bearer token"
}
```
## CORS Testing
### GET /cors-test
Test Cross-Origin Resource Sharing (CORS) configuration. This endpoint helps verify that your web application can properly communicate with the API from browser environments.
#### Example Request
```bash
curl -X GET "https://api.intentgpt.ai/cors-test" \
-H "Origin: https://yourdomain.com"
```
#### Response
```json
{
"message": "CORS test successful",
"timestamp": "2024-01-15T10:30:00.000Z"
}
```
#### CORS Headers
The API supports requests from these origins:
* `https://intentgpt.ai`
* `https://www.intentgpt.ai`
* `http://localhost:8080`
* `http://localhost:3000`
* Development workstation URLs
## System Monitoring
### Health Check Integration
The health check endpoint is designed for integration with monitoring systems:
#### Kubernetes Liveness Probe
```yaml
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3
```
#### Docker Health Check
```dockerfile
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost/health || exit 1
```
#### Monitoring Script
```python
import requests
import time
def monitor_api_health():
"""Monitor API health and alert on issues"""
try:
response = requests.get('https://api.intentgpt.ai/health', timeout=30)
if response.status_code == 200:
data = response.json()
print(f"✅ API healthy - Response time: {data['response_time_ms']}ms")
elif response.status_code == 207:
data = response.json()
print(f"⚠️ API degraded - {data.get('message', 'Some systems degraded')}")
elif response.status_code >= 500:
print("🚨 API down - Critical error")
except requests.RequestException as e:
print(f"🚨 API unreachable - {str(e)}")
# Run monitoring
while True:
monitor_api_health()
time.sleep(60) # Check every minute
```
## Error Diagnosis
### Common Issues
#### Authentication Failures
**Symptom**: 401 errors on `/test-auth`
**Solutions**:
1. Verify API key format and validity
2. Check header format (`X-API-Key` vs `Authorization: Bearer`)
3. Ensure key is active using `/toggle_key` endpoint
#### Health Check Degraded
**Symptom**: 207 status on `/health`
**Solutions**:
1. Check database connectivity
2. Verify required tables exist
3. Review system logs for errors
#### CORS Issues
**Symptom**: Browser requests blocked
**Solutions**:
1. Verify origin is in allowed list
2. Test with `/cors-test` endpoint
3. Check preflight OPTIONS requests
### Testing Checklist
Before going to production, test these scenarios:
* [ ] Health check returns 200 OK
* [ ] API key authentication works via `X-API-Key` header
* [ ] JWT token authentication works via `Authorization: Bearer`
* [ ] CORS requests succeed from your domain
* [ ] Error responses are properly formatted
* [ ] Rate limiting is functioning (if applicable)
## Integration Examples
### Frontend Health Check
```javascript
// Check API health before making requests
const checkApiHealth = async () => {
try {
const response = await fetch('https://api.intentgpt.ai/health');
const health = await response.json();
if (response.status === 200) {
console.log('API is healthy');
return true;
} else if (response.status === 207) {
console.warn('API is degraded:', health.message);
return true; // Still functional
} else {
console.error('API is down');
return false;
}
} catch (error) {
console.error('Cannot reach API:', error);
return false;
}
};
// Test authentication before critical operations
const testAuth = async (apiKey) => {
try {
const response = await fetch('https://api.intentgpt.ai/test-auth', {
headers: { 'X-API-Key': apiKey }
});
if (response.status === 200) {
const auth = await response.json();
console.log('Authentication successful:', auth.auth_method);
return true;
} else {
console.error('Authentication failed');
return false;
}
} catch (error) {
console.error('Auth test failed:', error);
return false;
}
};
```
### Backend Monitoring
```python
import requests
import logging
class APIMonitor:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = "https://api.intentgpt.ai"
def comprehensive_check(self):
"""Run all system checks"""
results = {
'health': self.check_health(),
'auth': self.check_auth(),
'cors': self.check_cors()
}
# Log results
for check, result in results.items():
if result['status'] == 'ok':
logging.info(f"✅ {check.upper()} check passed")
else:
logging.error(f"❌ {check.upper()} check failed: {result['error']}")
return results
def check_health(self):
try:
response = requests.get(f"{self.base_url}/health", timeout=10)
if response.status_code in [200, 207]:
return {'status': 'ok', 'data': response.json()}
else:
return {'status': 'error', 'error': f"HTTP {response.status_code}"}
except Exception as e:
return {'status': 'error', 'error': str(e)}
def check_auth(self):
try:
response = requests.get(
f"{self.base_url}/test-auth",
headers={'X-API-Key': self.api_key},
timeout=10
)
if response.status_code == 200:
return {'status': 'ok', 'data': response.json()}
else:
return {'status': 'error', 'error': f"HTTP {response.status_code}"}
except Exception as e:
return {'status': 'error', 'error': str(e)}
def check_cors(self):
try:
response = requests.get(
f"{self.base_url}/cors-test",
headers={'Origin': 'https://yourdomain.com'},
timeout=10
)
if response.status_code == 200:
return {'status': 'ok', 'data': response.json()}
else:
return {'status': 'error', 'error': f"HTTP {response.status_code}"}
except Exception as e:
return {'status': 'error', 'error': str(e)}
# Usage
monitor = APIMonitor("your_api_key")
results = monitor.comprehensive_check()
```
## Best Practices
### Monitoring
1. **Regular Health Checks**: Monitor `/health` every 1-5 minutes
2. **Alert Thresholds**: Alert on 207 (degraded) and 503 (down) responses
3. **Response Time Monitoring**: Track `response_time_ms` for performance trends
### Testing
1. **Pre-deployment Testing**: Always test auth before deploying
2. **CORS Validation**: Test from actual client domains
3. **Error Handling**: Verify your app handles API errors gracefully
### Debugging
1. **Use Test Endpoints**: Leverage `/test-auth` for debugging auth issues
2. **Check Health Details**: Review specific component failures in health checks
3. **Monitor Logs**: Enable logging for all API interactions during debugging
# Development Guide
Source: https://docs.intentgpt.ai/development
Best practices for integrating IntentGPT B2B Intent API
## Development Best Practices
### API Key Management
Store your API key securely using environment variables:
```bash
# .env file
INTENTGPT_API_KEY=p1rOh.your.api.key
```
```javascript
// Load environment variables
require('dotenv').config();
const apiKey = process.env.INTENTGPT_API_KEY;
```
### Error Handling
Implement robust error handling in your API calls:
```javascript
async function getIntent() {
try {
const response = await fetch('https://api.intentgpt.ai/intent', {
headers: {
'x-api-key': process.env.INTENTGPT_API_KEY
}
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
return data;
} catch (error) {
console.error('API Error:', error);
// Handle specific error cases
if (error.status === 401) {
// Handle authentication error
} else if (error.status === 429) {
// Handle rate limit error
}
throw error;
}
}
```
### Pagination Implementation
Handle pagination for large datasets:
```javascript
async function getAllIntent(params = {}) {
let allResults = [];
let offset = 0;
const LIMIT = 1000; // API returns max 1000 rows
while (true) {
const response = await fetch(`https://api.intentgpt.ai/intent?offset=${offset}`, {
headers: {
'x-api-key': process.env.INTENTGPT_API_KEY
}
});
const data = await response.json();
allResults = allResults.concat(data);
if (data.length < LIMIT) {
break; // No more results
}
offset += LIMIT;
}
return allResults;
}
```
### Caching Strategy
Implement caching to optimize API usage:
```javascript
const NodeCache = require('node-cache');
const cache = new NodeCache({ stdTTL: 300 }); // 5 minutes cache
async function getCachedIntent(params) {
const cacheKey = JSON.stringify(params);
const cached = cache.get(cacheKey);
if (cached) {
return cached;
}
const response = await fetch('https://api.intentgpt.ai/intent', {
headers: {
'x-api-key': process.env.INTENTGPT_API_KEY
},
params
});
const data = await response.json();
cache.set(cacheKey, data);
return data;
}
```
### Parameter Validation
Validate parameters before making API calls:
```javascript
function validateParams(params) {
const validIntentLevels = ['ONFIRE', 'HOT', 'WARM', 'COLD'];
if (params.intent_levels) {
const levels = params.intent_levels.split(',');
const invalidLevels = levels.filter(level => !validIntentLevels.includes(level));
if (invalidLevels.length > 0) {
throw new Error(`Invalid intent levels: ${invalidLevels.join(', ')}`);
}
}
if (params.companies) {
const companies = params.companies.split(',');
companies.forEach(company => {
if (!company.includes('.')) {
throw new Error(`Invalid company domain: ${company}`);
}
});
}
return params;
}
```
### Rate Limit Handling
Implement rate limit handling with exponential backoff:
```javascript
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(url, options);
if (response.ok) {
return response;
}
if (response.status === 429) {
const waitTime = Math.pow(2, i) * 1000;
await new Promise(resolve => setTimeout(resolve, waitTime));
continue;
}
throw new Error(`HTTP error! status: ${response.status}`);
} catch (error) {
if (i === maxRetries - 1) throw error;
}
}
}
```
### Webhook Implementation
Set up webhooks to receive real-time updates:
```javascript
const express = require('express');
const app = express();
app.post('/webhook', express.json(), (req, res) => {
const { intent_level, company, topic } = req.body;
// Process intent update
console.log(`New intent signal: ${company} - ${intent_level} for ${topic}`);
// Update your system
updateIntentData(req.body);
res.status(200).send('Webhook received');
});
```
## Testing
### API Testing
Use Jest for testing API integration:
```javascript
describe('IntentGPT API', () => {
test('fetches intent data successfully', async () => {
const response = await getIntent({
companies: 'example.com',
topics: 'marketing',
intent_levels: 'HOT'
});
expect(response).toBeDefined();
expect(Array.isArray(response)).toBe(true);
});
test('handles invalid API key', async () => {
process.env.INTENTGPT_API_KEY = 'invalid_key';
await expect(getIntent())
.rejects
.toThrow('Authentication failed');
});
});
```
## Monitoring
### Logging Implementation
```javascript
const winston = require('winston');
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
transports: [
new winston.transports.File({ filename: 'intent-api.log' })
]
});
async function loggedIntentFetch(params) {
const startTime = Date.now();
try {
const result = await getIntent(params);
logger.info('API call successful', {
params,
duration: Date.now() - startTime,
resultCount: result.length
});
return result;
} catch (error) {
logger.error('API call failed', {
params,
error: error.message,
duration: Date.now() - startTime
});
throw error;
}
}
```
## Troubleshooting
1. Verify parameter formatting
2. Check if company domains are correct
3. Ensure intent levels are uppercase
4. Try removing filters to test broader results
1. Verify API key format (should start with 'p1rOh')
2. Check if key is properly set in headers
3. Ensure key hasn't been revoked
4. Try generating a new API key
## Support Resources
* Technical Support: [support@intentgpt.ai](mailto:support@intentgpt.ai)
* API Status: [status.intentgpt.ai](https://status.intentgpt.ai)
* Developer Community: [community.intentgpt.ai](https://community.intentgpt.ai)
For enterprise support and custom integration assistance, contact our team at
[enterprise@intentgpt.ai](mailto:enterprise@intentgpt.ai)
# Introduction
Source: https://docs.intentgpt.ai/introduction
GTM-focused B2B Intelligence API with actionable insights for sales teams
## What is IntentGPT?
IntentGPT is a GTM-focused B2B intelligence API that delivers compact, actionable insights for sales and marketing teams. Our platform combines intent analysis, lead generation, and customer profiling in streamlined responses optimized for immediate sales action rather than verbose research reports.
GTM-focused company insights with lead scoring, pain points, and competitive intelligence
Generate qualified leads with AI-powered targeting based on objectives, domains, topics, and keywords
Individual prospect analysis with lead scoring, buying signals, and decision-power assessment
Enterprise-grade health monitoring, authentication testing, and system diagnostics
## Popular Integrations
Power Clay workflows with high-intent leads and real-time prospect data
Automatically sync qualified leads to Salesforce, HubSpot, and other CRMs
## Core Capabilities
### 🎯 GTM Intelligence Engine
Our streamlined intelligence system provides actionable insights for sales teams:
* **Company Intelligence** - GTM-focused company analysis with competitive context
* **Person Intelligence** - Individual prospect scoring with buying signals and decision power
* **Lead Prioritization** - Three-level scoring system (Hot, Warm, Cold) for sales focus
* **Auto-Profile Detection** - Automatic context analysis using your company domain
### 🚀 AI-Powered Lead Generation
Generate high-quality leads with intelligent targeting:
* **Objective-Based Generation** - Specify clear objectives like "find marketing leaders in SaaS"
* **Multi-Filter Targeting** - Combine domain, topic, and keyword filters for precision
* **Lead List Management** - Create, update, and manage lead lists programmatically
* **Scalable Output** - Generate 1-1000 leads per request based on your needs
* **Real-Time Processing** - Get fresh leads generated on-demand
### 👥 Prospect Intelligence & Scoring
Build actionable prospect understanding:
* **Lead Scoring** - 1-10 qualification scores based on role, intent, and buying power
* **Buying Signal Detection** - Identify prospects in active evaluation stages
* **Decision Power Assessment** - Understand stakeholder influence and authority
* **Pain Point Analysis** - Focus outreach on specific business challenges
## Getting Started
Sign up and receive your API key with 5000 free credits - no credit card required
Verify your setup using our `/test-auth` endpoint with your API key
Use the `/leadgen` endpoint to generate qualified prospects based on your criteria
Explore prospects using `/company` and `/person` endpoints for GTM insights
Integrate our API into your sales and marketing workflows
## API Architecture
### Authentication Methods
* **API Key Authentication** - Simple header-based auth with `X-API-Key`
* **JWT Bearer Tokens** - Clerk-based authentication for web applications
* **Legacy Support** - Backward compatibility for existing integrations
### Credit System
* **5000 Free Credits** - Generous starting allocation for new users
* **Transparent Pricing** - Clear credit costs per endpoint and operation
* **Real-Time Monitoring** - Track usage with `/api/credits` endpoint
* **Flexible Scaling** - Pay-as-you-grow model for businesses of all sizes
### Enterprise Features
* **Health Monitoring** - Comprehensive system health checks and diagnostics
* **CORS Support** - Full browser compatibility for web applications
* **Rate Limiting** - Intelligent rate limiting to ensure service quality
* **Error Handling** - Standardized error responses with actionable error codes
## Use Cases
### Sales Intelligence
```bash
# Find high-intent prospects in your target market
curl -X GET "https://api.intentgpt.ai/leadgen" \
-H "X-API-Key: your_api_key" \
-G --data-urlencode "objective=find CTOs at Series B SaaS companies showing DevOps intent" \
--data-urlencode "topic=DevOps" \
--data-urlencode "limit=100"
```
### Marketing Automation
```bash
# Create targeted lead lists for campaigns
curl -X POST "https://api.intentgpt.ai/leadgen/lists" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Q1 Marketing Campaign",
"objective": "find marketing directors showing MarTech intent",
"topic": "marketing automation",
"limit": 500
}'
```
### Company Intelligence
```bash
# Analyze specific company for GTM insights
curl -X GET "https://api.intentgpt.ai/company?website=targetcompany.com" \
-H "Authorization: Bearer your_api_key"
```
### Person Intelligence
```bash
# Analyze individual prospect for lead qualification
curl -X GET "https://api.intentgpt.ai/person?linkedin=prospect-name" \
-H "Authorization: Bearer your_api_key"
```
## Priority Levels Explained
Our GTM-focused priority system helps you focus on the highest-value prospects:
High-priority prospects with strong buying signals and immediate opportunity
Qualified prospects showing moderate intent, worth nurturing
Early-stage prospects requiring long-term relationship building
## Integration Examples
### CRM Synchronization
```javascript
// Fetch and sync high-priority leads to your CRM
const syncHighPriorityLeads = async () => {
const response = await fetch('https://api.intentgpt.ai/leadgen', {
headers: {
'Authorization': `Bearer ${process.env.INTENTGPT_API_KEY}`
}
});
const params = new URLSearchParams({
objective: 'find decision makers showing buying intent',
limit: '100'
});
const leadData = await response.json();
// Sync to CRM with priority scoring
await updateCRM(leadData);
};
```
### Lead List Automation
```python
# Automatically generate and manage lead lists
import requests
def create_weekly_lead_list():
response = requests.post(
'https://api.intentgpt.ai/leadgen/lists',
headers={'X-API-Key': 'your_api_key'},
json={
'name': f'Weekly Prospects - {datetime.now().strftime("%Y-%m-%d")}',
'objective': 'find marketing leaders showing MarTech intent',
'topic': 'marketing automation',
'domain': 'saas',
'limit': 200
}
)
lead_list = response.json()
return lead_list['lead_list']['list_id']
```
### Real-Time Company Monitoring
```javascript
// Monitor GTM opportunities for key accounts
const monitorKeyAccounts = async (accounts) => {
const promises = accounts.map(domain =>
fetch(`https://api.intentgpt.ai/company?website=${domain}`, {
headers: { 'Authorization': `Bearer ${process.env.INTENTGPT_API_KEY}` }
})
);
const results = await Promise.all(promises);
const companyData = await Promise.all(results.map(r => r.json()));
// Process GTM opportunities and trigger alerts
processGTMAlerts(companyData);
};
```
### Clay Integration
```javascript
// Clay webhook integration for lead enrichment
const enrichLeadsWithClay = async (leadList) => {
// First, generate leads with IntentGPT
const response = await fetch('https://api.intentgpt.ai/leadgen', {
method: 'GET',
headers: { 'X-API-Key': process.env.INTENTGPT_API_KEY }
});
const params = new URLSearchParams({
objective: 'find marketing leaders in SaaS companies',
topic: 'marketing automation',
limit: '50'
});
const leads = await response.json();
// Send to Clay for enrichment via webhook
const clayWebhookUrl = 'https://hooks.clay.com/your-webhook-id';
for (const lead of leads.leads) {
await fetch(clayWebhookUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
company: lead.company,
contact_name: lead.name,
contact_title: lead.title,
intent_score: lead.intent_score,
source: 'IntentGPT',
enrichment_request: true
})
});
}
};
```
## Clay Integration Guide
IntentGPT integrates with Clay through HTTP API enrichment columns. Clay doesn't have a public REST API, so you'll use IntentGPT's API endpoints directly within Clay tables for real-time enrichment.
### Setup: Company Intelligence in Clay
**Step 1: Create your Clay table with these columns:**
* `Company Domain` (text input)
* `GTM Score` (HTTP API column)
* `Priority Level` (HTTP API column)
* `Summary` (HTTP API column)
* `Top Opportunities` (HTTP API column)
**Step 2: Configure HTTP API column for Company Intelligence:**
In your Clay table's HTTP API column, use these settings:
**API URL:**
```
https://api.intentgpt.ai/company?website={{Company Domain}}
```
**Headers:**
```json
{
"Authorization": "Bearer YOUR_INTENTGPT_API_KEY"
}
```
**Response Mapping:**
* **GTM Score:** `{{gtm_insights.gtm_score}}`
* **Priority Level:** `{{gtm_insights.priority_level}}`
* **Summary:** `{{gtm_insights.summary}}`
* **Top Opportunities:** `{{gtm_insights.top_opportunities[0].area}}`
### Setup: Person Intelligence in Clay
**Step 1: Create your Clay table with these columns:**
* `LinkedIn URL` (text input)
* `Lead Score` (HTTP API column)
* `Priority` (HTTP API column)
* `Contact Info` (HTTP API column)
* `Buying Stage` (HTTP API column)
**Step 2: Configure HTTP API column for Person Intelligence:**
**API URL:**
```
https://api.intentgpt.ai/person?linkedin={{LinkedIn URL}}
```
**Headers:**
```json
{
"Authorization": "Bearer YOUR_INTENTGPT_API_KEY"
}
```
**Response Mapping:**
* **Lead Score:** `{{person_gtm.lead_score}}`
* **Priority:** `{{person_gtm.priority}}`
* **Contact Info:** `{{person_gtm.contact_info.name}} - {{person_gtm.contact_info.title}}`
* **Buying Stage:** `{{person_gtm.buying_signals.stage}}`
### Clay Webhook Integration
Set up webhooks to trigger IntentGPT analysis when new prospects are added to Clay:
```javascript
// Express.js webhook handler
app.post('/clay-webhook', async (req, res) => {
const { company_domain, contact_name, row_id } = req.body;
if (company_domain) {
// Analyze intent for the new company
const intentResponse = await fetch(`https://api.intentgpt.ai/company?domain=${company_domain}`, {
headers: { 'X-API-Key': process.env.INTENTGPT_API_KEY }
});
const intentData = await intentResponse.json();
// Update Clay row with intent analysis
await fetch(`https://api.clay.com/v1/tables/your-table-id/rows/${row_id}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.CLAY_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
'Intent Score': intentData.intent_level,
'Intent Analysis Date': new Date().toISOString(),
'Buying Signals': intentData.intent_data?.signals?.join(', ') || 'None detected'
})
});
}
res.status(200).json({ success: true });
});
```
### Clay Automation Recipes
#### Recipe 1: High-Intent Prospect Pipeline
1. **IntentGPT**: Generate leads with `objective: "find decision makers showing buying intent"`
2. **Clay**: Enrich with email, phone, social profiles
3. **Clay**: Score and prioritize based on company size, industry
4. **Clay**: Auto-send to Salesforce/HubSpot as qualified leads
#### Recipe 2: Account Monitoring Dashboard
1. **Clay**: Maintain list of target accounts
2. **IntentGPT**: Daily GTM score updates via `/company` endpoint
3. **Clay**: Alert when priority level increases to Hot
4. **Clay**: Trigger outreach sequences for high-priority accounts
#### Recipe 3: Competitor Intelligence
1. **IntentGPT**: Analyze companies showing competitive evaluation signals
2. **Clay**: Enrich competitor prospects with contact data
3. **Clay**: Build targeted lists of companies considering competitors
4. **Clay**: Launch win-back or competitive campaigns
**Pro Tip**: Use IntentGPT's lead list management features to organize prospects by campaign, then sync specific lists to dedicated Clay tables for different workflows.
## Developer Experience
### Simple Integration
Our RESTful API follows standard HTTP conventions with predictable endpoints, comprehensive error handling, and detailed documentation for every feature.
### Testing & Debugging
* **Authentication Testing** - Verify your setup with `/test-auth`
* **Health Monitoring** - Check system status with `/health`
* **CORS Testing** - Validate browser integration with `/cors-test`
### Multiple SDKs
* **JavaScript/TypeScript** - Full-featured SDK with TypeScript support
* **Python** - Native Python integration with async support
* **REST API** - Use with any language that supports HTTP requests
IntentGPT processes millions of intent signals daily to provide the freshest, most actionable B2B intelligence. Our API is built for scale, handling everything from startup growth to enterprise-level integrations.
## Ready to Start?
Get up and running in 5 minutes with your first API calls
Comprehensive documentation for all endpoints and features
Learn how to generate and manage qualified leads
Monitor system health and test your integration
## Resources
Join our community of B2B developers and get expert advice
Get help from our technical team and integration specialists
# Quickstart
Source: https://docs.intentgpt.ai/quickstart
Get started with IntentGPT B2B Intent API in minutes
## Getting Started with IntentGPT
Follow these steps to start accessing B2B intent data through our API.
### Authentication Setup
1. Sign up for an account at [intentgpt.ai/dashboard](https://intentgpt.ai/dashboard)
2. Navigate to the API Keys section
3. Your API key will be in the format: `p1rOh.xxxxxxxxxxxxxxx.xxxxxxxxxxxx`
Never expose your API key in client-side code or public repositories. Use environment variables
or secure secret management systems to store your API key.
```bash
# Example using environment variables
export INTENTGPT_API_KEY="p1rOh.your.api.key"
```
### Making Your First API Call
Here's a simple example to get you started:
```bash
curl -X GET "https://api.intentgpt.ai/intent" \
-H "x-api-key: your_api_key"
```
This will return intent data for all companies and topics within the default limits.
### Filtering Results
#### By Companies
```bash
curl -X GET "https://api.intentgpt.ai/intent" \
-H "x-api-key: your_api_key" \
-G --data-urlencode "companies=salesforce.com,oracle.com"
```
#### By Topics
```bash
curl -X GET "https://api.intentgpt.ai/intent" \
-H "x-api-key: your_api_key" \
-G --data-urlencode "topics=marketing"
```
#### By Intent Level
```bash
curl -X GET "https://api.intentgpt.ai/intent" \
-H "x-api-key: your_api_key" \
-G --data-urlencode "intent_levels=HOT"
```
### Using with Programming Languages
#### JavaScript/Node.js
```javascript
const axios = require('axios');
async function getIntent() {
try {
const response = await axios.get('https://api.intentgpt.ai/intent', {
headers: {
'x-api-key': 'your_api_key'
},
params: {
companies: 'salesforce.com,oracle.com',
topics: 'marketing',
intent_levels: 'HOT'
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
```
#### Python
```python
import requests
def get_intent():
headers = {
'x-api-key': 'your_api_key'
}
params = {
'companies': 'salesforce.com,oracle.com',
'topics': 'marketing',
'intent_levels': 'HOT'
}
response = requests.get(
'https://api.intentgpt.ai/intent',
headers=headers,
params=params
)
return response.json()
```
### Pagination
For large datasets, use the offset parameter:
```bash
curl -X GET "https://api.intentgpt.ai/intent" \
-H "x-api-key: your_api_key" \
-G --data-urlencode "offset=100"
```
## Understanding Intent Levels
Our API uses four intent levels to categorize B2B signals:
* **ONFIRE**: Highest intent level - immediate buying signals
* **HOT**: Strong interest and engagement
* **WARM**: Moderate interest
* **COLD**: Minimal or early-stage interest
## Next Steps
Explore our complete API documentation
Learn how others are using intent data
Optimize your API usage
Get help from our developer community