# Api keys Source: https://docs.seleqt.ai/api-reference/api-keys ## API Keys Manage your API keys. ### List keys GET `/api/v1/api-keys/` Response ```json theme={null} { "api_keys": [ { "id": 1, "name": "Server key", "prefix": "a1b2c3d4", "is_active": true, "last_used": "2025-06-09T11:22:33Z", "created_at": "2025-06-08T12:00:00Z", "updated_at": "2025-06-08T12:00:00Z" } ] } ``` ### Create key POST `/api/v1/api-keys/` Body ```json theme={null} { "name": "Server key" } ``` Response (note: `key` is only returned once) ```json theme={null} { "id": 2, "name": "Server key", "prefix": "9f84ab12", "is_active": true, "last_used": null, "created_at": "2025-06-09T10:00:00Z", "updated_at": "2025-06-09T10:00:00Z", "key": "9f84ab12.qwerty..." } ``` ### Rotate key POST `/api/v1/api-keys/{id}/rotate/` Response ```json theme={null} { "id": 2, "name": "Server key", "prefix": "6c3a9d77", "is_active": true, "last_used": null, "created_at": "2025-06-09T10:00:00Z", "updated_at": "2025-06-09T10:05:00Z", "key": "6c3a9d77.abcd..." } ``` * Old key is invalidated immediately ### Revoke key POST `/api/v1/api-keys/{id}/revoke/` Response ```json theme={null} { "success": true } ``` ### Notes * Store the `key` securely when creating/rotating; you won’t be able to retrieve the secret again. * Use the `prefix` to identify keys without exposing the full secret. # Api logs Source: https://docs.seleqt.ai/api-reference/api-logs ## API Call Logs Retrieve recent API calls made with your keys. ### List logs GET `/api/v1/api-keys/logs/?limit=50` Response ```json theme={null} { "logs": [ { "id": 123, "path": "/api/v1/public/chats", "method": "GET", "status_code": 200, "ip_address": "203.0.113.10", "response_ms": 42, "created_at": "2025-06-09T11:22:33Z" } ] } ``` * Default `limit` is 50 * Only public endpoints are logged # Campaigns list Source: https://docs.seleqt.ai/api-reference/campaigns-list ## GET /api/v1/campaigns/ Returns a list of campaigns with optional workspace filtering. **Authentication:** Session-based (JWT Cookie) OR API Key (X-API-Key header) ### Query Parameters * `workspace_id` (string, optional): Filter campaigns by workspace * Omit parameter: Returns campaigns from current workspace * `workspace_id=123`: Returns campaigns from workspace 123 (if user has access) * `workspace_id=ALL`: Returns campaigns from all workspaces user has access to ### Security Users can only access campaigns from workspaces they are linked to via `linked_workspaces`. ### Response ```json theme={null} { "campaigns": [ { "id": 123, "name": "My Campaign", "status": "ACTIVE", "workspace_id": 340, "timezone": "Europe/Amsterdam", "language": "en", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z", "prospect_count": 150 } ] } ``` ### Examples **Using API Key (recommended for integrations):** ```bash theme={null} # Get campaigns from current workspace curl -X GET "https://app.seleqt.ai/api/v1/campaigns/" \ -H "X-API-Key: your_api_key_here" # Get campaigns from specific workspace curl -X GET "https://app.seleqt.ai/api/v1/campaigns/?workspace_id=340" \ -H "X-API-Key: your_api_key_here" # Get campaigns from all workspaces curl -X GET "https://app.seleqt.ai/api/v1/campaigns/?workspace_id=ALL" \ -H "X-API-Key: your_api_key_here" ``` **Using Session Cookie (for web apps):** ```bash theme={null} curl -X GET "https://app.seleqt.ai/api/v1/campaigns/" \ -H "Cookie: sessionid=your_session_id" ``` ### Error Responses **403 Forbidden** - User doesn't have access to specified workspace: ```json theme={null} { "error": "Access denied" } ``` # Dashboard campaign analytics Source: https://docs.seleqt.ai/api-reference/dashboard-campaign-analytics ## GET /api/v1/dashboard/campaign-analytics/ Returns aggregated analytics for campaigns with optional workspace filtering. **Authentication:** Session-based (JWT Cookie) OR API Key (X-API-Key header) ### Query Parameters * `workspace_id` (string, optional): Filter analytics by workspace * Omit parameter: Returns analytics from current workspace * `workspace_id=123`: Returns analytics from workspace 123 (if user has access) * `workspace_id=ALL`: Returns analytics from all workspaces user has access to ### Security Users can only access analytics from workspaces they are linked to via `linked_workspaces`. ### Response ```json theme={null} { "campaigns": [ { "id": 123, "name": "My Campaign", "status": "ACTIVE", "workspace_id": 340, "analytics": { "amount_of_prospects": 150, "amount_of_emails_sent": 45, "amount_of_invites_sent": 30, "amount_of_invites_accepted": 12, "amount_of_linkedin_messages_sent": 25, "amount_of_prospects_contacted": 70, "amount_of_replies": 8, "amount_of_interested": 3, "average_reply_time": "2 days" } } ] } ``` ### Examples **Using API Key (recommended for integrations):** ```bash theme={null} # Get analytics from current workspace curl -X GET "https://app.seleqt.ai/api/v1/dashboard/campaign-analytics/" \ -H "X-API-Key: your_api_key_here" # Get analytics from specific workspace curl -X GET "https://app.seleqt.ai/api/v1/dashboard/campaign-analytics/?workspace_id=340" \ -H "X-API-Key: your_api_key_here" # Get analytics from all workspaces curl -X GET "https://app.seleqt.ai/api/v1/dashboard/campaign-analytics/?workspace_id=ALL" \ -H "X-API-Key: your_api_key_here" ``` **Using Session Cookie (for web apps):** ```bash theme={null} curl -X GET "https://app.seleqt.ai/api/v1/dashboard/campaign-analytics/" \ -H "Cookie: sessionid=your_session_id" ``` ### Error Responses **403 Forbidden** - User doesn't have access to specified workspace: ```json theme={null} { "error": "Access denied" } ``` ### Use Cases 1. **Dashboard Overview**: Use `workspace_id=ALL` to show aggregated metrics across all user's workspaces 2. **Workspace-Specific View**: Use specific `workspace_id` to filter analytics for a single workspace 3. **Current Workspace**: Omit parameter for default behavior (current workspace only) # Account Analytics Source: https://docs.seleqt.ai/api-reference/public/account-analytics Get account-wide analytics across all campaigns ## GET /api/v1/public/analytics/ Returns account-wide analytics across all campaigns (homepage analytics). Auth: `X-API-Key` ### Query Parameters * `start_date` (string, optional): Filter analytics from this date (YYYY-MM-DD format) * `end_date` (string, optional): Filter analytics until this date (YYYY-MM-DD format) * `sender_accounts` (array, optional): Filter by specific sender account IDs * `campaigns` (array, optional): Filter by specific campaign IDs * `campaign_statuses` (array, optional): Filter by campaign statuses (DRAFT, ACTIVE, PAUSED, COMPLETED, ARCHIVED) ### Response ```json theme={null} { "success": true, "analytics": { "total_prospects": 1250, "total_emails_sent": 450, "total_linkedin_messages_sent": 320, "total_invites_sent": 280, "total_invites_accepted": 95, "total_replies": 67, "total_interested": 23, "reply_rate": 8.7, "invite_acceptance_rate": 33.9, "daily_metrics": [ { "date": "15 Jan", "emails_sent": 25, "linkedin_messages_sent": 18, "invites_sent": 12, "invites_accepted": 4, "replies": 3, "interested": 1 } ] } } ``` ### Example ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/analytics/" ``` ### Example with Date Range ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/analytics/?start_date=2024-01-01&end_date=2024-01-31" ``` ### Example with Filters ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/analytics/?campaigns=123&campaigns=456&campaign_statuses=ACTIVE&sender_accounts=789" ``` ### Response Fields * `total_prospects`: Total number of prospects across all campaigns * `total_emails_sent`: Total emails sent across all campaigns * `total_linkedin_messages_sent`: Total LinkedIn messages sent across all campaigns * `total_invites_sent`: Total LinkedIn invites sent across all campaigns * `total_invites_accepted`: Total LinkedIn invites accepted across all campaigns * `total_replies`: Total replies received across all campaigns * `total_interested`: Total prospects marked as interested across all campaigns * `reply_rate`: Overall reply rate percentage (replies / total contacted) * `invite_acceptance_rate`: Overall invite acceptance rate percentage * `daily_metrics`: Array of daily metrics (only included when date range is provided) ### Daily Metrics Fields When a date range is provided, the response includes `daily_metrics` with the following fields for each day: * `date`: Date in "DD MMM" format * `emails_sent`: Emails sent on this date * `linkedin_messages_sent`: LinkedIn messages sent on this date * `invites_sent`: LinkedIn invites sent on this date * `invites_accepted`: LinkedIn invites accepted on this date * `replies`: Replies received on this date * `interested`: Prospects marked as interested on this date # Campaigns Source: https://docs.seleqt.ai/api-reference/public/campaigns ## GET /api/v1/public/campaigns/ List campaigns accessible with your API key. Auth: `X-API-Key` ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/campaigns/" ``` # Campaigns analytics Source: https://docs.seleqt.ai/api-reference/public/campaigns-analytics ## GET /api/v1/public/campaigns//analytics/ Returns comprehensive analytics for the campaign including metrics, daily data, and A/B testing results. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID ### Query Parameters * `start_date` (string, optional): Filter analytics from this date (YYYY-MM-DD format) * `end_date` (string, optional): Filter analytics until this date (YYYY-MM-DD format) ### Response ```json theme={null} { "success": true, "analytics": { "amount_of_prospects": 150, "amount_of_emails_sent": 45, "amount_of_invites_sent": 30, "amount_of_invites_accepted": 12, "amount_of_linkedin_messages_sent": 25, "amount_of_prospects_contacted": 70, "amount_of_replies": 8, "amount_of_interested": 3, "average_reply_time": "2 days", "daily_metrics": [ { "date": "15 Jan", "emails_sent": 5, "linkedin_messages_sent": 3, "invites_sent": 2, "invites_accepted": 1, "replies": 1, "interested": 0 } ], "ab_testing": { "tests": [ { "step_id": 456, "step_name": "Email Step", "variant_a": { "subject_line": "Original Subject", "message_template": "Original message", "sent_count": 25, "reply_count": 3, "reply_rate": 12.0 }, "variant_b": { "subject_line": "Alternative Subject", "message_template": "Alternative message", "sent_count": 25, "reply_count": 5, "reply_rate": 20.0 } } ] }, "pipeline": { "leads_contacted": 70, "replied": 8, "interested": 3, "meeting_scheduled": 1 }, "metrics_per_step": { "456": { "emails_sent": 45, "replies": 8, "reply_rate": 17.8 } } } } ``` ### Example ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/campaigns/123/analytics/" ``` ### Example with Date Range ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/campaigns/123/analytics/?start_date=2024-01-01&end_date=2024-01-31" ``` # Campaigns conditions create Source: https://docs.seleqt.ai/api-reference/public/campaigns-conditions-create ## POST /api/v1/public/campaigns//conditions/ Adds a new condition to a campaign. Conditions allow you to create branching logic in your campaign flow. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID ### Request Body ```json theme={null} { "condition_type": "HAS_EMAIL", "delay_in_hours": 0, "parent_step_id": 123, "yes_child_step_id": 456, "no_child_step_id": 789 } ``` ### Available Condition Types * `HAS_EMAIL`: Check if the prospect has an email address * `HAS_EMAIL_PREMIUM`: Check if the prospect has a premium email (Gmail, Outlook, etc.) * `ACCEPTED_INVITE`: Check if the prospect accepted the LinkedIn connection request * `ALREADY_CONNECTED`: Check if the prospect is already connected on LinkedIn ### Flow Management Fields * `parent_step_id` (integer, optional): ID of the step that comes before this condition * `yes_child_step_id` (integer, optional): ID of the step to execute if condition is true * `no_child_step_id` (integer, optional): ID of the step to execute if condition is false ### Response ```json theme={null} { "success": true, "condition": { "id": 101, "condition_type": "HAS_EMAIL", "delay_in_hours": 0, "parent_step_id": 123, "yes_child_step_id": 456, "no_child_step_id": 789, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, "campaign": {...} } ``` ### Example ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "condition_type": "HAS_EMAIL", "parent_step_id": 123, "yes_child_step_id": 456, "no_child_step_id": 789 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/conditions/" ``` ### Building Conditional Flows Here's an example of how to create a conditional campaign flow: #### 1. Create initial LinkedIn invite ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "step_type": "LINKEDIN_INVITE", "message_template": "Hi {{first_name}}, I would love to connect!", "delay_in_hours": 0 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` #### 2. Create a condition to check if they have email ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "condition_type": "HAS_EMAIL", "parent_step_id": 456 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/conditions/" ``` #### 3. Create email step for prospects with email (YES path) ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "step_type": "EMAIL", "message_template": "Hi {{first_name}}, thanks for connecting!", "subject_line": "Quick question about {{company_name}}", "delay_in_hours": 24, "parent_condition_id": 101 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` #### 4. Create LinkedIn message for prospects without email (NO path) ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "step_type": "LINKEDIN_MESSAGE", "message_template": "Thanks for connecting {{first_name}}! I would love to discuss how we can help {{company_name}}.", "delay_in_hours": 48, "parent_condition_id": 101 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` This creates a flow: LinkedIn Invite → Check if has email → Email (if yes) OR LinkedIn Message (if no) # Campaigns create Source: https://docs.seleqt.ai/api-reference/public/campaigns-create ## POST /api/v1/public/campaigns/ Creates a new campaign with the specified name. Auth: `X-API-Key` ### Request Body ```json theme={null} { "name": "My New Campaign" } ``` ### Response ```json theme={null} { "success": true, "campaign": { "id": 123, "name": "My New Campaign", "status": "DRAFT", "timezone": "Europe/Amsterdam", "language": "en", "email_max_messages": 40, "linkedin_max_messages": 100, "linkedin_max_connections": 50, "sending_window": {}, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" } } ``` ### Example ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{"name": "My New Campaign"}' \ "https://api.seleqt.ai/api/v1/public/campaigns/" ``` # Campaigns export Source: https://docs.seleqt.ai/api-reference/public/campaigns-export ## POST /api/v1/public/campaigns/:id/export/ Export leads from a campaign as JSON. * Auth: `X-API-Key` * Query params (form fields or JSON body fields) * `page_size` (default 100, max 100): number of leads per page * `start_page` (optional): first page index (1-based) * `end_page` (optional): last page index (inclusive) Example response item ```json theme={null} { "first_name": "Alex", "last_name": "Doe", "linkedin_profile_url": "https://www.linkedin.com/in/alex-doe/", "profile_picture_url": "https://example.com/alex.jpg", "job_title": "Head of Sales", "industry": "SaaS", "email": "alex@example.com", "phone_number": "+1 555 0100", "location": "Amsterdam, NL", "custom_fields": { "plan": "pro" }, "company": { "name": "Acme Inc", "industry": "Software", "linkedin_url": "https://www.linkedin.com/company/acme/", "website_url": "https://acme.com", "location": "Amsterdam, NL", "revenue": "$10M-$50M", "amount_of_employees": "51-200" }, "messages": [ { "sender": "Jane Smith", "sender_id": 42, "sent_by_lead": false, "subject_line": "Re: Quick question", "message": "Hi Alex, thanks for reaching out...", "sent_at": "2025-06-09T11:22:33Z", "read": true } ], "enrichment_columns": [ { "column": "tech_stack", "value": "React, Node.js", "sources": ["BuiltWith"] }, { "column": "funding_round", "value": "Series A" } ], "actions": [ { "step_type": "EMAIL", "executed_at": "2025-06-08T10:00:00Z", "message": "Hi Alex...", "subject_line": "Alex, quick question", "sender": "Jane Smith", "sender_id": 42, "completed": true } ] } ``` Fields * lead info: `first_name`, `last_name`, `linkedin_profile_url`, `profile_picture_url`, `job_title`, `industry`, `email`, `phone_number`, `location`, `custom_fields` * company: `name`, `industry`, `linkedin_url`, `website_url`, `location`, `revenue`, `amount_of_employees` * messages\[]: `sender`, `sender_id`, `sent_by_lead` (boolean), `subject_line`, `message`, `sent_at` (ISO8601), `read` (boolean) * enrichment\_columns\[]: `column`, `value`, `sources` (optional array) * actions\[]: `step_type`, `executed_at` (ISO8601), `message` (optional), `subject_line` (optional), `sender`, `sender_id`, `completed` (boolean) # Campaigns get Source: https://docs.seleqt.ai/api-reference/public/campaigns-get ## GET /api/v1/public/campaigns// Returns comprehensive campaign details including all steps, conditions, connected accounts, and prospect count. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID ### Response ```json theme={null} { "success": true, "campaign": { "id": 123, "name": "My Campaign", "status": "DRAFT", "timezone": "Europe/Amsterdam", "language": "en", "email_max_messages": 40, "linkedin_max_messages": 100, "linkedin_max_connections": 50, "sending_window": { "monday": {"enabled": true, "start": "09:00", "end": "17:00"}, "tuesday": {"enabled": true, "start": "09:00", "end": "17:00"} }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z", "accounts": [...], "steps": [...], "conditions": [...], "first_step": {...}, "first_condition": null, "prospect_count": 150 } } ``` ### Example ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/campaigns/123/" ``` # Campaigns import Source: https://docs.seleqt.ai/api-reference/public/campaigns-import ## POST /api/v1/public/campaigns/:campaign\_id/import/ Import leads into a campaign. Auth: `X-API-Key` Body ```json theme={null} { "leads": [ { "first_name": "Alex", "last_name": "Doe", "linkedin_profile_url": "https://www.linkedin.com/in/alex-doe/", "profile_picture_url": "https://example.com/alex.jpg", "job_title": "Head of Sales", "industry": "SaaS", "email": "alex@example.com", "phone_number": "+1 555 0100", "location": "Amsterdam, NL", "custom_fields": { "plan": "pro" }, "company_name": "Acme Inc", "company_industry": "Software", "company_linkedin_url": "https://www.linkedin.com/company/acme/", "company_website_url": "https://acme.com", "company_location": "Amsterdam, NL" } ], "activate": true } ``` Fields * Array name: `leads` * **first\_name** (required) * **last\_name** (required) * **linkedin\_profile\_url** (required) * **profile\_picture\_url** (optional) * **job\_title** (optional) * **industry** (optional) * **email** (optional) * **phone\_number** (optional) * **location** (optional) * **custom\_fields** (optional JSON object) * **company\_name** (optional) * **company\_industry** (optional) * **company\_linkedin\_url** (optional) * **company\_website\_url** (optional) * **company\_location** (optional) Notes * You can also send a nested `company` object with keys `name`, `website_url`, `linkedin_url`, `industry`, `location` instead of the flattened `company_*` fields. The API accepts either format. * Optional flag: `activate` (boolean). When `true`, newly imported leads are immediately scheduled/launched in the campaign. Only works if the campaign is already `ACTIVE`. If the campaign is `DRAFT`, leads are added but not activated (returns a warning). If `PAUSED`, actions are created but not scheduled until the campaign is resumed. # Campaigns steps create Source: https://docs.seleqt.ai/api-reference/public/campaigns-steps-create ## POST /api/v1/public/campaigns//steps/ Adds a new step to a campaign. Cannot add steps to active campaigns. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID ### Request Body ```json theme={null} { "step_type": "EMAIL", "message_template": "Hi {{first_name}}, I hope you're doing well!", "subject_line": "Quick question about {{company_name}}", "delay_in_hours": 24, "subject_line_b": "Alternative subject for {{first_name}}", "message_template_b": "Alternative message for {{first_name}}", "add_unsubscribe": true, "parent_step_id": 123, "child_step_id": 456 } ``` ### Flow Management Fields * `parent_step_id` (integer, optional): ID of the step that comes before this one * `parent_condition_id` (integer, optional): ID of the condition that comes before this one * `child_step_id` (integer, optional): ID of the step that comes after this one * `child_condition_id` (integer, optional): ID of the condition that comes after this one **Note:** You can only specify one parent (either `parent_step_id` OR `parent_condition_id`) and one child (either `child_step_id` OR `child_condition_id`). ### Available Step Types * `EMAIL`: Send an email * `LINKEDIN_MESSAGE`: Send a LinkedIn message * `LINKEDIN_INVITE`: Send a LinkedIn connection request * `INMAIL`: Send a LinkedIn InMail * `VISIT_LINKEDIN_PROFILE`: Visit a LinkedIn profile * `DELETE_LINKEDIN_INVITE`: Delete a LinkedIn connection request * `LIKE_LAST_LINKEDIN_POST`: Like the prospect's last LinkedIn post ### Available Variables You can use these variables in message templates and subject lines with double brackets `{{}}`: * `{{first_name}}` - Prospect's first name * `{{last_name}}` - Prospect's last name * `{{job_title}}` - Job title * `{{company_name}}` - Company name * `{{location}}` - Location ### Response ```json theme={null} { "success": true, "step": { "id": 456, "step_type": "EMAIL", "subject_line": "Quick question about {{company_name}}", "message_template": "Hi {{first_name}}, I hope you're doing well!", "subject_line_b": "Alternative subject for {{first_name}}", "message_template_b": "Alternative message for {{first_name}}", "delay_in_hours": 24, "add_unsubscribe": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, "campaign": {...} } ``` ### Example ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "step_type": "EMAIL", "message_template": "Hi {{first_name}}, I hope you are doing well!", "subject_line": "Quick question about {{company_name}}", "delay_in_hours": 24 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` ### Building a Campaign Flow Here's an example of how to build a complete campaign flow: #### 1. Create the first step (LinkedIn invite) ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "step_type": "LINKEDIN_INVITE", "message_template": "Hi {{first_name}}, I would love to connect!", "delay_in_hours": 0 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` #### 2. Create a follow-up email step ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "step_type": "EMAIL", "message_template": "Hi {{first_name}}, I hope you are doing well!", "subject_line": "Quick question about {{company_name}}", "delay_in_hours": 24, "parent_step_id": 456 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` #### 3. Create a final LinkedIn message ```bash theme={null} curl -X POST -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "step_type": "LINKEDIN_MESSAGE", "message_template": "Thanks for connecting {{first_name}}! I would love to discuss how we can help {{company_name}}.", "delay_in_hours": 48, "parent_step_id": 789 }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` This creates a flow: LinkedIn Invite → Email (24h delay) → LinkedIn Message (48h delay) # Campaigns steps delete Source: https://docs.seleqt.ai/api-reference/public/campaigns-steps-delete ## DELETE /api/v1/public/campaigns//steps// Deletes a campaign step. Cannot delete steps from active campaigns. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID * `step_id` (integer, required): Step ID ### Response ```json theme={null} { "success": true, "message": "Step deleted successfully", "campaign": { "id": 123, "name": "My Campaign", "status": "DRAFT", "timezone": "Europe/Amsterdam", "language": "en", "email_max_messages": 40, "linkedin_max_messages": 100, "linkedin_max_connections": 50, "sending_window": {}, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T11:45:00Z" } } ``` ### Example ```bash theme={null} curl -X DELETE -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/456/" ``` ### Error Responses **400 Bad Request** - Cannot delete steps from active campaigns ```json theme={null} { "success": false, "error": "Cannot delete steps from an active campaign" } ``` **404 Not Found** - Campaign or step not found ```json theme={null} { "success": false, "error": "Campaign not found" } ``` # Campaigns steps get Source: https://docs.seleqt.ai/api-reference/public/campaigns-steps-get ## GET /api/v1/public/campaigns//steps// Returns details for a specific campaign step. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID * `step_id` (integer, required): Step ID ### Response ```json theme={null} { "success": true, "step": { "id": 456, "step_type": "EMAIL", "subject_line": "Quick question about {{company_name}}", "message_template": "Hi {{first_name}}, I hope you're doing well!", "subject_line_b": "Alternative subject for {{first_name}}", "message_template_b": "Alternative message for {{first_name}}", "delay_in_hours": 24, "add_unsubscribe": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" } } ``` ### Example ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/456/" ``` # Campaigns steps list Source: https://docs.seleqt.ai/api-reference/public/campaigns-steps-list ## GET /api/v1/public/campaigns//steps/ Returns all steps and conditions for a campaign. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID ### Response ```json theme={null} { "success": true, "steps": [ { "id": 456, "step_type": "EMAIL", "subject_line": "Quick question about {{company_name}}", "message_template": "Hi {{first_name}}, I hope you're doing well!", "subject_line_b": "Alternative subject for {{first_name}}", "message_template_b": "Alternative message for {{first_name}}", "delay_in_hours": 24, "add_unsubscribe": true, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" } ], "conditions": [ { "id": 789, "condition_type": "HAS_EMAIL", "delay_in_hours": 0, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" } ] } ``` ### Example ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/" ``` # Campaigns steps update Source: https://docs.seleqt.ai/api-reference/public/campaigns-steps-update ## PATCH /api/v1/public/campaigns//steps// Updates a campaign step's properties including A/B testing variants. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID * `step_id` (integer, required): Step ID ### Request Body ```json theme={null} { "delay_in_hours": 48, "subject_line": "Updated subject line", "message_template": "Updated message template with {{first_name}} and {{company_name}}", "subject_line_b": "Alternative subject line", "message_template_b": "Alternative message template", "add_unsubscribe": false, "parent_step_id": 123, "child_step_id": 456 } ``` ### Flow Management Fields * `parent_step_id` (integer, optional): ID of the step that comes before this one * `parent_condition_id` (integer, optional): ID of the condition that comes before this one * `child_step_id` (integer, optional): ID of the step that comes after this one * `child_condition_id` (integer, optional): ID of the condition that comes after this one **Note:** You can only specify one parent (either `parent_step_id` OR `parent_condition_id`) and one child (either `child_step_id` OR `child_condition_id`). ### Available Variables You can use these variables in message templates and subject lines with double brackets `{{}}`: * `{{first_name}}` - Prospect's first name * `{{last_name}}` - Prospect's last name * `{{job_title}}` - Job title * `{{company_name}}` - Company name * `{{location}}` - Location **A/B Testing:** * `subject_line_b` - Alternative subject line for A/B testing * `message_template_b` - Alternative message template for A/B testing ### Response ```json theme={null} { "success": true, "step": { "id": 456, "step_type": "EMAIL", "subject_line": "Updated subject line", "message_template": "Updated message template with {{first_name}} and {{company_name}}", "subject_line_b": "Alternative subject line", "message_template_b": "Alternative message template", "delay_in_hours": 48, "add_unsubscribe": false, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T11:45:00Z" }, "campaign": {...} } ``` ### Example ```bash theme={null} curl -X PATCH -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "delay_in_hours": 48, "subject_line": "Updated subject line", "message_template": "Updated message template with {{first_name}} and {{company_name}}" }' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/steps/456/" ``` # Campaigns update Source: https://docs.seleqt.ai/api-reference/public/campaigns-update ## PATCH /api/v1/public/campaigns// Updates campaign settings including name, timezone, language, limits, and sending window. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Campaign ID ### Request Body ```json theme={null} { "name": "Updated Campaign Name", "timezone": "America/New_York", "language": "en", "email_max_messages": 50, "linkedin_max_messages": 120, "linkedin_max_connections": 60, "sending_window": { "monday": {"enabled": true, "start": "08:00", "end": "18:00"}, "tuesday": {"enabled": true, "start": "08:00", "end": "18:00"}, "wednesday": {"enabled": true, "start": "08:00", "end": "18:00"}, "thursday": {"enabled": true, "start": "08:00", "end": "18:00"}, "friday": {"enabled": true, "start": "08:00", "end": "18:00"}, "saturday": {"enabled": false, "start": "09:00", "end": "17:00"}, "sunday": {"enabled": false, "start": "09:00", "end": "17:00"} } } ``` ### Response ```json theme={null} { "success": true, "campaign": { "id": 123, "name": "Updated Campaign Name", "status": "DRAFT", "timezone": "America/New_York", "language": "en", "email_max_messages": 50, "linkedin_max_messages": 120, "linkedin_max_connections": 60, "sending_window": {...}, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T11:45:00Z" } } ``` ### Example ```bash theme={null} curl -X PATCH -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{"name": "Updated Campaign Name", "timezone": "America/New_York"}' \ "https://api.seleqt.ai/api/v1/public/campaigns/123/" ``` # Chats send message Source: https://docs.seleqt.ai/api-reference/public/chats-send-message ## POST /api/v1/public/chats/:prospect\_id/send-message/ Send a message in a chat. Auth: `X-API-Key` Body ```json theme={null} { "message": "Hey there from the API!" } ``` # Lead lists Source: https://docs.seleqt.ai/api-reference/public/lead-lists ## Lead Lists API The Lead Lists API allows you to manage lists of prospects or companies. You can search for leads using filters, add them to lists, retrieve them, and manage them programmatically. ### Available Endpoints * **[GET /public/lead-lists/](#get-lead-lists)** - List all lead lists * **[POST /public/lead-lists/](lead-lists-create-updated)** - Create a new lead list (people or company) * **[POST /public/prospects/search/](prospects-search)** - Search and filter prospects or companies * **[GET /public/lead-lists/:id/leads/](lead-lists-get-leads)** - Get leads from a list * **[POST /public/lead-lists/:id/add-leads/](lead-lists-add-leads)** - Add leads to a list * **[DELETE /public/lead-lists/:id/delete-leads/](lead-lists-delete-leads)** - Delete leads from a list * **[GET /public/lead-lists/:id/enrichment/count/](lead-lists-enrichment-count)** - Get enrichment cost estimate * **[POST /public/lead-lists/:id/enrichment/](lead-lists-enrichment)** - Enrich emails/phones for leads * **[POST /public/lead-lists/:id/import/](lead-lists-import)** - Import leads from various sources * **[Complete Workflow Guide](lead-lists-workflow)** - End-to-end examples ### Lead List Types Seleqt supports two types of lead lists: 1. **PEOPLE Lists**: For managing individual prospects/contacts 2. **COMPANY Lists**: For managing companies/organizations When creating a list, specify the `search_type` parameter to determine the list type. This affects which fields are available and how leads are stored. *** ## GET /api/v1/public/lead-lists/ List all lead lists accessible with your API key. * Auth: `X-API-Key` * Optional query parameter: `q` or `search` for filtering by name ### Example Request ```bash theme={null} curl -H "X-API-Key: " \ "https://api.seleqt.ai/api/v1/public/lead-lists/" ``` ### Response ```json theme={null} { "success": true, "searches": [ { "id": 123, "name": "Enterprise CEOs", "description": "", "total_prospects": 150, "status": "ACTIVE", "search_type": "PEOPLE", "created_at": "2025-10-08T11:22:33Z", "updated_at": "2025-10-08T14:30:00Z" }, { "id": 124, "name": "SaaS Companies", "description": "", "total_prospects": 75, "status": "ACTIVE", "search_type": "COMPANY", "created_at": "2025-10-08T12:00:00Z", "updated_at": "2025-10-08T15:45:00Z" } ] } ``` *** ## Quick Start ### 1. Create a Lead List See [Create Lead List](lead-lists-create-updated) for details. ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{"name": "Tech CEOs", "search_type": "PEOPLE"}' ``` ### 2. Search for Leads See [Search Prospects](prospects-search) for details. ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "search_type": "PEOPLE", "filters": { "job_title": "CEO", "location": "United States", "industry": "Technology" } }' ``` ### 3. Add Leads to List See [Add Leads](lead-lists-add-leads) for details. ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-leads/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{"prospect_ids": [12345, 12346, 12347]}' ``` ### 4. Retrieve Leads from List See [Get Leads](lead-lists-get-leads) for details. ```bash theme={null} curl "https://api.seleqt.ai/api/v1/public/lead-lists/123/leads/?page=1&page_size=50" \ -H "X-API-Key: " ``` For a complete workflow with code examples, see the [Workflow Guide](lead-lists-workflow). # Lead lists add leads Source: https://docs.seleqt.ai/api-reference/public/lead-lists-add-leads ## POST /api/v1/public/lead-lists/:id/add-leads/ Add prospects or companies to an existing lead list. The type of IDs you provide (prospect\_ids or company\_ids) should match the lead list type. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Lead list ID ### Request Body (For People Lists) ```json theme={null} { "prospect_ids": [12345, 12346, 12347] } ``` ### Request Body (For Company Lists) ```json theme={null} { "company_ids": [678, 679, 680] } ``` ### Response (People List) ```json theme={null} { "success": true, "added_count": 3, "search_type": "PEOPLE" } ``` ### Response (Company List) ```json theme={null} { "success": true, "added_count": 3, "search_type": "COMPANY" } ``` ### Error Responses #### 400 Bad Request ```json theme={null} { "error": "prospect_ids is required for people lists" } ``` ```json theme={null} { "error": "company_ids is required for company lists" } ``` #### 404 Not Found ```json theme={null} { "error": "Lead list not found" } ``` ### Workflow Example 1. First, search for prospects using the `/public/prospects/search/` endpoint 2. Extract the IDs from the search results 3. Add those IDs to your lead list using this endpoint ### Example Usage ```bash theme={null} # Add prospects to a people list curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-leads/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "prospect_ids": [12345, 12346, 12347] }' # Add companies to a company list curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/456/add-leads/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "company_ids": [678, 679, 680] }' ``` ```python theme={null} import requests # Step 1: Search for prospects search_response = requests.post( "https://api.seleqt.ai/api/v1/public/prospects/search/", headers={"X-API-Key": ""}, json={ "search_type": "PEOPLE", "filters": {"job_title": "CEO"} } ) # Step 2: Extract prospect IDs prospects = search_response.json()["prospects"] prospect_ids = [p["id"] for p in prospects] # Step 3: Add to lead list add_response = requests.post( "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-leads/", headers={"X-API-Key": ""}, json={"prospect_ids": prospect_ids} ) print(f"Added {add_response.json()['added_count']} prospects to list") ``` # Lead lists add to campaign Source: https://docs.seleqt.ai/api-reference/public/lead-lists-add-to-campaign ## POST /api/v1/public/lead-lists/:id/add-to-campaign/ Add prospects from a lead list to a campaign using their prospect IDs. This allows you to move prospects from a lead list directly into a campaign for outreach. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Lead list ID (the source lead list containing the prospects) ### Request Body ```json theme={null} { "campaign": 456, "prospect_ids": [1001, 1002, 1003, 1004, 1005], "allow_duplicates": false, "prospects_per_company": 1, "activate": true } ``` ### Request Body Parameters * `campaign` (integer, **required**): The target campaign ID to add prospects to * `prospect_ids` (array of integers, optional): Array of prospect IDs from the lead list to add to the campaign. If empty or omitted, will add prospects based on `amount` parameter. Defaults to `[]` * `amount` (integer, optional): Number of prospects to add if `prospect_ids` is empty. Defaults to `0` (which means all matching prospects) * `allow_duplicates` (boolean, optional): Whether to allow adding prospects that are already in other campaigns. Defaults to `false` * `prospects_per_company` (integer, optional): Maximum number of prospects per company to add. Useful for limiting multiple contacts from the same company. Defaults to `1` * `filters` (object, optional): Additional filters to apply when selecting prospects. Defaults to `{}` * `sort_field` (string, optional): Field to sort prospects by. Defaults to `"id"` * `sort_direction` (string, optional): Sort direction - `"asc"` or `"desc"`. Defaults to `"asc"` * `activate` (boolean, optional): If `true` and the campaign is ACTIVE, immediately schedule these prospects for outreach. Defaults to `false` **Note:** Only the `campaign` field is required. All other fields are optional and will use sensible defaults if not provided. ### Response ```json theme={null} { "success": true, "count": 5, "prospects": [ { "id": 1001, "first_name": "John", "last_name": "Doe", "job_title": "CEO", "email": "john.doe@techcorp.com", "phone_number": "+1-555-0123", "company": { "id": 501, "name": "TechCorp Inc", "website_url": "https://techcorp.com", "industry": "Technology" }, "status": "IN_REVIEW", "campaign_id": 456 } ] } ``` ### Response Fields * `success` (boolean): Whether the operation was successful * `count` (integer): Number of prospects successfully added to the campaign * `prospects` (array): Array of prospect objects that were added (includes full prospect details) * `warning` (string, optional): Warning message if activation was requested but couldn't be completed (e.g., campaign is in DRAFT status) ### Error Responses #### 400 Bad Request ```json theme={null} { "error": "Missing required fields: campaign, prospect_ids" } ``` #### 404 Not Found ```json theme={null} { "error": "Lead list not found" } ``` ```json theme={null} { "error": "Campaign not found" } ``` ### Workflow Example This endpoint is useful for the following workflow: 1. Create a lead list 2. Search for prospects and add them to the lead list 3. Optionally enrich the prospects in the lead list 4. **Use this endpoint** to move selected prospects from the lead list to a campaign 5. Campaign is ready to launch with those prospects ### Example Usage #### Minimal Request (Just Campaign ID) The simplest possible request - only `campaign` is required: ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-to-campaign/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "campaign": 456 }' ``` This will add prospects from lead list 123 to campaign 456 using all default settings. #### Add Specific Prospects by ID ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-to-campaign/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "campaign": 456, "prospect_ids": [1001, 1002, 1003, 1004, 1005], "allow_duplicates": false, "prospects_per_company": 1, "activate": true }' ``` #### Add First N Prospects from Lead List ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/add-to-campaign/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "campaign": 456, "prospect_ids": [], "amount": 10, "allow_duplicates": false, "prospects_per_company": 2 }' ``` ### Python Example ```python theme={null} import requests API_KEY = "" BASE_URL = "https://api.seleqt.ai/api/v1" # Step 1: Get prospects from your lead list lead_list_response = requests.get( f"{BASE_URL}/public/lead-lists/123/leads/", headers={"X-API-Key": API_KEY} ) prospects = lead_list_response.json()["prospects"] # Step 2: Extract prospect IDs you want to add (e.g., first 5) prospect_ids = [p["id"] for p in prospects[:5]] # Step 3: Add those prospects to a campaign response = requests.post( f"{BASE_URL}/public/lead-lists/123/add-to-campaign/", headers={"X-API-Key": API_KEY}, json={ "campaign": 456, "prospect_ids": prospect_ids, "allow_duplicates": False, "prospects_per_company": 1, "activate": True } ) result = response.json() print(f"Added {result['count']} prospects to campaign!") ``` ### JavaScript Example ```javascript theme={null} const API_KEY = ''; const BASE_URL = 'https://api.seleqt.ai/api/v1'; async function addProspectsToCampaign() { // Step 1: Get prospects from lead list const leadListResponse = await fetch( `${BASE_URL}/public/lead-lists/123/leads/`, { headers: { 'X-API-Key': API_KEY } } ); const leadList = await leadListResponse.json(); // Step 2: Extract prospect IDs const prospectIds = leadList.prospects.slice(0, 5).map(p => p.id); // Step 3: Add to campaign const response = await fetch( `${BASE_URL}/public/lead-lists/123/add-to-campaign/`, { method: 'POST', headers: { 'X-API-Key': API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ campaign: 456, prospect_ids: prospectIds, allow_duplicates: false, prospects_per_company: 1, activate: true }) } ); const result = await response.json(); console.log(`Added ${result.count} prospects to campaign!`); } addProspectsToCampaign(); ``` ### Notes * Prospects can only be in one campaign at a time. When you add a prospect to a campaign, they are moved from their current location (lead list or previous campaign) * If `allow_duplicates` is `false`, the endpoint will skip prospects that are already in other campaigns * The `prospects_per_company` parameter helps you limit the number of contacts from the same company, which is useful for avoiding over-contacting a single organization * Setting `activate: true` will immediately schedule the prospects for outreach if the campaign status is ACTIVE. If the campaign is DRAFT or PAUSED, the prospects will be added but not scheduled * If the lead list doesn't have enough prospects to fulfill the `amount` requested, all available prospects will be added # Lead lists create updated Source: https://docs.seleqt.ai/api-reference/public/lead-lists-create-updated ## POST /api/v1/public/lead-lists/ Create a new lead list with a specific name and type (people or company list). * Auth: `X-API-Key` * Method: `POST` ### Request Body ```json theme={null} { "name": "Enterprise CEOs", "search_type": "PEOPLE" } ``` ### Parameters | Parameter | Type | Required | Default | Description | | - | - | - | - | - | | `name` | string | Yes | - | Name of the lead list | | `search_type` | string | No | `PEOPLE` | Either `PEOPLE` or `COMPANY` to specify the type of lead list | ### Response ```json theme={null} { "success": true, "lead_list": { "id": 123, "name": "Enterprise CEOs", "description": "", "total_prospects": 0, "status": "DRAFT", "search_type": "PEOPLE", "created_at": "2025-10-08T11:22:33Z", "updated_at": "2025-10-08T11:22:33Z" } } ``` ### Lead List Types * **PEOPLE**: A list for individual prospects/contacts * **COMPANY**: A list for companies/organizations When you add leads to a list, make sure to use the correct IDs: * For `PEOPLE` lists, use `prospect_ids` * For `COMPANY` lists, use `company_ids` ### Error Responses #### 400 Bad Request ```json theme={null} { "error": "name is required" } ``` ```json theme={null} { "error": "search_type must be either 'PEOPLE' or 'COMPANY'" } ``` ### Example Usage ```bash theme={null} # Create a people list curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "name": "Tech CEOs", "search_type": "PEOPLE" }' # Create a company list curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "name": "SaaS Companies", "search_type": "COMPANY" }' ``` ```python theme={null} import requests # Create a people list response = requests.post( "https://api.seleqt.ai/api/v1/public/lead-lists/", headers={"X-API-Key": ""}, json={ "name": "Tech CEOs", "search_type": "PEOPLE" } ) lead_list = response.json()["lead_list"] print(f"Created lead list with ID: {lead_list['id']}") ``` # Lead lists delete leads Source: https://docs.seleqt.ai/api-reference/public/lead-lists-delete-leads ## DELETE /api/v1/public/lead-lists/:id/delete-leads/ Delete (archive) prospects or companies from a lead list. For people lists, prospects are archived (not permanently deleted). For company lists, companies are removed from the list. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Lead list ID ### Request Body (For People Lists) ```json theme={null} { "prospect_ids": [12345, 12346, 12347] } ``` ### Request Body (For Company Lists) ```json theme={null} { "company_ids": [678, 679, 680] } ``` ### Response (People List) ```json theme={null} { "success": true, "deleted_count": 3, "search_type": "PEOPLE" } ``` ### Response (Company List) ```json theme={null} { "success": true, "deleted_count": 3, "search_type": "COMPANY" } ``` ### Important Notes * **People Lists**: Prospects are archived (status changed to "ARCHIVED") rather than permanently deleted. This preserves the data and allows you to restore them later if needed. * **Company Lists**: Companies are removed from the list entirely. * Only leads that belong to the specified list can be deleted. ### Error Responses #### 400 Bad Request ```json theme={null} { "error": "prospect_ids is required for people lists" } ``` ```json theme={null} { "error": "company_ids is required for company lists" } ``` #### 404 Not Found ```json theme={null} { "error": "Lead list not found" } ``` ### Example Usage ```bash theme={null} # Delete prospects from a people list curl -X DELETE "https://api.seleqt.ai/api/v1/public/lead-lists/123/delete-leads/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "prospect_ids": [12345, 12346, 12347] }' # Delete companies from a company list curl -X DELETE "https://api.seleqt.ai/api/v1/public/lead-lists/456/delete-leads/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "company_ids": [678, 679, 680] }' ``` ```python theme={null} import requests # Delete specific prospects from a list delete_response = requests.delete( "https://api.seleqt.ai/api/v1/public/lead-lists/123/delete-leads/", headers={"X-API-Key": ""}, json={"prospect_ids": [12345, 12346, 12347]} ) result = delete_response.json() print(f"Deleted {result['deleted_count']} prospects") # Bulk delete based on filter criteria # Step 1: Get leads with filters get_response = requests.get( "https://api.seleqt.ai/api/v1/public/lead-lists/123/leads/", headers={"X-API-Key": ""}, params={"job_title": "Junior Developer"} # Filter for leads to delete ) # Step 2: Extract IDs prospects_to_delete = get_response.json()["prospects"] prospect_ids = [p["id"] for p in prospects_to_delete] # Step 3: Delete them if prospect_ids: delete_response = requests.delete( "https://api.seleqt.ai/api/v1/public/lead-lists/123/delete-leads/", headers={"X-API-Key": ""}, json={"prospect_ids": prospect_ids} ) print(f"Deleted {delete_response.json()['deleted_count']} prospects") ``` # Lead lists enrichment Source: https://docs.seleqt.ai/api-reference/public/lead-lists-enrichment ## POST /api/v1/public/lead-lists/:id/enrichment/ Enrich email addresses or phone numbers for prospects in a lead list. Credits are deducted upfront and enrichment happens asynchronously in the background. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Lead list ID ### Request Body ```json theme={null} { "enrichment_type": "FIND_EMAIL", "prospect_limit": 100, "mode": "async", "webhook_url": "https://your-domain.com/webhook", "filters": {}, "sort_field": "id", "sort_direction": "asc" } ``` ### Parameters | Parameter | Type | Required | Default | Description | | - | - | - | - | - | | `enrichment_type` | string | No | `FIND_EMAIL` | Type: `FIND_EMAIL`, `FIND_EMAIL_WATERFALL`, or `FIND_PHONE` | | `prospect_limit` | integer | No | `100` | Maximum number of prospects to enrich | | `mode` | string | No | `async` | Either `sync` (return results immediately) or `async` (background processing) | | `webhook_url` | string | No | `null` | URL to send results to when enrichment completes (async mode only) | | `filters` | object | No | `{}` | Additional filters to apply | | `sort_field` | string | No | `id` | Field to sort by | | `sort_direction` | string | No | `asc` | Sort direction (`asc` or `desc`) | ### Enrichment Types | Type | Description | Cost per Lead | When to Use | | - | - | - | - | | `FIND_EMAIL` | Basic email finding | 3 credits | Fast, cost-effective email discovery | | `FIND_EMAIL_WATERFALL` | Multi-provider email finding | 6 credits | Higher success rate, more comprehensive | | `FIND_PHONE` | Phone number finding | 30 credits | Mobile and direct phone numbers | ### Response (Async Mode) ```json theme={null} { "success": true, "mode": "async", "enrichment_type": "FIND_EMAIL", "enriched_count": 100, "credits_deducted": 300, "remaining_credits": 700, "webhook_url": "https://your-domain.com/webhook", "message": "Enrichment started in background. Results will be sent to https://your-domain.com/webhook" } ``` ### Response (Sync Mode) ```json theme={null} { "success": true, "mode": "sync", "enrichment_type": "FIND_EMAIL", "total_count": 100, "success_count": 87, "credits_deducted": 300, "remaining_credits": 700, "results": [ { "id": 12345, "first_name": "John", "last_name": "Doe", "success": true, "data": { "email": "john.doe@company.com" } }, { "id": 12346, "first_name": "Jane", "last_name": "Smith", "success": false, "data": { "email": null }, "message": "Email not found" } ] } ``` ### Response Fields | Field | Type | Description | | - | - | - | | `success` | boolean | Whether the enrichment was initiated successfully | | `mode` | string | `sync` or `async` | | `enrichment_type` | string | The enrichment type used | | `enriched_count` / `total_count` | integer | Number of prospects enriched | | `success_count` | integer | (Sync only) Number of successfully enriched prospects | | `credits_deducted` | integer | Total credits deducted | | `remaining_credits` | integer | Your remaining credit balance | | `webhook_url` | string | (Async only) Webhook URL if provided | | `results` | array | (Sync only) Enrichment results for each prospect | ### How It Works 1. **Validation**: Checks if you have enough credits 2. **Credit Deduction**: Deducts credits upfront from your account 3. **Status Update**: Sets prospects to "Loading..." status 4. **Background Processing**: Enrichment happens asynchronously 5. **Auto-Update**: Prospects are automatically updated when data is found ### Important Notes * **Asynchronous**: Enrichment happens in the background. Results appear gradually. * **Credit Deduction**: Credits are deducted immediately, even if enrichment fails for some leads * **Automatic Filtering**: Only prospects without valid emails/phones are enriched * **PEOPLE Lists Only**: This endpoint only works for people lists, not company lists * **Refunds**: If an email/phone is not found, credits may be refunded (varies by type) ### Error Responses #### 400 Bad Request - Insufficient Credits ```json theme={null} { "success": false, "error": "insufficient_credits", "message": "Not enough credits. Need 300, have 250" } ``` #### 400 Bad Request - Wrong List Type ```json theme={null} { "error": "Email/phone enrichment is only available for people lists" } ``` #### 400 Bad Request - Invalid Enrichment Type ```json theme={null} { "error": "enrichment_type must be FIND_EMAIL, FIND_EMAIL_WATERFALL, or FIND_PHONE" } ``` #### 404 Not Found ```json theme={null} { "error": "Lead list not found" } ``` ### Example Usage #### Async Mode (Default) ```bash theme={null} # Enrich emails asynchronously (background processing) curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/enrichment/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "enrichment_type": "FIND_EMAIL", "prospect_limit": 100, "mode": "async" }' # With webhook notification curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/enrichment/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "enrichment_type": "FIND_EMAIL", "prospect_limit": 100, "mode": "async", "webhook_url": "https://your-domain.com/webhook/enrichment" }' ``` #### Sync Mode (Immediate Results) ```bash theme={null} # Enrich and get results immediately curl -X POST "https://api.seleqt.ai/api/v1/public/lead-lists/123/enrichment/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "enrichment_type": "FIND_EMAIL", "prospect_limit": 50, "mode": "sync" }' ``` #### Python Example: Async Mode with Webhook ```python theme={null} import requests API_KEY = "" BASE_URL = "https://api.seleqt.ai/api/v1" LEAD_LIST_ID = 123 WEBHOOK_URL = "https://your-domain.com/webhook/enrichment" # Step 1: Check cost first count_response = requests.get( f"{BASE_URL}/public/lead-lists/{LEAD_LIST_ID}/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": "FIND_EMAIL"} ) count_data = count_response.json() print(f"Will enrich {count_data['unenriched_count']} prospects") print(f"Cost: {count_data['total_cost']} credits") if not count_data['has_enough_credits']: print("❌ Not enough credits!") exit() # Step 2: Start async enrichment with webhook enrich_response = requests.post( f"{BASE_URL}/public/lead-lists/{LEAD_LIST_ID}/enrichment/", headers={"X-API-Key": API_KEY}, json={ "enrichment_type": "FIND_EMAIL", "prospect_limit": count_data['unenriched_count'], "mode": "async", "webhook_url": WEBHOOK_URL } ) enrich_data = enrich_response.json() if enrich_data['success']: print(f"✓ Enrichment started for {enrich_data['enriched_count']} prospects") print(f"✓ Results will be sent to {WEBHOOK_URL}") print(f"Credits deducted: {enrich_data['credits_deducted']}") else: print(f"❌ Error: {enrich_data.get('message')}") # Your webhook handler will receive results when complete # See lead-lists-enrichment-webhook for webhook implementation ``` #### Python Example: Sync Mode (Immediate Results) ```python theme={null} import requests API_KEY = "" BASE_URL = "https://api.seleqt.ai/api/v1" LEAD_LIST_ID = 123 # Check cost count_response = requests.get( f"{BASE_URL}/public/lead-lists/{LEAD_LIST_ID}/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": "FIND_EMAIL"} ) count_data = count_response.json() if not count_data['has_enough_credits']: print("❌ Not enough credits!") exit() # Enrich in sync mode - returns results immediately enrich_response = requests.post( f"{BASE_URL}/public/lead-lists/{LEAD_LIST_ID}/enrichment/", headers={"X-API-Key": API_KEY}, json={ "enrichment_type": "FIND_EMAIL", "prospect_limit": min(count_data['unenriched_count'], 50), # Limit for sync "mode": "sync" } ) result = enrich_response.json() if result['success']: print(f"✓ Enriched {result['total_count']} prospects") print(f"✓ Success: {result['success_count']}/{result['total_count']}") print(f"✓ Credits used: {result['credits_deducted']}") # Process results immediately for prospect in result['results']: if prospect['success']: email = prospect['data'].get('email') print(f" ✓ {prospect['first_name']} {prospect['last_name']}: {email}") else: print(f" ✗ {prospect['first_name']} {prospect['last_name']}: {prospect.get('message')}") else: print(f"❌ Error: {result.get('message')}") ``` ### Complete Workflow Example ```python theme={null} def enrich_lead_list_emails(lead_list_id, max_prospects=100): """ Complete workflow: check cost, enrich, and verify results. """ # 1. Check how many prospects need enrichment count_response = requests.get( f"{BASE_URL}/public/lead-lists/{lead_list_id}/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": "FIND_EMAIL"} ) if not count_response.ok: print(f"Error checking count: {count_response.text}") return count_data = count_response.json() unenriched = count_data['unenriched_count'] if unenriched == 0: print("✓ All prospects already have emails!") return print(f"Found {unenriched} prospects without emails") # 2. Check if we have enough credits if not count_data['has_enough_credits']: print(f"❌ Need {count_data['total_cost']} credits, have {count_data['available_credits']}") return # 3. Limit to max_prospects if needed to_enrich = min(unenriched, max_prospects) # 4. Start enrichment enrich_response = requests.post( f"{BASE_URL}/public/lead-lists/{lead_list_id}/enrichment/", headers={"X-API-Key": API_KEY}, json={ "enrichment_type": "FIND_EMAIL", "prospect_limit": to_enrich } ) if not enrich_response.ok: print(f"Error enriching: {enrich_response.text}") return enrich_data = enrich_response.json() print(f"✓ Enriching {enrich_data['enriched_count']} prospects") print(f"✓ {enrich_data['credits_deducted']} credits deducted") print(f"✓ {enrich_data['remaining_credits']} credits remaining") # 5. Wait a bit and check results print("\nWaiting for enrichment to complete...") time.sleep(30) # Wait 30 seconds # 6. Get updated leads leads_response = requests.get( f"{BASE_URL}/public/lead-lists/{lead_list_id}/leads/", headers={"X-API-Key": API_KEY}, params={"page": 1, "page_size": to_enrich} ) leads = leads_response.json()['prospects'] enriched_count = sum(1 for lead in leads if lead.get('email') and '@' in lead['email']) print(f"\n📊 Results:") print(f" {enriched_count}/{to_enrich} prospects now have emails") print(f" Success rate: {(enriched_count/to_enrich)*100:.1f}%") # Use the function enrich_lead_list_emails(123, max_prospects=100) ``` ### Monitoring Enrichment Progress Since enrichment happens asynchronously, you can poll the lead list to check progress: ```python theme={null} def wait_for_enrichment(lead_list_id, timeout=300): """ Poll the lead list until enrichment is complete or timeout. """ start_time = time.time() while time.time() - start_time < timeout: response = requests.get( f"{BASE_URL}/public/lead-lists/{lead_list_id}/leads/", headers={"X-API-Key": API_KEY}, params={"page": 1, "page_size": 100} ) prospects = response.json()['prospects'] loading_count = sum(1 for p in prospects if p.get('email') == 'Loading...') if loading_count == 0: print("✓ Enrichment complete!") return True print(f"Still processing... ({loading_count} prospects remaining)") time.sleep(10) print("⚠ Timeout reached") return False ``` ### Best Practices 1. **Check Cost First**: Always use the count endpoint before enriching 2. **Start Small**: Test with a small batch before enriching thousands 3. **Monitor Credits**: Keep track of your credit balance 4. **Batch Processing**: Enrich in batches rather than all at once 5. **Waterfall for Higher Success**: Use `FIND_EMAIL_WATERFALL` for better results (costs more) 6. **Phone Last**: Phone enrichment is expensive (30 credits) - use sparingly 7. **Check Results**: Poll the lead list to verify enrichment completed successfully # Lead lists enrichment count Source: https://docs.seleqt.ai/api-reference/public/lead-lists-enrichment-count ## GET /api/v1/public/lead-lists/:id/enrichment/count/ Get the count of prospects that need email or phone enrichment, along with cost estimates and available credits. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Lead list ID ### Query Parameters | Parameter | Type | Required | Default | Description | | - | - | - | - | - | | `enrichment_type` | string | No | `FIND_EMAIL` | Type of enrichment: `FIND_EMAIL`, `FIND_EMAIL_WATERFALL`, or `FIND_PHONE` | | `sort_field` | string | No | `id` | Field to sort by | | `sort_direction` | string | No | `asc` | Sort direction (`asc` or `desc`) | You can also add filter parameters as query strings. ### Enrichment Types and Costs | Type | Description | Cost per Lead | | - | - | - | | `FIND_EMAIL` | Basic email finding | 3 credits | | `FIND_EMAIL_WATERFALL` | Advanced email finding with multiple providers | 6 credits | | `FIND_PHONE` | Phone number finding | 30 credits | ### Response ```json theme={null} { "success": true, "enrichment_type": "FIND_EMAIL", "unenriched_count": 150, "cost_per_lead": 3, "total_cost": 450, "available_credits": 1000, "has_enough_credits": true } ``` ### Response Fields | Field | Type | Description | | - | - | - | | `success` | boolean | Whether the request was successful | | `enrichment_type` | string | The enrichment type requested | | `unenriched_count` | integer | Number of prospects that need enrichment | | `cost_per_lead` | integer | Credits cost per prospect | | `total_cost` | integer | Total credits needed to enrich all prospects | | `available_credits` | integer | Your current credit balance | | `has_enough_credits` | boolean | Whether you have enough credits for all prospects | ### Notes * **PEOPLE Lists Only**: Email/phone enrichment is only available for people lists (not company lists) * **Automatic Filtering**: The endpoint automatically excludes prospects that already have valid emails/phones * **Credit Check**: Use this endpoint before enriching to ensure you have enough credits ### Error Responses #### 400 Bad Request ```json theme={null} { "error": "Email/phone enrichment is only available for people lists" } ``` ```json theme={null} { "error": "enrichment_type must be FIND_EMAIL, FIND_EMAIL_WATERFALL, or FIND_PHONE" } ``` #### 404 Not Found ```json theme={null} { "error": "Lead list not found" } ``` ### Example Usage ```bash theme={null} # Check how many prospects need email enrichment curl -X GET "https://api.seleqt.ai/api/v1/public/lead-lists/123/enrichment/count/?enrichment_type=FIND_EMAIL" \ -H "X-API-Key: " # Check phone enrichment cost curl -X GET "https://api.seleqt.ai/api/v1/public/lead-lists/123/enrichment/count/?enrichment_type=FIND_PHONE" \ -H "X-API-Key: " ``` ```python theme={null} import requests API_KEY = "" BASE_URL = "https://api.seleqt.ai/api/v1" # Check email enrichment count and cost response = requests.get( f"{BASE_URL}/public/lead-lists/123/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": "FIND_EMAIL"} ) data = response.json() print(f"Prospects needing enrichment: {data['unenriched_count']}") print(f"Total cost: {data['total_cost']} credits") print(f"Available credits: {data['available_credits']}") if data['has_enough_credits']: print("✓ You have enough credits to proceed") else: print("✗ Insufficient credits") # Check phone enrichment cost phone_response = requests.get( f"{BASE_URL}/public/lead-lists/123/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": "FIND_PHONE"} ) phone_data = phone_response.json() print(f"Phone enrichment would cost: {phone_data['total_cost']} credits") ``` ### Workflow Example ```python theme={null} # Step 1: Check cost before enriching count_response = requests.get( f"{BASE_URL}/public/lead-lists/123/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": "FIND_EMAIL"} ) count_data = count_response.json() # Step 2: Decide whether to proceed based on cost and available credits if count_data['has_enough_credits']: # Step 3: Proceed with enrichment enrich_response = requests.post( f"{BASE_URL}/public/lead-lists/123/enrichment/", headers={"X-API-Key": API_KEY}, json={ "enrichment_type": "FIND_EMAIL", "prospect_limit": count_data['unenriched_count'] } ) if enrich_response.json()['success']: print(f"Enriching {count_data['unenriched_count']} prospects...") else: print(f"Need {count_data['total_cost']} credits, but only have {count_data['available_credits']}") print("Please purchase more credits to continue") ``` # Lead lists get leads Source: https://docs.seleqt.ai/api-reference/public/lead-lists-get-leads ## GET /api/v1/public/lead-lists/:id/leads/ Retrieve leads from a specific lead list with optional filtering, sorting, and pagination. Returns prospects for PEOPLE lists or companies for COMPANY lists. Auth: `X-API-Key` ### Path Parameters * `id` (integer, required): Lead list ID ### Query Parameters | Parameter | Type | Required | Default | Description | | - | - | - | - | - | | `page` | integer | No | `1` | Page number for pagination | | `page_size` | integer | No | `25` | Number of results per page | | `sort_field` | string | No | `id` | Field to sort by | | `sort_direction` | string | No | `asc` | Sort direction (`asc` or `desc`) | You can also add any filter parameters as query strings (e.g., `?job_title=CEO&location=US`). ### Response (People List) ```json theme={null} { "success": true, "search_type": "PEOPLE", "total_count": 150, "page": 1, "page_size": 25, "prospects": [ { "id": 12345, "first_name": "John", "last_name": "Doe", "email": "john.doe@company.com", "phone_number": "+1234567890", "linkedin_profile_url": "https://linkedin.com/in/johndoe", "job_title": "CEO", "location": "San Francisco, CA", "headline": "CEO at Tech Company", "company": { "id": 678, "name": "Tech Company", "website_url": "https://techcompany.com", "linkedin_url": "https://linkedin.com/company/techcompany", "industry": "Technology", "location": "San Francisco, CA", "amount_of_employees": "51-200" } } ] } ``` ### Response (Company List) ```json theme={null} { "success": true, "search_type": "COMPANY", "total_count": 75, "page": 1, "page_size": 25, "companies": [ { "id": 678, "name": "Tech Company", "website_url": "https://techcompany.com", "linkedin_url": "https://linkedin.com/company/techcompany", "logo_url": "https://logo.clearbit.com/techcompany.com", "industry": "Technology", "location": "San Francisco, CA", "amount_of_employees": "51-200", "revenue": "$10M-$50M" } ] } ``` ### Sortable Fields #### For People Lists * `id` - Prospect ID * `first_name` - First name * `last_name` - Last name * `job_title` - Job title * `location` - Location * `created_at` - Date added to list #### For Company Lists * `id` - Company ID * `name` - Company name * `industry` - Industry * `location` - Location * `amount_of_employees` - Company size * `revenue` - Revenue ### Error Responses #### 404 Not Found ```json theme={null} { "error": "Lead list not found" } ``` ### Example Usage ```bash theme={null} # Get all prospects from a lead list curl -X GET "https://api.seleqt.ai/api/v1/public/lead-lists/123/leads/?page=1&page_size=25" \ -H "X-API-Key: " # Get prospects with filters and sorting curl -X GET "https://api.seleqt.ai/api/v1/public/lead-lists/123/leads/?job_title=CEO&sort_field=last_name&sort_direction=asc" \ -H "X-API-Key: " # Get companies from a company list curl -X GET "https://api.seleqt.ai/api/v1/public/lead-lists/456/leads/?page=1" \ -H "X-API-Key: " ``` ```python theme={null} import requests # Get all leads from a lead list with pagination response = requests.get( "https://api.seleqt.ai/api/v1/public/lead-lists/123/leads/", headers={"X-API-Key": ""}, params={ "page": 1, "page_size": 50, "sort_field": "last_name", "sort_direction": "asc" } ) data = response.json() print(f"Total leads: {data['total_count']}") print(f"Retrieved {len(data['prospects'])} leads on page {data['page']}") # Iterate through all pages all_prospects = [] page = 1 while True: response = requests.get( f"https://api.seleqt.ai/api/v1/public/lead-lists/123/leads/", headers={"X-API-Key": ""}, params={"page": page, "page_size": 100} ) data = response.json() all_prospects.extend(data["prospects"]) if len(data["prospects"]) < 100: break page += 1 print(f"Retrieved all {len(all_prospects)} prospects") ``` # Lead lists import Source: https://docs.seleqt.ai/api-reference/public/lead-lists-import ## POST /api/v1/public/lead-lists/:list\_id/import/ Import leads into a lead list. Auth: `X-API-Key` Body ```json theme={null} { "leads": [ { "first_name": "Alex", "last_name": "Doe", "linkedin_profile_url": "https://www.linkedin.com/in/alex-doe/", "profile_picture_url": "https://example.com/alex.jpg", "job_title": "Head of Sales", "industry": "SaaS", "email": "alex@example.com", "phone_number": "+1 555 0100", "location": "Amsterdam, NL", "custom_fields": { "plan": "pro" }, "company_name": "Acme Inc", "company_industry": "Software", "company_linkedin_url": "https://www.linkedin.com/company/acme/", "company_website_url": "https://acme.com", "company_location": "Amsterdam, NL" } ] } ``` Fields * Array name: `leads` * **first\_name** (required) * **last\_name** (required) * **linkedin\_profile\_url** (required) * **profile\_picture\_url** (optional) * **job\_title** (optional) * **industry** (optional) * **email** (optional) * **phone\_number** (optional) * **location** (optional) * **custom\_fields** (optional JSON object) * **company\_name** (optional) * **company\_industry** (optional) * **company\_linkedin\_url** (optional) * **company\_website\_url** (optional) * **company\_location** (optional) Notes * You can also send a nested `company` object with keys `name`, `website_url`, `linkedin_url`, `industry`, `location` instead of the flattened `company_*` fields. The API accepts either format. # Lead lists workflow Source: https://docs.seleqt.ai/api-reference/public/lead-lists-workflow ## Lead Lists Workflow Guide This guide demonstrates how to use the Lead Lists API endpoints together to build a complete workflow for managing leads. ### Overview The Lead Lists API provides a complete set of endpoints for: 1. **Searching** for prospects or companies using filters 2. **Creating** lead lists (people or company lists) 3. **Adding** found leads to your lists 4. **Retrieving** leads from your lists 5. **Deleting** leads from your lists 6. **Importing** leads into campaigns ### Complete Workflow Example #### Step 1: Create a Lead List First, create a new lead list. Choose the type based on whether you want to manage people or companies. ```python theme={null} import requests API_KEY = "" BASE_URL = "https://api.seleqt.ai/api/v1" # Create a people list response = requests.post( f"{BASE_URL}/public/lead-lists/", headers={"X-API-Key": API_KEY}, json={ "name": "Tech CEOs for Q4 Campaign", "search_type": "PEOPLE" } ) lead_list = response.json()["lead_list"] lead_list_id = lead_list["id"] print(f"Created lead list: {lead_list['name']} (ID: {lead_list_id})") ``` #### Step 2: Search for Prospects Search for prospects using various filters. The search respects your organization's search limits. ```python theme={null} # Search for prospects with specific criteria search_response = requests.post( f"{BASE_URL}/public/prospects/search/", headers={"X-API-Key": API_KEY}, json={ "search_type": "PEOPLE", "page": 1, "page_size": 100, "filters": { "job_title": "CEO", "location": "United States", "industry": "Technology", "company_size": "51-200" } } ) search_data = search_response.json() print(f"Found {search_data['total_count']} prospects") prospects = search_data["prospects"] ``` #### Step 3: Add Prospects to Your List Extract the prospect IDs from search results and add them to your lead list. ```python theme={null} # Get prospect IDs prospect_ids = [p["id"] for p in prospects[:50]] # Add first 50 # Add to lead list add_response = requests.post( f"{BASE_URL}/public/lead-lists/{lead_list_id}/add-leads/", headers={"X-API-Key": API_KEY}, json={"prospect_ids": prospect_ids} ) print(f"Added {add_response.json()['added_count']} prospects to list") ``` #### Step 4: Review and Filter Your List Retrieve leads from your list with additional filtering or sorting. ```python theme={null} # Get all leads from the list list_response = requests.get( f"{BASE_URL}/public/lead-lists/{lead_list_id}/leads/", headers={"X-API-Key": API_KEY}, params={ "page": 1, "page_size": 100, "sort_field": "last_name", "sort_direction": "asc" } ) list_data = list_response.json() print(f"List contains {list_data['total_count']} total prospects") ``` #### Step 5: Clean Up Your List (Optional) Remove prospects that don't meet your criteria. ```python theme={null} # Find prospects to remove (e.g., based on some criteria) prospects_to_remove = [p["id"] for p in list_data["prospects"] if some_condition(p)] if prospects_to_remove: delete_response = requests.delete( f"{BASE_URL}/public/lead-lists/{lead_list_id}/delete-leads/", headers={"X-API-Key": API_KEY}, json={"prospect_ids": prospects_to_remove} ) print(f"Removed {delete_response.json()['deleted_count']} prospects") ``` #### Step 6: Enrich Email/Phone (Optional) Before importing to campaigns, you may want to enrich missing contact information. ```python theme={null} # Check how many prospects need email enrichment enrich_count_response = requests.get( f"{BASE_URL}/public/lead-lists/{lead_list_id}/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": "FIND_EMAIL"} ) enrich_count = enrich_count_response.json() print(f"Prospects without emails: {enrich_count['unenriched_count']}") print(f"Cost to enrich: {enrich_count['total_cost']} credits") # Enrich emails if you have enough credits if enrich_count['has_enough_credits'] and enrich_count['unenriched_count'] > 0: enrich_response = requests.post( f"{BASE_URL}/public/lead-lists/{lead_list_id}/enrichment/", headers={"X-API-Key": API_KEY}, json={ "enrichment_type": "FIND_EMAIL", "prospect_limit": enrich_count['unenriched_count'] } ) if enrich_response.json()['success']: print(f"Enriching emails for {enrich_count['unenriched_count']} prospects...") # Enrichment happens in background time.sleep(30) # Wait for some results ``` #### Step 7: Import to Campaign Once your list is ready, import it into a campaign for outreach. ```python theme={null} # Get or create a campaign campaign_response = requests.post( f"{BASE_URL}/public/campaigns/", headers={"X-API-Key": API_KEY}, json={ "name": "Q4 Tech CEO Outreach", "status": "DRAFT" } ) campaign_id = campaign_response.json()["campaign"]["id"] # Import leads from list to campaign import_response = requests.post( f"{BASE_URL}/public/campaigns/{campaign_id}/import/", headers={"X-API-Key": API_KEY}, json={ "source": "lead_list", "lead_list_id": lead_list_id, "amount": 100 # Number of leads to import } ) print(f"Imported leads into campaign") ``` ### Working with Company Lists The workflow for company lists is similar, but uses `company_ids` instead of `prospect_ids`. ```python theme={null} # Create a company list company_list_response = requests.post( f"{BASE_URL}/public/lead-lists/", headers={"X-API-Key": API_KEY}, json={ "name": "SaaS Companies to Target", "search_type": "COMPANY" } ) company_list_id = company_list_response.json()["lead_list"]["id"] # Search for companies company_search_response = requests.post( f"{BASE_URL}/public/prospects/search/", headers={"X-API-Key": API_KEY}, json={ "search_type": "COMPANY", "filters": { "industry": "Software", "company_size": "11-50", "location": "United States" } } ) companies = company_search_response.json()["companies"] company_ids = [c["id"] for c in companies] # Add companies to list requests.post( f"{BASE_URL}/public/lead-lists/{company_list_id}/add-leads/", headers={"X-API-Key": API_KEY}, json={"company_ids": company_ids} ) ``` ### Advanced: Batch Processing For large-scale operations, use pagination to process all results. ```python theme={null} def search_all_prospects(filters, search_type="PEOPLE"): """Search all prospects matching filters across all pages.""" all_prospects = [] page = 1 while True: response = requests.post( f"{BASE_URL}/public/prospects/search/", headers={"X-API-Key": API_KEY}, json={ "search_type": search_type, "page": page, "page_size": 100, "filters": filters } ) data = response.json() prospects = data["prospects"] all_prospects.extend(prospects) # Check if we've reached the last page if len(prospects) < 100: break page += 1 return all_prospects # Use the function all_ceos = search_all_prospects({ "job_title": "CEO", "industry": "Technology" }) print(f"Found {len(all_ceos)} total CEOs") ``` ### Error Handling Always implement proper error handling in production code. ```python theme={null} def safe_api_call(method, url, **kwargs): """Make API call with error handling.""" try: response = method(url, **kwargs) response.raise_for_status() return response.json() except requests.exceptions.HTTPError as e: print(f"HTTP Error: {e}") print(f"Response: {e.response.text}") return None except Exception as e: print(f"Error: {e}") return None # Use safe API calls data = safe_api_call( requests.post, f"{BASE_URL}/public/prospects/search/", headers={"X-API-Key": API_KEY}, json={"search_type": "PEOPLE", "filters": {"job_title": "CEO"}} ) if data and data.get("success"): prospects = data["prospects"] # Process prospects ``` ### Enrichment Workflow Email and phone enrichment is a powerful feature for lead lists: ```python theme={null} def enrich_lead_list(lead_list_id, enrichment_type="FIND_EMAIL"): """ Complete enrichment workflow with error handling. """ # Step 1: Check cost count_response = requests.get( f"{BASE_URL}/public/lead-lists/{lead_list_id}/enrichment/count/", headers={"X-API-Key": API_KEY}, params={"enrichment_type": enrichment_type} ) if not count_response.ok: print(f"Error: {count_response.text}") return False count_data = count_response.json() # Step 2: Validate we have enough credits if not count_data['has_enough_credits']: print(f"Insufficient credits: need {count_data['total_cost']}, have {count_data['available_credits']}") return False if count_data['unenriched_count'] == 0: print("No prospects need enrichment") return True # Step 3: Confirm with user (in production, you might skip this) print(f"Will enrich {count_data['unenriched_count']} prospects") print(f"Cost: {count_data['total_cost']} credits") # Step 4: Start enrichment enrich_response = requests.post( f"{BASE_URL}/public/lead-lists/{lead_list_id}/enrichment/", headers={"X-API-Key": API_KEY}, json={ "enrichment_type": enrichment_type, "prospect_limit": count_data['unenriched_count'] } ) if enrich_response.ok: result = enrich_response.json() print(f"✓ Enrichment started: {result['enriched_count']} prospects") print(f"✓ Credits deducted: {result['credits_deducted']}") return True else: print(f"Error: {enrich_response.text}") return False # Use it enrich_lead_list(123, "FIND_EMAIL") ``` ### Best Practices 1. **Pagination**: Always use pagination when dealing with large result sets 2. **Error Handling**: Implement retry logic for transient errors 3. **Rate Limiting**: Be mindful of API rate limits 4. **Search Limits**: Monitor your organization's monthly search limit 5. **Data Validation**: Validate prospect/company IDs before adding to lists 6. **List Organization**: Use descriptive names for your lead lists 7. **Regular Cleanup**: Remove outdated or invalid leads periodically 8. **Check Enrichment Costs**: Always check costs before enriching 9. **Enrich Strategically**: Email enrichment is cheaper than phone (3 vs 30 credits) 10. **Monitor Credits**: Keep track of your credit balance to avoid interruptions ### API Endpoints Summary | Endpoint | Method | Purpose | | - | - | - | | `/public/lead-lists/` | POST | Create a lead list | | `/public/lead-lists/` | GET | List all lead lists | | `/public/prospects/search/` | POST | Search for prospects/companies | | `/public/lead-lists/:id/add-leads/` | POST | Add leads to a list | | `/public/lead-lists/:id/leads/` | GET | Get leads from a list | | `/public/lead-lists/:id/delete-leads/` | DELETE | Delete leads from a list | | `/public/lead-lists/:id/enrichment/count/` | GET | Get enrichment cost estimate | | `/public/lead-lists/:id/enrichment/` | POST | Enrich emails/phones | | `/public/lead-lists/:id/import/` | POST | Import leads to a list | | `/public/campaigns/{id}/import/` | POST | Import leads to a campaign | # Prospects connection status Source: https://docs.seleqt.ai/api-reference/public/prospects-connection-status ## GET /api/v1/public/prospects//connection-status/ Checks whether a LinkedIn account connected to the workspace is already connected (1st-degree relationship) with the given prospect on LinkedIn. This endpoint queries the underlying LinkedIn provider (Unipile) in real time using the prospect's LinkedIn profile URL and one of the workspace's connected LinkedIn accounts. It is intended to be used before sending a connection invitation, so a campaign can decide to skip the invite step when the user is already connected. The same endpoint is also exposed under the JWT-protected path `GET /api/v1/prospects/{prospect_id}/connection-status/` for use from the in-app client. * Auth: `X-API-Key` * Method: `GET` ### Path Parameters * `prospect_id` (integer, required): ID of the prospect to check. ### Query Parameters * `account_id` (integer, optional): ID of a specific LinkedIn `ConnectedAccount` to use for the check. If omitted, the first active LinkedIn account in the current workspace is used. ### Response ```json theme={null} { "success": true, "is_connected": true, "connection_level": 1, "network_distance": "FIRST_DEGREE", "checked_with_account_id": 42 } ``` | Field | Type | Description | | - | - | - | | `success` | boolean | Always `true` on a successful response. | | `is_connected` | boolean | `true` when the prospect is a 1st-degree LinkedIn connection of the chosen account. | | `connection_level` | integer \| null | Numeric LinkedIn connection degree. `1` = 1st-degree (direct connection), `2` = 2nd-degree, `3` = 3rd-degree. `null` when the relationship is unknown or out of network. | | `network_distance` | string \| null | Raw network distance reported by the provider. Typically one of `FIRST_DEGREE`, `SECOND_DEGREE`, `THIRD_DEGREE`, `OUT_OF_NETWORK`, or `null` if unknown. | | `checked_with_account_id` | integer | The id of the `ConnectedAccount` actually used to perform the check. | ### Error Responses | Status | `error` | When | | - | - | - | | `400` | `Prospect has no LinkedIn profile URL to check against` | The prospect has no `linkedin_profile_url` set. | | `400` | `No active LinkedIn account is connected to this workspace` | No LinkedIn `ConnectedAccount` with status `OK / SYNC_SUCCESS / CREATION_SUCCESS / RECONNECTED` exists for the workspace. | | `400` | `Requested LinkedIn account not found or not active in this workspace` | An `account_id` was supplied but it does not match an active LinkedIn account in the workspace. | | `403` | `Access denied` | The prospect belongs to another workspace. | | `404` | `Prospect not found` | No prospect exists with the given id. | | `502` | `Failed to fetch prospect profile from LinkedIn provider` | Unipile call failed or returned a non-2xx response. | ### Examples ```bash theme={null} # Default: pick any active LinkedIn account in the workspace curl -H "X-API-Key: " \ "https://api.staging.seleqt.ai/api/v1/public/prospects/12345/connection-status/" ``` ```bash theme={null} # Force the check to use a specific connected LinkedIn account curl -H "X-API-Key: " \ "https://api.staging.seleqt.ai/api/v1/public/prospects/12345/connection-status/?account_id=42" ``` ### Notes * The endpoint performs a live call to the LinkedIn provider on every request and is therefore subject to provider rate limits. It is intended for on-demand checks (for example, immediately before launching a campaign or scheduling an invite), not for bulk polling. * "Connected" is defined strictly as a 1st-degree LinkedIn relationship. A pending invitation does not count as connected. * The chosen LinkedIn account is the perspective from which the check is made. If a workspace has multiple LinkedIn accounts and the prospect is connected to only one of them, you may get different answers depending on which account is used — pass `account_id` explicitly when this matters. # Prospects search Source: https://docs.seleqt.ai/api-reference/public/prospects-search ## POST /api/v1/public/prospects/search/ Search and filter prospects or companies using flexible filters. This endpoint allows you to find leads based on various criteria before adding them to a lead list. * Auth: `X-API-Key` * Method: `POST` ### Request Body ```json theme={null} { "search_type": "PEOPLE", "page": 1, "page_size": 25, "filters": { "job_title": "VP", "industry": "Technology", "company_size": "51-200", "prospect_location": "United States" } } ``` **Note:** Filter values can be strings, arrays, or objects with include/exclude logic. See Filter Options below for details. ### Parameters | Parameter | Type | Required | Default | Description | | - | - | - | - | - | | `search_type` | string | No | `PEOPLE` | Either `PEOPLE` or `COMPANY` to specify what type of leads to search for | | `page` | integer | No | `1` | Page number for pagination | | `page_size` | integer | No | `25` | Number of results per page (max 100) | | `filters` | object | No | `{}` | Filter criteria (see below) | ### Filter Options Filters can be passed as: * **Strings**: `"VP"` - Will search for this single value * **Arrays**: `["VP", "Director"]` - Will search for any of these values * **Objects**: `{"must": ["VP"], "doesnt": ["Intern"]}` - For include/exclude logic #### For People Search (`search_type: "PEOPLE"`) | Filter | Type | Description | Example Values | | - | - | - | - | | `job_title` | string/array | Job title(s) to search for | `"VP"`, `["CEO", "Founder"]` | | `seniority` | string/array | Seniority/management level | `"VP"`, `["Director", "C-Level", "VP"]` | | `department` | string/array | Department/function | `"Sales"`, `["Sales", "Marketing"]` | | `company_name` | string/array/object | Company name(s) | `"Microsoft"`, `["Google", "Apple"]`, `{"must": ["Tech"], "doesnt": ["Corp"]}` | | `company_size` | string/array | Company size range | `"51-200"`, `["51-200", "201-500"]` | | `industry` | string/array | Industry sector | `"Technology"`, `["Technology", "Software"]` | | `prospect_location` | string/array | Geographic location | `"San Francisco, CA, United States"`, `["New York", "Los Angeles"]` | | `location_radius` | integer | Radius for location search (in km or mi) | `25`, `50` | | `location_radius_unit` | string | Unit for radius (`"km"` or `"mi"`) | `"km"`, `"mi"` | | `years_experience` | string/object | Years of experience range | `"5-10"`, `{"min": 5, "max": 10}` | | `job_change_range_days` | integer | Recently changed jobs (within X days) | `90`, `180` | | `keywords` | string/array/object | Keywords in profile | `"SaaS"`, `["AI", "Machine Learning"]` | | `company_domains` | string/array | Company website domain(s) | `"microsoft.com"`, `["google.com", "apple.com"]` | | `company_industry_keywords` | string/array | Keywords in company description | `"AI"`, `["SaaS", "Cloud"]` | #### Common Company Size Values * `"1-10"` - 1-10 employees * `"11-50"` - 11-50 employees * `"51-200"` - 51-200 employees * `"201-500"` - 201-500 employees * `"501-1000"` - 501-1000 employees * `"1001-5000"` - 1001-5000 employees * `"5001-10000"` - 5001-10000 employees * `"10000+"` - 10000+ employees #### Common Seniority Levels * `"Entry"` * `"Senior"` * `"Manager"` * `"Director"` * `"VP"` * `"C-Level"` * `"Owner"` #### For Company Search (`search_type: "COMPANY"`) | Filter | Type | Description | Example Values | | - | - | - | - | | `company_name` | string/array | Company name | `"Microsoft"`, `["Google", "Apple"]` | | `location` | string/array | Geographic location | `"San Francisco, CA"`, `["New York", "Boston"]` | | `industry` | string/array | Industry sector | `"Technology"`, `["Software", "SaaS"]` | | `company_size` | string/array | Number of employees | `"51-200"`, `["51-200", "201-500"]` | | `revenue` | string/array | Annual revenue range | `"$10M-$50M"`, `["$10M-$50M", "$50M-$100M"]` | | `company_industry_keywords` | string/array | Keywords in company description | `"AI"`, `["SaaS", "Cloud"]` | ### Response (People) ```json theme={null} { "success": true, "search_type": "PEOPLE", "total_count": 1247, "page": 1, "page_size": 25, "prospects": [ { "id": 12345, "first_name": "John", "last_name": "Doe", "email": "john.doe@company.com", "phone_number": "+1234567890", "linkedin_profile_url": "https://linkedin.com/in/johndoe", "job_title": "CEO", "location": "San Francisco, CA", "headline": "CEO at Tech Company", "company": { "id": 678, "name": "Tech Company", "website_url": "https://techcompany.com", "linkedin_url": "https://linkedin.com/company/techcompany", "industry": "Technology", "location": "San Francisco, CA", "amount_of_employees": "51-200" } } ] } ``` ### Response (Companies) ```json theme={null} { "success": true, "search_type": "COMPANY", "total_count": 543, "page": 1, "page_size": 25, "companies": [ { "id": 678, "name": "Tech Company", "website_url": "https://techcompany.com", "linkedin_url": "https://linkedin.com/company/techcompany", "logo_url": "https://logo.clearbit.com/techcompany.com", "industry": "Technology", "location": "San Francisco, CA", "amount_of_employees": "51-200", "revenue": "$10M-$50M" } ] } ``` ### Error Responses #### 400 Bad Request ```json theme={null} { "error": "search_type must be either 'PEOPLE' or 'COMPANY'" } ``` #### 403 Forbidden ```json theme={null} { "success": false, "error": "search_limit", "message": "You have reached the maximum number of searches per month" } ``` ### Example Usage #### Example 1: Simple String Filters ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "search_type": "PEOPLE", "page": 1, "page_size": 25, "filters": { "job_title": "VP", "industry": "Technology", "company_size": "51-200" } }' ``` #### Example 2: Array Filters (Multiple Options) ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "search_type": "PEOPLE", "filters": { "job_title": ["CEO", "Founder", "Co-Founder"], "seniority": ["C-Level", "VP"], "department": ["Sales", "Marketing"], "prospect_location": ["San Francisco, CA, United States", "New York, NY, United States"], "company_size": ["51-200", "201-500"] } }' ``` #### Example 3: Include/Exclude Logic ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "search_type": "PEOPLE", "filters": { "job_title": { "must": ["VP", "Director"], "doesnt": ["Intern", "Associate"] }, "keywords": { "must": ["SaaS", "B2B"], "doesnt": ["Retail"] } } }' ``` #### Example 4: Location with Radius ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "search_type": "PEOPLE", "filters": { "prospect_location": "San Francisco, CA, United States", "location_radius": 50, "location_radius_unit": "km" } }' ``` #### Example 5: Python SDK ```python theme={null} import requests # Simple search response = requests.post( "https://api.seleqt.ai/api/v1/public/prospects/search/", headers={"X-API-Key": ""}, json={ "search_type": "PEOPLE", "page": 1, "page_size": 50, "filters": { "job_title": "VP", "industry": "Technology", "company_size": "51-200" } } ) data = response.json() if data["success"]: prospects = data["prospects"] print(f"Found {data['total_count']} total prospects") for prospect in prospects: print(f"{prospect['first_name']} {prospect['last_name']} - {prospect['job_title']}") # Advanced search with multiple filters response = requests.post( "https://api.seleqt.ai/api/v1/public/prospects/search/", headers={"X-API-Key": ""}, json={ "search_type": "PEOPLE", "filters": { "job_title": ["CEO", "Founder"], "seniority": ["C-Level"], "department": ["Sales", "Marketing"], "years_experience": {"min": 10, "max": 20}, "prospect_location": ["United States"], "company_size": ["51-200", "201-500"] } } ) ``` #### Example 6: Company Search ```bash theme={null} curl -X POST "https://api.seleqt.ai/api/v1/public/prospects/search/" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{ "search_type": "COMPANY", "filters": { "industry": "Technology", "company_size": "51-200", "location": "United States" } }' ``` # Webhook configure Source: https://docs.seleqt.ai/api-reference/public/webhook-configure ## PUT /api/v1/user/webhook/ Configures the webhook URL for receiving incoming messages from your campaigns. Auth: `X-API-Key` ### Request Body ```json theme={null} { "webhook_url": "https://your-app.com/seleqt-webhook" } ``` To disable webhooks, send: ```json theme={null} { "webhook_url": null } ``` ### Response ```json theme={null} { "success": true, "message": "Webhook URL updated successfully" } ``` ### Example ```bash theme={null} curl -X PUT -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d '{"webhook_url": "https://your-app.com/seleqt-webhook"}' \ "https://api.seleqt.ai/api/v1/user/webhook/" ``` ### Webhook Payload When a new message is received, Seleqt will POST to your webhook URL: ```json theme={null} { "event": "incoming_message", "message": { "id": 123, "message_id": "abc123", "message": "Hello there", "sent_by_lead": true, "sent_at": "2025-06-09T11:22:33Z", "created_at": "2025-06-09T11:22:33Z", "updated_at": "2025-06-09T11:22:33Z", "campaign": { "id": 456, "name": "Outbound - SaaS founders", "status": "ACTIVE" }, "lead": { "id": 789, "first_name": "Alex", "last_name": "Doe", "profile_picture_url": "https://example.com/alex.jpg", "linkedin_profile_url": "https://www.linkedin.com/in/alex-doe/", "linkedin_public_id": "alex-doe", "job_title": "Head of Sales", "industry": "SaaS", "headline": "Helping teams close more deals", "email": "alex@example.com", "phone_number": "+1 555 0100", "location": "Amsterdam, NL", "status": "IN_REVIEW", "company": { "id": 321, "name": "Acme Inc", "linkedin_url": "https://www.linkedin.com/company/acme/", "logo_url": "https://example.com/logo.png", "website_url": "https://acme.com", "location": "Amsterdam, NL", "industry": "Software", "revenue": "$10M-$50M", "amount_of_employees": "51-200" }, "custom_fields": { "plan": "pro" } } } } ``` ### Security Notes * Consider hosting your endpoint behind a firewall that allows only Seleqt IPs * Implement idempotency by checking `message.message_id` on your side * No signature header is currently included in webhook payloads ### Example Handler (Node.js/Express) ```javascript theme={null} app.post("/seleqt-webhook", async (req, res) => { const { event, message } = req.body || {}; if (event !== "incoming_message") { return res.status(200).send("ignored"); } // Process the incoming message console.log(`New message from ${message.lead.first_name} ${message.lead.last_name}: ${message.message}`); // TODO: Add your business logic here res.status(200).send({ ok: true }); }); ``` # Authentication Source: https://docs.seleqt.ai/getting-started/authentication ## Authentication Authenticate requests to public API endpoints using an API key. ### Header Send your key in the `X-API-Key` header. ```bash theme={null} curl -X GET "https://api.seleqt.ai/api/v1/public/chats" \ -H "X-API-Key: " ``` * **Key format**: `.` (example: `a1b2c3d4.xxxxx`) * **Do not share**: Treat the full key as a secret. Only the `prefix` is displayed in dashboards. ### Rate limits * Default: **50 requests per minute** per key * If exceeded: HTTP 429 with `{"error": "Rate limit exceeded"}` ### Error responses * 401 Missing/invalid key * 429 Rate limit exceeded ```json theme={null} {"error": "Missing API key", "message": "Provide X-API-Key header"} ``` # Introduction Source: https://docs.seleqt.ai/introduction ## Welcome Seleqt provides a simple API to manage API keys, access public endpoints, and receive webhooks for incoming messages. * Overview: * **Authentication**: via `X-API-Key` header * **Rate limits**: 50 requests/minute by default (per key) * **Webhooks**: forward incoming messages to your URL * **Manage keys & logs via API**: programmatically [manage API keys](/api/api-keys) and [retrieve API call logs](/api/api-logs) Jump in: * Getting started: [Authentication](/getting-started/authentication) * Manage keys: [API Keys](/api/api-keys) * Logs: [API Call Logs](/api/api-logs) * Webhooks: [Incoming messages](/webhooks/incoming-messages) # Connect Seleqt to Claude Source: https://docs.seleqt.ai/mcp/connect-claude Use your Seleqt lead lists, campaigns and analytics from Claude, Cursor, ChatGPT and other AI apps. Seleqt has an MCP server: a connector that AI apps use to work with your Seleqt account. Once connected, you can ask in plain language — *"Which of my campaigns got the most replies this month?"*, *"Find 50 heads of sales at Dutch SaaS companies and save them to a new list"*, *"Who replied to the Q4 founders campaign?"* There is nothing to install. You paste one URL and sign in with your Seleqt account. **Server URL:** `https://mcp.seleqt.ai/mcp` ## Claude (claude.ai and the desktop app) 1. Open **Settings › Connectors** and choose **Add custom connector**. 2. Name it `Seleqt` and paste `https://mcp.seleqt.ai/mcp` as the URL. Leave the advanced (OAuth client) fields empty. 3. Click **Add**, then **Connect**. 4. A Seleqt page opens. Sign in if asked, check the account and workspace, and click **Allow access**. 5. In a chat, open the tools menu and make sure **Seleqt** is switched on. On Team and Enterprise plans an owner adds the connector once for the organization; each member then clicks **Connect** and signs in with their own Seleqt account. ## Claude Code ```bash theme={null} claude mcp add --transport http seleqt https://mcp.seleqt.ai/mcp ``` Then run `/mcp` in Claude Code, pick **seleqt** and sign in. ## Cursor Add Seleqt to `~/.cursor/mcp.json` (or the project's `.cursor/mcp.json`): ```json theme={null} { "mcpServers": { "seleqt": { "url": "https://mcp.seleqt.ai/mcp" } } } ``` Open **Settings › MCP**; Cursor shows a **Login** button for Seleqt. Sign in and allow access. ## ChatGPT In **Settings › Connectors** (developer mode must be on), create a connector with the URL `https://mcp.seleqt.ai/mcp` and **OAuth** as the authentication. ChatGPT then sends you to Seleqt to sign in. ## Other apps and scripts (API key) Clients that can't sign in with OAuth can use a Seleqt API key (**Settings › Public API › Create API key**) as a bearer token: ```http theme={null} Authorization: Bearer ``` ## What the AI can do The AI works in your **current Seleqt workspace**, with **your permissions**. A Viewer can only read, for example. To work in another workspace, switch to it in the Seleqt app first. * **Read:** lead lists and leads, campaigns and their sequences, campaign leads and their status, analytics. * **Act:** search the B2B database, create and fill lists, import leads, enrich emails and phone numbers, build campaigns and sequences, add leads to campaigns, send a message to a lead, and add excluded domains. Before anything that deletes or overwrites data, spends credits, or messages real people, your AI app asks you to confirm. Launching, pausing and attaching sender accounts to campaigns stay in the Seleqt app. Requests count toward the same rate limit as the API (50 per minute). ## Disconnect Go to **Settings › Public API › AI apps** in Seleqt and click **Disconnect** next to the app. Its access stops right away. You can also remove the connector in the AI app itself. ## Troubleshooting | Message | What to do | | - | - | | "Your Seleqt sign-in has expired or was disconnected" | Reconnect Seleqt in the AI app (in Claude: **Settings › Connectors › Seleqt › Connect**). | | "This link has expired" on the Seleqt page | Sign-in links work once, for 15 minutes. Start connecting again from the AI app. | | "Your Seleqt role doesn't allow this" | Your role in this workspace can't do that action. Ask a workspace admin. | | "Too many requests to Seleqt" | Wait a minute; the limit is per minute. | | "Not found in your current Seleqt workspace" | The list or campaign is in another workspace. Switch workspace in the Seleqt app. | # Incoming messages Source: https://docs.seleqt.ai/webhooks/incoming-messages ## Incoming Messages Webhook Seleqt can forward new incoming messages to your webhook URL on a per-user basis. ### Configure PUT `/api/v1/user/webhook/` Body ```json theme={null} { "webhook_url": "https://your-app.com/seleqt-webhook" } ``` * Send `null` (or empty string in UI) to disable. ### Delivery When a new message is received on a connected account in your organization, Seleqt will POST: ```json theme={null} { "event": "incoming_message", "message": { "id": 123, "message_id": "abc123", "message": "Hello there", "sent_by_lead": true, "sent_at": "2025-06-09T11:22:33Z", "created_at": "2025-06-09T11:22:33Z", "updated_at": "2025-06-09T11:22:33Z", "campaign": { "id": 456, "name": "Outbound - SaaS founders", "status": "ACTIVE" }, "lead": { "id": 789, "first_name": "Alex", "last_name": "Doe", "profile_picture_url": "https://example.com/alex.jpg", "linkedin_profile_url": "https://www.linkedin.com/in/alex-doe/", "linkedin_public_id": "alex-doe", "job_title": "Head of Sales", "industry": "SaaS", "headline": "Helping teams close more deals", "email": "alex@example.com", "phone_number": "+1 555 0100", "location": "Amsterdam, NL", "status": "IN_REVIEW", "company": { "id": 321, "name": "Acme Inc", "linkedin_url": "https://www.linkedin.com/company/acme/", "logo_url": "https://example.com/logo.png", "website_url": "https://acme.com", "location": "Amsterdam, NL", "industry": "Software", "revenue": "$10M-$50M", "amount_of_employees": "51-200" }, "custom_fields": { "plan": "pro" } } } } ``` * Retries are not currently guaranteed; implement idempotency by checking `message.message_id` on your side. ### Security * Consider hosting your endpoint behind a firewall that allows only Seleqt IPs or implement your own signature verification. * For now, no signature header is included in this webhook. ### Example handler (Node/Express) ```javascript theme={null} app.post("/seleqt-webhook", async (req, res) => { const { event, message } = req.body || {}; if (event !== "incoming_message") return res.status(200).send("ignored"); // TODO: process message res.status(200).send({ ok: true }); }); ``` # Test webhook Source: https://docs.seleqt.ai/webhooks/test-webhook ## POST /api/v1/user/webhook/test/ Test your incoming messages webhook configuration by sending a test notification. Auth: Session-based authentication ### Use Case Use this endpoint to verify that your Slack webhook is configured correctly before receiving real notifications. This is especially useful after setting up a new webhook URL. ### Response **Success (200):** ```json theme={null} { "success": true, "message": "Test webhook sent successfully! Check your Slack channel for the test message.", "webhook_type": "slack", "status_code": 200 } ``` **Error - No webhook configured (400):** ```json theme={null} { "success": false, "error": "No webhook URL configured. Please configure a webhook first." } ``` **Error - Webhook delivery failed (400):** ```json theme={null} { "success": false, "error": "Webhook delivery failed with HTTP 404", "details": "channel_not_found" } ``` **Error - Timeout (400):** ```json theme={null} { "success": false, "error": "Webhook request timed out. Please check your webhook URL." } ``` ### Example ```bash theme={null} curl -X POST "https://app.seleqt.ai/api/v1/user/webhook/test/" \ -H "Cookie: sessionid=your_session_id" ``` ### What Happens 1. The endpoint checks if you have a webhook URL configured 2. Sends a test message to your webhook: * For Slack: Sends a formatted message with emoji * For generic webhooks: Sends a simple test event 3. Returns the result with HTTP status code ### Expected Result If configured correctly, you should see a test message in your Slack channel: > 🧪 **Test notification from Seleqt** > > Your Slack webhook is configured correctly! You will receive notifications here when prospects reply to your campaigns. ### Troubleshooting * **404 Error**: The Slack webhook URL is invalid or the channel was deleted * **Timeout**: The webhook URL is not responding (check for typos) * **403 Error**: The Slack app doesn't have permission to post to the channel