### Copy Leads to Campaign Response Example Source: https://docs.reachinbox.ai/globalLeads This is an example of a successful response when initiating the process of copying leads to a campaign. It indicates that the process has started and may take time depending on the number of leads. ```json { "status": 200, "message": "Adding leads to campaign process started successfully, it may take sometime depending on the number of leads." } ``` -------------------------------- ### Get All Accounts - Python Source: https://docs.reachinbox.ai/account Retrieves all sending accounts using Python's requests library. This example demonstrates how to set query parameters for filtering, pagination, and sorting, and includes the necessary Authorization header. ```python import requests token = '{token}' apiUrl = 'https://api.reachinbox.ai/api/v1/account/all' params = { 'contains': '', 'status': 'all', 'limit': 4, 'offset': 0, 'sortField': 'warmup_health_score', 'order': 'DESC' } headers = { 'Authorization': f'Bearer {token}' } response = requests.get(apiUrl, params=params, headers=headers) if response.status_code == 200: print(response.json()) else: print(f'Error: {response.status_code}, {response.text}') ``` -------------------------------- ### Update Lead Response Example Source: https://docs.reachinbox.ai/globalLeads This is an example of a successful response when a lead is updated. It indicates the status and a confirmation message. ```json { "status": 200, "message": "Lead updated successfully." } ``` -------------------------------- ### Get Blocklist Entries (PHP) Source: https://docs.reachinbox.ai/blocklist Fetches blocklist entries from a specific table using PHP. This example uses cURL to perform a GET request, including query parameters for limit, offset, and search, along with the authorization header. ```php ``` -------------------------------- ### POST /api/v1/campaigns/start Source: https://docs.reachinbox.ai/campaign Starts a specified campaign. ```APIDOC ## POST /api/v1/campaigns/start ### Description This endpoint makes an HTTP POST request to start a campaign using the provided payload. ### Method POST ### Endpoint /api/v1/campaigns/start ### Parameters #### Request Body - **campaignId** (integer) - Required - The ID of the campaign to be started. ### Request Example ```json { "campaignId": 53 } ``` ### Response #### Success Response (200) - **status** (integer) - HTTP status code. - **message** (string) - Confirmation message. - **data** (boolean) - Indicates if the campaign started successfully. #### Response Example ```json { "status": 200, "message": "campaign started successfully.", "data": true } ``` ``` -------------------------------- ### Get Blocklist Entries (JavaScript) Source: https://docs.reachinbox.ai/blocklist Fetches blocklist entries from a specific table using JavaScript. This example demonstrates a GET request with query parameters for pagination and search, and includes bearer token authentication. ```javascript const table = 'keyword'; const limit = 10; const offset = 0; const query = 'spam'; const token = '{token}'; const url = `https://api.reachinbox.ai/api/v1/blocklist/${table}?limit=${limit}&offset=${offset}&q=${query}`; fetch(url, { method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }) .then(response => response.json()) .then(data => console.log(data)); ``` -------------------------------- ### Start Campaign Source: https://docs.reachinbox.ai/campaign Starts a specified campaign. Requires the campaignId. Returns a success message and a boolean indicating if the campaign was started. ```curl curl --location 'https://api.reachinbox.ai/api/v1/campaigns/start' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {token}' \ --data '{ "campaignId": 53 }' ``` ```javascript const url = 'https://api.reachinbox.ai/api/v1/campaigns/start'; const token = '{token}'; const campaignId = 53; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }, body: JSON.stringify({ campaignId: campaignId }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```python import requests import json url = 'https://api.reachinbox.ai/api/v1/campaigns/start' token = '{token}' campaign_id = 53 headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer {token}' } data = { 'campaignId': campaign_id } response = requests.post(url, headers=headers, data=json.dumps(data)) print(response.json()) ``` ```php $campaignId ]; $headers = [ 'Content-Type: application/json', 'Authorization: Bearer ' . $token ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close($ch); echo $response; ?> ``` -------------------------------- ### Delete Leads Response Example Source: https://docs.reachinbox.ai/globalLeads This is an example of a successful response after deleting leads. It confirms the operation with a status code and a message. ```json { "status": 200, "message": "leads deleted successfully." } ``` -------------------------------- ### GET /api/v1/lead-list/all Source: https://docs.reachinbox.ai/globalLeads Retrieves all lead lists, with options for limiting, offsetting, and filtering by name. ```APIDOC ## GET /api/v1/lead-list/all ### Description Retrieves all lead lists. Supports pagination and searching by name. ### Method GET ### Endpoint /api/v1/lead-list/all ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of lead lists to return. - **offset** (integer) - Optional - The number of items to skip before starting to return results. - **contains** (string) - Optional - A string to search for within the name of the lead list. ### Request Example ```bash curl --location 'https://api.reachinbox.ai/api/v1/lead-list/all?limit=50&offset=0&contains=lead' \ --header 'Authorization: Bearer {token}' ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the response. - **message** (string) - A message indicating the result of the operation. - **data** (object) - Contains the list of lead lists. - **totalSearchedCount** (integer) - The total number of lead lists found matching the criteria. - **rows** (array) - An array of lead list objects. - **id** (integer) - The unique identifier for the lead list. - **name** (string) - The name of the lead list. - **createdAt** (string) - The timestamp when the lead list was created. - **updatedAt** (string) - The timestamp when the lead list was last updated. - **globalLeadsCount** (integer) - The total number of leads in the list. #### Response Example ```json { "status": 200, "message": "Leads list", "data": { "totalSearchedCount": 27, "rows": [ { "id": 177, "name": "Csp testing", "createdAt": "2024-09-02T10:00:06.000Z", "updatedAt": "2024-09-19T14:39:13.000Z", "globalLeadsCount": 45197 } ] } } ``` ``` -------------------------------- ### GET /api/v1/account/all Source: https://docs.reachinbox.ai/account Retrieves all sending accounts with optional filtering, pagination, and sorting capabilities. ```APIDOC ## GET /api/v1/account/all ### Description This endpoint makes an HTTP GET request to retrieve all accounts. The request includes query parameters such as contains, status, limit, offset, sortField, and order. The "contains" parameter allows filtering based on a specific value, "status" parameter filters accounts based on their status, "limit" parameter specifies the maximum number of accounts to be returned, "offset" parameter specifies the starting point for fetching accounts, "sortField" parameter specifies the field to sort the accounts by, and "order" parameter specifies the order of sorting. ### Method GET ### Endpoint /api/v1/account/all ### Query Parameters - **contains** (string) - Optional - It allows filtering based on a specific value. - **status** (string) - Optional - It filters accounts based on their status. - **limit** (integer) - Optional - It specifies the maximum number of accounts to be returned. - **offset** (integer) - Optional - It specifies the starting point for fetching accounts. - **sortField** (string) - Optional - It specifies the field to sort the accounts by. - **order** (string) - Optional - It specifies the order of sorting. ### Request Example ```json { "example": "curl --location 'https://api.reachinbox.ai/api/v1/account/all?contains=&status=all&limit=4&offset=0&sortField=warmup_health_score&order=DESC' \ --header 'Authorization: Bearer {token}' \ --data ''" } ``` ### Response #### Success Response (200) - **totalEmailsConnected** (integer) - Total number of connected email accounts. - **totalActiveEmails** (integer) - Total number of active email accounts. - **totalCount** (integer) - Total count of all email accounts. - **emailsConnected** (array) - An array of connected email account objects. - **email** (string) - The email address of the account. - **limits** (integer) - The sending limits for the account. - **mailsSentToday** (integer) - The number of emails sent today. - **bouncesToday** (integer) - The number of bounces today. - **id** (integer) - The unique identifier for the account. - **isActive** (boolean) - Indicates if the account is active. - **warmupEnabled** (boolean) - Indicates if warmup is enabled for the account. - **warmupHealthScore** (integer) - The warmup health score. - **warmupEmailSentPastWeek** (integer) - Number of warmup emails sent in the past week. - **statusConnection** (integer) - The connection status code. - **statusMessage** (string) - A message describing the connection status. - **isDisconnected** (boolean) - Indicates if the account is disconnected. - **type** (string) - The type of the email account (e.g., "oauth"). - **error** (boolean) - Indicates if there was an error with the account. - **firstName** (string) - The first name associated with the account. - **lastName** (string) - The last name associated with the account. - **trackingDomain** (string) - The tracking domain used for emails. - **signature** (string) - The email signature. - **isBlockedForWarmup** (boolean) - Indicates if the account is blocked for warmup. - **createdAt** (string) - The timestamp when the account was created. - **warmupFilterTag** (string) - The tag used for filtering warmup emails. - **moveWarmupEmails** (boolean) - Indicates if warmup emails should be moved. - **warmupDestinationFolder** (string) - The folder where warmup emails are moved. - **zapmailOrderId** (string) - The Zapmail order ID. - **minDelay** (integer) - The minimum delay in seconds for sending emails. - **workspace** (object) - Workspace details. - **id** (string) - The workspace ID. - **name** (string) - The workspace name. - **workspaceId** (string) - The ID of the workspace. - **emailAccountErrors** (any) - Information about email account errors (can be null). - **tags** (array) - An array of tags associated with the account. - **tagId** (integer) - The tag ID. - **tagName** (string) - The tag name. - **tagDesc** (string) - The tag description. #### Response Example ```json { "status": 200, "message": "Email accounts fetched successfully.", "data": { "totalEmailsConnected": 1, "totalActiveEmails": 1, "totalCount": 1, "emailsConnected": [ { "email": "user@example.com", "limits": 50, "mailsSentToday": 5, "bouncesToday": 0, "id": 1001, "isActive": true, "warmupEnabled": true, "warmupHealthScore": 90, "warmupEmailSentPastWeek": 70, "statusConnection": 100, "statusMessage": "Success", "isDisconnected": false, "type": "oauth", "error": false, "firstName": "Test", "lastName": "User", "trackingDomain": "track.example.com", "signature": "Regards,\nTest User", "isBlockedForWarmup": false, "createdAt": "2025-04-01T10:00:00.000Z", "warmupFilterTag": "Smart-Penguin", "moveWarmupEmails": true, "warmupDestinationFolder": "Warmup Emails", "zapmailOrderId": "ORDER123XYZ", "minDelay": 10, "workspace": { "id": "workspace-xyz", "name": "Sales" }, "workspaceId": "workspace-xyz", "emailAccountErrors": null, "tags": [ { "tagId": 201, "tagName": "sample-tag", "tagDesc": "For testing purposes" } ] } ] } } ``` ``` -------------------------------- ### GET /api/v1/others/get-all-tags Source: https://docs.reachinbox.ai/others This endpoint retrieves a list of all custom tags associated with your account and workspace. ```APIDOC ## GET /api/v1/others/get-all-tags ### Description This endpoint retrieves a list of all custom tags associated with your account and workspace. ### Method GET ### Endpoint /api/v1/others/get-all-tags ### Parameters #### Query Parameters None ### Response #### Success Response (200) - **data** (array) - An array of tag objects. - **tag_id** (integer) - The unique identifier for the tag. - **tag_name** (string) - The name of the tag. - **tag_desc** (string) - The description of the tag. #### Response Example ```json { "data": [ { "tag_id": 1, "tag_name": "Interested", "tag_desc": "Leads who have shown interest." }, { "tag_id": 2, "tag_name": "Follow-up", "tag_desc": "Leads that need a follow-up." } ] } ``` ``` -------------------------------- ### GET /api/v1/leads Source: https://docs.reachinbox.ai/lead Retrieves a list of leads for a specified campaign, with an option to fetch the next set of leads. ```APIDOC ## GET /api/v1/leads ### Description This endpoint makes an HTTP GET request to retrieve leads based on the specified campaign ID and whether it is the last lead. ### Method GET ### Endpoint /api/v1/leads ### Query Parameters #### Path Parameters - None #### Query Parameters - **campaignId** (integer) - Required - The ID of the campaign for which leads are being retrieved. - **lastLead** (string) - Optional - Indicates whether the retrieved lead is the last one. Defaults to false but need to pass last lead id to get the next leads. ### Request Example ```bash curl --location 'https://api.reachinbox.ai/api/v1/leads?campaignId=53&lastLead=false' \ --header 'Authorization: Bearer {token}' \ --data '' ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the response. - **message** (string) - A message indicating the result of the operation. - **data** (object) - Contains lead-related information. - **leadDetails** (object) - Summary of lead counts. - **leadsContactedCount** (integer) - The number of leads contacted. - **totalLeadsCount** (integer) - The total number of leads in the campaign. - **leads** (array) - An array of lead objects. - **id** (integer) - The unique identifier for the lead. - **campaignId** (integer) - The ID of the campaign the lead belongs to. - **email** (string) - The email address of the lead. - **attributes** (object) - Key-value pairs of lead attributes (e.g., firstName, company). - **stepNumber** (integer) - The current step number in the campaign sequence for the lead. - **status** (string) - The current status of the lead (e.g., IN_PROGRESS, COMPLETED). - **emailUsedToSend** (string) - The email address used to send communication to the lead. - **emailOpened** (boolean) - Indicates if the lead has opened the email. - **replyReceived** (boolean) - Indicates if a reply has been received from the lead. - **createdAt** (string) - The timestamp when the lead was created. - **emailThread** (object or null) - Information about the email thread. - **threadId** (integer) - The ID of the email thread. - **status** (string) - The status of the email thread. - **allActivities** (array) - A list of all activities associated with the lead. - **type** (string) - The type of activity (e.g., emailSent, emailOpened). - **occurredAt** (string) - The timestamp when the activity occurred. #### Response Example ```json { "status": 200, "message": "leads fetched successfully.", "data": { "leadDetails": { "leadsContactedCount": 5, "totalLeadsCount": 10 }, "leads": [ { "id": 1, "campaignId": 101, "email": "alice@example.com", "attributes": { "firstName": "Alice", "company": "Acme Corp" }, "stepNumber": 1, "status": "IN_PROGRESS", "emailUsedToSend": "team@acme.com", "emailOpened": true, "replyReceived": false, "createdAt": "2025-04-30T10:00:00.000Z", "emailThread": { "threadId": 201, "status": "Interested" }, "allActivities": [ { "type": "emailSent", "occurredAt": "2025-05-01T09:00:00.000Z" }, { "type": "emailOpened", "occurredAt": "2025-05-01T09:15:00.000Z" } ] } ] } } ``` ``` -------------------------------- ### GET /api/v1/lead-list/get-leads Source: https://docs.reachinbox.ai/globalLeads This endpoint retrieves leads from a specified lead list. It supports filtering and pagination. ```APIDOC ## GET /api/v1/lead-list/get-leads ### Description This endpoint retrieves leads from a specified lead list. It supports filtering and pagination. ### Method GET ### Endpoint /api/v1/lead-list/get-leads ### Parameters #### Query Parameters - **leadsListId** (integer) - Required - The ID of the lead list from which leads will be fetched. - **limit** (integer) - Optional - The maximum number of leads to return (default is 50). - **offset** (integer) - Optional - The number of leads to skip before starting to collect the result set. - **contains** (string) - Optional - A string to filter the leads based on email or name. ### Request Example ```curl curl --location 'https://api.reachinbox.ai/api/v1/lead-list/get-leads?leadsListId=185&limit=50&offset=0&contains=jaspreet' \ --header 'Authorization: Bearer {token}' ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the response. - **message** (string) - A message indicating the result of the operation. - **data** (object) - An object containing lead analytics and a list of lead rows. - **analytics** (object) - Statistics about the leads. - **rows** (array) - An array of lead objects. #### Response Example ```json { "status": 200, "message": "Leads list", "data": { "analytics": { "totalCount": 2, "totalSearchedCount": 2, "totalLeadsContactedCount": 1, "totalLeadsCompletedCount": 1, "totalLeadsOpenedCount": 1, "totalEmailsBounced": 0 }, "rows": [ { "id": 1001, "leadsListId": 201, "email": "john.doe@example.com", "attributes": { "phone": "1234567890", "linkedin": "https://linkedin.com/in/johndoe", "personId": "P001", "lastName": "Doe", "firstName": "John", "companyName": "Example Corp", "personLeadsSearchingCampaign": "Spring2025Campaign" }, "leadFinderId": null, "createdAt": "2025-04-01T10:00:00.000Z", "updatedAt": "2025-04-15T08:00:00.000Z", "deletedAt": null } ] } } ``` ``` -------------------------------- ### Get All Custom Tags Source: https://docs.reachinbox.ai/others Retrieves a list of all custom tags associated with the user's account and workspace. This endpoint does not require a request body. ```curl curl --location 'https://api.reachinbox.ai/api/v1/others/get-all-tags' \ --header 'Authorization: Bearer {token}' ``` -------------------------------- ### POST /api/v1/lead-list/create Source: https://docs.reachinbox.ai/globalLeads Creates a new lead list. Requires a name for the list. ```APIDOC ## POST /api/v1/lead-list/create ### Description This endpoint creates a new lead list. ### Method POST ### Endpoint /api/v1/lead-list/create ### Parameters #### Request Body - **name** (string) - Required - The name of the lead list to be created. ### Request Example ```json { "name": "Stage-lead-list" } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the response. - **message** (string) - A message indicating the result of the operation. - **data** (object) - Contains details of the created lead list. - **id** (integer) - The unique identifier for the created lead list. - **name** (string) - The name of the created lead list. - **createdAt** (string) - The timestamp when the lead list was created. - **updatedAt** (string) - The timestamp when the lead list was last updated. #### Response Example ```json { "status": 200, "message": "Leads list created successfully.", "data": { "coreVariables": [], "globalLeadsCount": 0, "id": 185, "name": "Stage-lead-list", "userId": 4, "workspaceId": null, "updatedAt": "2024-09-24T11:55:03.625Z", "createdAt": "2024-09-24T11:55:03.625Z" } } ``` ``` -------------------------------- ### Fetch Analytics Summary - Python Source: https://docs.reachinbox.ai/analytics This Python script uses the 'requests' library to get the analytics summary. It sends a POST request with the specified start and end dates, along with optional campaign ID filters in the JSON body. Ensure your API token is correctly inserted. ```python import requests import json url = 'https://api.reachinbox.ai/api/v1/analytics/summary' token = '{token}' # Replace with your actual token params = { 'startDate': '2023-10-11', 'endDate': '2023-11-28' } headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer {token}' } data = { "campaignIds": [], "excludeIds": [] } response = requests.post(url, params=params, headers=headers, data=json.dumps(data)) print(response.json()) ``` -------------------------------- ### Create Lead List using cURL, JavaScript, Python, PHP Source: https://docs.reachinbox.ai/globalLeads This endpoint creates a new lead list. It requires a name for the list and an authorization token. The response includes the status, a success message, and the details of the created list. ```curl curl --location 'https://api.reachinbox.ai/api/v1/lead-list/create' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {token}' \ --data '{ "name": "Stage-lead-list" }' ``` ```javascript const url = 'https://api.reachinbox.ai/api/v1/lead-list/create'; const token = '{token}'; const data = { "name": "Stage-lead-list" }; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```python import requests url = 'https://api.reachinbox.ai/api/v1/lead-list/create' token = '{token}' data = { "name": "Stage-lead-list" } headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer {token}' } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```php 'Stage-lead-list' ]; $headers = [ 'Content-Type: application/json', 'Authorization: Bearer ' . $token ]; $ch = curl_init($url); cert_setopt($ch, CURLOPT_RETURNTRANSFER, true); cert_setopt($ch, CURLOPT_POST, true); cert_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); cert_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { echo $response; } curl_close($ch); ?> ``` -------------------------------- ### POST /api/v1/account/warmup/enable Source: https://docs.reachinbox.ai/account Enables the warmup process for specified email accounts. Supports filtering by status, content, and tags, and allows for specific account IDs or all accounts to be included. ```APIDOC ## POST /api/v1/account/warmup/enable ### Description Enables the warmup process for specified email accounts. Supports filtering by status, content, and tags, and allows for specific account IDs or all accounts to be included. ### Method POST ### Endpoint /api/v1/account/warmup/enable ### Parameters #### Path Parameters None #### Query Parameters - **status** (string) - Optional - Filter accounts by status. - **contains** (string) - Optional - Filter accounts by email content. - **filterTagId** (string) - Optional - Filter accounts by a specific tag ID. #### Request Body - **ids** (array) - Required - The account IDs to warm up, or "ALL" to warm up all accounts. - **exclude** (array) - Optional - Account IDs to exclude from the warmup process. ### Request Example ``` curl --location 'https://api.reachinbox.ai/api/v1/account/warmup/enable?status=active&contains=gmail&filterTagId=123' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {token}' \ --data '{ "ids": [1098], "exclude": [1099] }' ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the response. - **message** (string) - A message indicating the result of the operation. #### Response Example ```json { "status": 200, "message": "warmup started successfully." } ``` ``` -------------------------------- ### Get Campaign Name (JavaScript) Source: https://docs.reachinbox.ai/campaign This JavaScript snippet shows how to get a campaign's name by making a GET request to the /campaigns/name endpoint. It includes the `campaignId` as a query parameter and requires an Authorization header. ```javascript async function getCampaignName(token, campaignId) { const url = new URL('https://api.reachinbox.ai/api/v1/campaigns/name'); url.searchParams.append('campaignId', campaignId); const response = await fetch(url, { method: 'GET', headers: { 'Authorization': `Bearer ${token}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } ``` -------------------------------- ### Get Campaign Status (Python) Source: https://docs.reachinbox.ai/campaign This Python code uses the 'requests' library to get a campaign's status. It sends a GET request to the /campaigns/status endpoint, passing the `campaignId` as a query parameter and including the Authorization header. ```python import requests def get_campaign_status(token, campaign_id): url = 'https://api.reachinbox.ai/api/v1/campaigns/status' params = { 'campaignId': campaign_id } headers = { 'Authorization': f'Bearer {token}' } response = requests.get(url, params=params, headers=headers) response.raise_for_status() return response.json() ``` -------------------------------- ### Get Account Overview Source: https://docs.reachinbox.ai/account Retrieves a comprehensive overview of an email account, including campaign activity, warmup schedules, connection health, and DNS records. Requires an 'emailId' query parameter. The response contains detailed statistics and status information. ```curl curl --location 'https://api.reachinbox.ai/api/v1/account/get-info?emailId=101' \ --header 'Authorization: Bearer {token}' ``` ```javascript const url = 'https://api.reachinbox.ai/api/v1/account/get-info'; const params = { emailId: 101 }; fetch(`${url}?${new URLSearchParams(params)}`, { method: 'GET', headers: { 'Authorization': 'Bearer {token}' } }) .then(response => response.json()) .then(data => console.log(data)); ``` ```python import requests url = 'https://api.reachinbox.ai/api/v1/account/get-info' params = { 'emailId': 101 } headers = { 'Authorization': 'Bearer {token}' } response = requests.get(url, params=params, headers=headers) print(response.json()) ``` ```php 101]; $headers = ['Authorization: Bearer {token}']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($params)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); print_r(json_decode($response, true)); ?> ``` -------------------------------- ### Create New Tag Source: https://docs.reachinbox.ai/others Allows the creation of one or more custom tags. Requires a list of tag objects, each with a name and an optional description. ```curl curl --location 'https://api.reachinbox.ai/api/v1/others/create-tag' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {token}' \ --data '{ "tags": [ { "tag_name": "New Lead", "tag_desc": "For all new potential customers" } ] }' ``` -------------------------------- ### Get Campaign Name (cURL) Source: https://docs.reachinbox.ai/campaign This cURL command illustrates how to fetch the name of a campaign using a GET request to the /campaigns/name endpoint. The `campaignId` is provided as a query parameter, and an Authorization header is necessary. ```cURL curl --location --request GET 'https://api.reachinbox.ai/api/v1/campaigns/name?campaignId=8385' \ --header 'Authorization: Bearer {token}' ``` -------------------------------- ### POST /api/v1/account/create Source: https://docs.reachinbox.ai/account Connects a new email account using custom IMAP and SMTP credentials. All required server details must be provided in the request body. ```APIDOC ## POST /api/v1/account/create ### Description Connects a new email account using custom IMAP and SMTP credentials. All required server details must be provided in the request body. ### Method POST ### Endpoint /api/v1/account/create ### Parameters #### Request Body - **type** (string) - Required - The type of connection. Must be set to "imapSingle". - **firstName** (string) - Required - The first name of the account user. - **lastName** (string) - Required - The last name of the account user. - **email** (string) - Required - The email address of the account to connect. - **smtpUsername** (string) - Required - The username for the SMTP server. - **smtpPassword** (string) - Required - The password for the SMTP server. - **smtpHost** (string) - Required - The hostname for the SMTP server. - **smtpPort** (integer) - Required - The port number for the SMTP server (e.g., 587). - **imapUsername** (string) - Required - The username for the IMAP server. - **imapPassword** (string) - Required - The password for the IMAP server. - **imapHost** (string) - Required - The hostname for the IMAP server. - **imapPort** (integer) - Required - The port number for the IMAP server (e.g., 993). ### Request Example ```json { "type": "imapSingle", "firstName": "John", "lastName": "Doe", "email": "user@example.com", "smtpUsername": "user@example.com", "smtpPassword": "smtp_password", "smtpHost": "server.smtp.mail.com", "smtpPort": 587, "imapUsername": "user@example.com", "imapPassword": "imap_password", "imapHost": "server.imap.mail.com", "imapPort": 993 } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the response. - **message** (string) - A message indicating the result of the operation. #### Response Example ```json { "status": 200, "message": "email connected successfully." } ``` ``` -------------------------------- ### Get Account Overview Source: https://docs.reachinbox.ai/account Retrieves a comprehensive overview of a specific email account, including campaign activity, warmup schedules, connection health, and DNS records. ```APIDOC ## GET /api/v1/account/get-info ### Description This endpoint retrieves a comprehensive overview of a specific email account. The response includes its campaign activity for the current day, upcoming warmup schedules, recent connection health status, and verified DNS records. ### Method GET ### Endpoint /api/v1/account/get-info ### Parameters #### Query Parameters - **emailId** (integer) - Required - The unique identifier for the email account you want to retrieve information for. ### Request Example ```bash curl --location 'https://api.reachinbox.ai/api/v1/account/get-info?emailId=101' \ --header 'Authorization: Bearer {token}' ``` ### Response #### Success Response (200) - **campaignStats** (object) - Statistics related to email campaigns. - **campaigns** (array) - List of campaigns. - **id** (integer) - Campaign ID. - **name** (string) - Campaign name. - **workspace** (string) - Workspace name. - **sends** (integer) - Number of sends. - **totalSends** (integer) - Total number of sends across all campaigns. - **emailDetails** (array) - Details about the email account. - **id** (integer) - Email account ID. - **email** (string) - Email address. - **firstName** (string) - First name of the account user. - **lastName** (string) - Last name of the account user. - **isActive** (boolean) - Indicates if the account is active. - **warmupEnabled** (boolean) - Indicates if warmup is enabled. - **minimumWaitTime** (integer) - Minimum wait time for warmup in minutes. - **acknowledgedAt** (string) - Timestamp when the account was acknowledged. - **nextWarmupScheduledAt** (string) - Timestamp for the next scheduled warmup. - **warmupReceivedPastWeek** (integer) - Number of warmups received in the past week. - **monitor** (array) - List of monitoring events. - **errorMessage** (string) - Error message if any. - **timestamp** (string) - Timestamp of the monitoring event. - **domainRecords** (object) - Status of verified DNS records. - **spf** (boolean) - SPF record status. - **dkim** (boolean) - DKIM record status. - **dmarc** (boolean) - DMARC record status. - **mx** (boolean) - MX record status. #### Response Example ```json { "campaignStats": { "campaigns": [ { "id": 201, "name": "Q3 Marketing Push", "workspace": "Sales Team", "sends": 15 }, { "id": 202, "name": "New Feature Launch", "workspace": "Sales Team", "sends": 25 } ], "totalSends": 40 }, "emailDetails": [ { "id": 101, "email": "user@example.com", "firstName": "John", "lastName": "Doe", "isActive": true, "warmupEnabled": true, "minimumWaitTime": 45, "acknowledgedAt": "2025-06-21T10:00:00.000Z", "nextWarmupScheduledAt": "2025-06-21T14:30:00.000Z", "warmupReceivedPastWeek": 68, "monitor": [ { "errorMessage": "Connection timeout", "timestamp": "2025-06-21T11:05:00.000Z" } ] } ], "domainRecords": { "spf": true, "dkim": true, "dmarc": true, "mx": true } } ``` ``` -------------------------------- ### Get Campaign Status (cURL) Source: https://docs.reachinbox.ai/campaign This cURL command shows how to retrieve the status of a specific campaign by sending a GET request to the /campaigns/status endpoint with a `campaignId` query parameter. An Authorization header is required. ```cURL curl --location --request GET 'https://api.reachinbox.ai/api/v1/campaigns/status?campaignId=8385' \ --header 'Authorization: Bearer {token}' ``` -------------------------------- ### Remove Custom Tag from Email Request Examples Source: https://docs.reachinbox.ai/others Examples of how to remove a custom tag from an email using the Reachinbox API. This endpoint requires the tag ID and an array of email IDs. The tag itself is not deleted. ```curl curl --location 'https://api.reachinbox.ai/api/v1/others/remove-tag-email' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {token}' \ --data '{ "tag_id": 170, "emailIds": ["101"] }' ``` ```javascript const token = '{token}'; const tagId = 170; const emailIds = ["101"]; fetch('https://api.reachinbox.ai/api/v1/others/remove-tag-email', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }, body: JSON.stringify({ tag_id: tagId, emailIds: emailIds }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```python import requests import json token = '{token}' tag_ID = 170 EMAIL_IDS = ["101"] url = "https://api.reachinbox.ai/api/v1/others/remove-tag-email" headers = { "Content-Type": "application/json", "Authorization": f"Bearer {token}" } data = { "tag_id": TAG_ID, "emailIds": EMAIL_IDS } response = requests.post(url, headers=headers, data=json.dumps(data)) print(response.status_code) print(response.json()) ``` ```php $tag_id, 'emailIds' => $emailIds ]; $ch = curl_init($url); cert_setopt($ch, CURLOPT_RETURNTRANSFER, true); cert_setopt($ch, CURLOPT_POST, true); cert_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); cert_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch); } cert_close($ch); echo $response; ?> ``` -------------------------------- ### Fetch Warmup Analytics (Python) Source: https://docs.reachinbox.ai/analytics This Python script utilizes the `requests` library to fetch email warmup analytics. It constructs the URL dynamically based on whether an `ecId` is provided and includes the authorization token in the headers. Error handling is included for network issues or non-successful HTTP responses. ```python import requests def get_warmup_analytics(ec_id=None): token = '{token}' base_url = 'https://api.reachinbox.ai/api/v1/analytics/warmup-analytics' params = {'ecId': ec_id} if ec_id else None headers = { 'Authorization': f'Bearer {token}' } try: response = requests.get(base_url, headers=headers, params=params) response.raise_for_status() # Raise an exception for bad status codes data = response.json() print(data) return data except requests.exceptions.RequestException as e: print(f'Error fetching warmup analytics: {e}') return None # Example usage: # get_warmup_analytics(123) # For a specific account # get_warmup_analytics() # For all accounts ```