# Pabbly Email Marketing > **Per-section URLs available** — append `.md` to any docs URL for markdown: > - Endpoint: `/pabbly/email-marketing/{tagSlug}/{endpointSlug}.md` > - Resource object: `/pabbly/email-marketing/{tagSlug}/object.md` > - Guide page: `/pabbly/email-marketing/guides/{docSlug}.md` > > Or send `Accept: text/markdown` on the canonical URL. > REST API for Pabbly Email Marketing - Base URL: `https://emails.pabbly.com/api/v2` - Authentication: Bearer token via `Authorization` header - Version: v2 --- ## Guides ### Overview The Pabbly Email Marketing API lets you programmatically manage subscribers, subscriber lists, campaigns, delivery servers, and custom fields. Integrate your Pabbly Email Marketing account with your own applications, automate list management, and trigger campaign sends from anywhere over standard HTTPS. *Example request* ```bash curl https://emails.pabbly.com/api/v2/subscribers \ -H "Authorization: Bearer {{YOUR_API_KEY}}" ``` **Base URL** All endpoints are relative to the base URL below. Combine the base URL with the path on each endpoint to get the full request URL. *Base URL* ```text https://emails.pabbly.com/api/v2 ``` **Requests and responses** The API accepts JSON request bodies and returns JSON responses. Send `Content-Type: application/json` on every request that has a body. Path parameters are interpolated into the URL; query parameters and body fields are documented per endpoint. *Success response* ```json { "success": true, "data": { /* … */ } } ``` **Errors** When a request fails, the response status code reflects the error category and the body carries a human-readable message. Treat any non-2xx status as a failure. | Status | Meaning | |---|---| | 200, 201 | Success | | 400 | Bad request — missing or malformed parameters | | 401 | Unauthorized — missing or invalid API credentials | | 404 | Not found — the resource does not exist | | 429 | Too many requests | | 5xx | Server error — retry with backoff | *Error response* ```json { "success": false, "error": "A human-readable explanation" } ``` ### Authentication The Pabbly Email Marketing API uses **Bearer Token** authentication. Every request must include your API key in the `Authorization` header. *Auth header* ```http Authorization: Bearer {{YOUR_API_KEY}} ``` **Getting your credentials** Sign in to your Pabbly account and navigate to **Settings → API & Webhooks**. Copy the **API key** shown there — it is the only credential you need for API requests. Treat it like a password. **Making authenticated requests** Send your API key in the `Authorization` header on every request. The examples on the right show how to call /subscribers with proper authentication. *cURL* ```bash curl https://emails.pabbly.com/api/v2/subscribers \ -H "Authorization: Bearer {{YOUR_API_KEY}}" ``` *Node.js* ```javascript const response = await fetch( 'https://emails.pabbly.com/api/v2/subscribers', { headers: { 'Authorization': 'Bearer {{YOUR_API_KEY}}' } } ); const data = await response.json(); ``` *Python* ```python import requests response = requests.get( 'https://emails.pabbly.com/api/v2/subscribers', headers={'Authorization': 'Bearer {{YOUR_API_KEY}}'}, ) data = response.json() ``` **Keep your credentials secret** Your credentials grant full access to your account. Never embed them in browser-side code, commit them to version control, or share them in support tickets. If you suspect a credential has been exposed, rotate it from the dashboard (**Settings → API & Webhooks**) and update any servers that use it. --- ## API Reference ### Subscribers #### POST /subscribers — Create Subscriber Creates a new subscriber or updates an existing subscriber (upsert operation). If the email already exists, the subscriber will be updated; otherwise, a new subscriber will be created. You can assign tags, segments, lists, and custom fields during creation **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | email | string | Yes | Valid email address of the subscriber. | | firstName | string | No | First name of the subscriber. | | lastName | string | No | Last name of the subscriber. | | mobile | string | No | Phone number with country code (e.g., +1234567890). | | leadScore | integer | No | Lead score value between 0-100. | | status | string | No | Subscription status. Valid values: subscribed, unsubscribed, bounced, complaint. Default: subscribed. | | country | string | No | Country name of the subscriber. | | city | string | No | City name of the subscriber. | | tags | array | No | Array of tag names to assign to the subscriber. Tags must exist in Settings. | | customFields | object | No | Custom field key-value pairs. Custom fields must exist in Settings. | |   ↳ company | string | No | | |   ↳ position | string | No | | | lists | array | No | Array of list names to assign to the subscriber. | | dateOfBirth | string | No | Date of birth in YYYY-MM-DD format. | | source | string | No | Source of the subscriber (e.g., "api", "form", "csv"). | **Example Response (201):** ```json { "success": true, "status": "success", "message": "Subscriber created successfully", "data": { "userId": "682db2da6ef7e93a3eceb126", "businessId": "695b6aabf58d3822ac852e28", "email": "jocghn.doe@example.com", "firstName": "John", "lastName": "Doe", "mobile": "+1234567890", "leadScore": 85, "dateOfBirth": null, "status": "subscribed", "country": "USA", "city": "New York", "tags": [ "temp" ], "source": "manual", "segments": [], "customFields": {}, "activity": [], "automationWorkflows": [], "lists": [ "Temp List" ], "totalSent": 0, "totalDelivered": 0, "totalOpens": 0, "totalUniqueOpens": 0, "totalUniqueClick": 0, "totalClicks": 0, "deleteAfter": null, "suppressionDetail": { "createdAt": "2026-01-14T06:00:57.540Z", "updatedAt": "2026-01-14T06:00:57.540Z" }, "_id": "6967311955b46d5df8e4a7c3", "campaignDetails": [], "createdAt": "2026-01-14T06:00:57.540Z", "updatedAt": "2026-01-14T06:00:57.540Z" } } ``` #### GET /subscribers — Get All Subscribers Retrieves a paginated list of subscribers with optional filtering and search capabilities. Supports filtering by status, tags, segments, lists, and lead score range. Also supports searching by email, first name, or last name. Query Parameters: **Query parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | page | integer | No | Page number for pagination. Default: 1. | | limit | integer | No | Number of items per page. Default: 10. Maximum: 100. | | search | string | No | Search term to filter by email, firstName, or lastName. | | status | string | No | Filter by subscription status. Valid values: subscribed, unsubscribed, bounced, complaint. | | tags | string | No | Filter by tag names. Can be comma-separated string or array. | | segments | string | No | Filter by segment names. Can be comma-separated string or array. | | lists | string | No | Filter by list names. Can be comma-separated string or array. | | leadScoreMin | string | No | Minimum lead score for filtering. | | leadScoreMax | string | No | Maximum lead score for filtering. | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscribers retrieved successfully", "data": { "subscribers": [ { "_id": "69525f392011e7f242b57684", "userId": "682db2da6ef7e93a3eceb126", "businessId": "69398c24e90b87748e209d9b", "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe Updated", "mobile": "+1234567890", "leadScore": 90, "dateOfBirth": null, "status": "subscribed", "country": "USA", "city": "New York", "tags": [ "VIP", "Premium", "New Tag" ], "source": "manual", "segments": [ "Temp Customer" ], "customFields": { "company": "Updated Company Name", "position": "Senior Software Engineer" }, "activity": [], "automationWorkflows": [], "lists": [ "Temp List" ], "totalSent": 0, "totalDelivered": 0, "totalOpens": 0, "totalUniqueOpens": 0, "totalUniqueClick": 0, "totalClicks": 0, "deleteAfter": null, "suppressionDetail": { "createdAt": "2025-12-29T11:00:09.547Z", "updatedAt": "2025-12-29T11:00:09.547Z" }, "campaignDetails": [], "createdAt": "2025-12-29T11:00:09.547Z", "updatedAt": "2025-12-29T11:00:39.970Z" } ], "suppressionList": [], "pagination": { "currentPage": 1, "itemsPerPage": 20, "totalItems": 1, "totalPages": 1, "hasNextPage": false, "hasPrevPage": false } } } ``` #### GET /subscribers/stats — Get Subscriber Statistics Retrieves subscriber statistics for your business, including total subscriber count and status-wise breakdown (subscribed, unsubscribed, bounced, complaint). **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscribers record retrieved successfully", "data": { "totalSubscribersInBusiness": 1, "totalSubscribersAcrossAllLists": 1, "listWiseCounts": [ { "_id": "1022247", "listName": "Default List", "count": 0, "totalSubscribers": 0, "unsubscribedCount": 0, "engagedCount": 0 }, { "_id": "1024200", "listName": "Segment_10 number", "count": 0, "totalSubscribers": 0, "unsubscribedCount": 0, "engagedCount": 0 }, { "_id": "693a5a165ed8605a12f04d10", "listName": "Temp List", "count": 1, "totalSubscribers": 1, "unsubscribedCount": 0, "engagedCount": 0 } ], "leadScoreAnalytics": { "averageLeadScore": 90, "hotLeads": 1, "coldLeads": 0 }, "leadScoreConfig": { "emailOpen": { "value": 5, "status": "active" }, "emailClick": { "value": 10, "status": "active" }, "emailBounce": { "value": -20, "status": "active" }, "unsubscribe": { "value": -50, "status": "active" }, "createdAt": "2025-12-16T20:32:02.930Z", "updatedAt": "2025-12-16T20:32:02.930Z" }, "statusAnalytics": { "subscribed": 1, "unsubscribed": 0, "bounced": 0, "spam": 0 }, "engagedSubscribers": 0, "isListSpecific": false, "selectedListName": "All Subscribers" } } ``` #### GET /subscribers/{subscriber ID} — Get Subscriber by ID Retrieves complete details of a specific subscriber by their unique ID. Returns all subscriber information including custom fields, tags, segments, lists, and timestamps. **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber retrieved successfully", "data": { "suppressionDetail": { "createdAt": "2025-12-26T10:52:24.301Z", "updatedAt": "2025-12-26T10:52:24.301Z" }, "_id": "694e68e83dd13469d1326278", "userId": "682db2da6ef7e93a3eceb126", "businessId": "69398c24e90b87748e209d9b", "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "mobile": "+1234567890", "leadScore": 85, "dateOfBirth": null, "status": "subscribed", "country": "USA", "city": "New York", "tags": [ "VIP", "Premium", "New Tag", "temp" ], "source": "manual", "segments": [ "Temp Customer" ], "customFields": { "company": "Acme Corporation", "position": "Software Engineer" }, "activity": [], "automationWorkflows": [], "lists": [ "Temp List" ], "totalSent": 0, "totalDelivered": 0, "totalOpens": 0, "totalUniqueOpens": 0, "totalUniqueClick": 0, "totalClicks": 0, "deleteAfter": null, "campaignDetails": [], "createdAt": "2025-12-26T10:52:24.301Z", "updatedAt": "2025-12-27T07:43:17.294Z" } } ``` #### PUT /subscribers/{ subscriber Id} — Update Subscriber by ID Updates an existing subscriber's information by their unique ID or email address. The API automatically detects whether you're using a subscriber ID or email address. All provided fields will be updated; omitted fields remain unchanged. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | firstName | string | No | Update subscriber's first name. | | lastName | string | No | Update subscriber's last name. | | leadScore | integer | No | Update lead score value (0-100). | | status | string | No | Update subscription status. Valid values: subscribed, unsubscribed, bounced, complaint. | | tagsToAdd | array | No | Add tags to existing subscriber tags. Tags will be merged with existing tags (duplicates are automatically removed). Tags must exist in Settings. This field is ignored if tags field is also provided. | | tagsToRemove | array | No | Remove specific tags from subscriber. Tags specified in this array will be removed from existing tags. This field is ignored if tags field is also provided. | | customFields | object | No | Update custom fields. Custom fields must exist in Settings. | |   ↳ company | string | No | | |   ↳ position | string | No | | | mobile | string | No | Update subscriber's phone number. | | country | string | No | Update subscriber's country. | | city | string | No | Update subscriber's city. | | tags | string | No | Update tags. Note: This replaces all existing tags. Tags must exist in Settings. | | lists | string | No | Update lists. Note: This replaces all existing lists. | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber updated successfully", "data": { "suppressionDetail": { "createdAt": "2026-01-06T06:19:07.546Z", "updatedAt": "2026-01-06T07:15:45.730Z", "reason": "bounced", "type": "bounced" }, "_id": "695ca95b9a8ed4e65738d1c5", "userId": "682db2da6ef7e93a3eceb126", "businessId": "695b6aabf58d3822ac852e28", "email": "s001gourav@gmail.com", "firstName": "John", "lastName": "Doe Updated", "mobile": "", "leadScore": 90, "dateOfBirth": null, "status": "subscribed", "country": "Not Specified", "city": "Not Specified", "tags": [ "hot lead", "Premium", "New Tag" ], "source": "manual", "segments": [], "customFields": { "company": "Updated Company Name", "position": "Senior Software Engineer" }, "activity": [], "automationWorkflows": [], "lists": [ "Pabbly Email Marketing", "cvbcbbc" ], "totalSent": 2, "totalDelivered": 0, "totalOpens": 0, "totalUniqueOpens": 0, "totalUniqueClick": 0, "totalClicks": 0, "deleteAfter": null, "campaignDetails": [ { "_id": "69672de955b46d5df8e456e7", "campaignId": "695ca9729a8ed4e65738d2d9", "campaignName": "gfgf" }, { "_id": "69672de955b46d5df8e456e8", "campaignId": "695caafb9a8ed4e6573906ac", "campaignName": "pp" }, { "_id": "69672de955b46d5df8e456e9", "campaignId": "695cb3d29a8ed4e6573a0430", "campaignName": "tr" }, { "_id": "69672de955b46d5df8e456ea", "campaignId": "695cb6579a8ed4e6573a05fd", "campaignName": "d" } ], "createdAt": "2026-01-06T06:19:07.546Z", "updatedAt": "2026-01-14T05:47:21.327Z", "isSuppressed": true } } ``` #### DELETE /subscribers — Delete Subscriber Deletes one or more subscribers from your account. Supports bulk deletion by providing multiple subscriber IDs in the request body. Warning: Deleted subscribers cannot be recovered. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | ids | array | Yes | Array of subscriber IDs to delete. Must contain at least one ID. | **Example Response (200):** ```json { "success": true, "status": "success", "message": " subscriber deleted successfully", "data": { "shouldRefreshStats": true, "deletedCount": 1 } } ``` #### PUT /subscribers/{{email}} — Update Subscriber by Email Updates an existing subscriber's information using their email address. Allows updating any subscriber field including tags, segments, lists, custom fields, lead score, and status. All provided fields will be updated; omitted fields will remain unchanged. The email address must be a valid, properly formatted email. URL Parameters: **Path parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | email | string | Yes | | **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | firstName | string | No | | | lastName | string | No | | | leadScore | integer | No | | | status | string | No | | | tagsToAdd | array | No | | | tagsToRemove | array | No | | | customFields | object | No | | |   ↳ company | string | No | | |   ↳ position | string | No | | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber updated successfully", "data": { "suppressionDetail": { "createdAt": "2026-01-06T06:19:07.546Z", "updatedAt": "2026-01-06T07:15:45.730Z", "reason": "bounced", "type": "bounced" }, "_id": "695ca95b9a8ed4e65738d1c5", "userId": "682db2da6ef7e93a3eceb126", "businessId": "695b6aabf58d3822ac852e28", "email": "s001gourav@gmail.com", "firstName": "John", "lastName": "Doe Updated", "mobile": "", "leadScore": 90, "dateOfBirth": null, "status": "subscribed", "country": "Not Specified", "city": "Not Specified", "tags": [ "hot lead", "Premium", "New Tag" ], "source": "manual", "segments": [], "customFields": { "company": "Updated Company Name", "position": "Senior Software Engineer" }, "activity": [], "automationWorkflows": [], "lists": [ "Pabbly Email Marketing", "cvbcbbc" ], "totalSent": 2, "totalDelivered": 0, "totalOpens": 0, "totalUniqueOpens": 0, "totalUniqueClick": 0, "totalClicks": 0, "deleteAfter": null, "campaignDetails": [ { "_id": "69672bdf55b46d5df8e4284c", "campaignId": "695ca9729a8ed4e65738d2d9", "campaignName": "gfgf" }, { "_id": "69672bdf55b46d5df8e4284d", "campaignId": "695caafb9a8ed4e6573906ac", "campaignName": "pp" }, { "_id": "69672bdf55b46d5df8e4284e", "campaignId": "695cb3d29a8ed4e6573a0430", "campaignName": "tr" }, { "_id": "69672bdf55b46d5df8e4284f", "campaignId": "695cb6579a8ed4e6573a05fd", "campaignName": "d" } ], "createdAt": "2026-01-06T06:19:07.546Z", "updatedAt": "2026-01-14T05:38:39.423Z", "isSuppressed": true } } ``` #### GET /subscribers/{{email}} — Get Subscriber by Email Retrieves complete details of a specific subscriber by their Email ID. Returns all subscriber information including custom fields, tags, segments, lists, and timestamps. **Path parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | email | string | Yes | | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber retrieved successfully", "data": { "suppressionDetail": { "createdAt": "2025-12-29T11:00:09.547Z", "updatedAt": "2025-12-29T11:00:09.547Z" }, "_id": "69525f392011e7f242b57684", "userId": "682db2da6ef7e93a3eceb126", "businessId": "69398c24e90b87748e209d9b", "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "mobile": "+1234567890", "leadScore": 85, "dateOfBirth": null, "status": "subscribed", "country": "USA", "city": "New York", "tags": [ "VIP", "Premium", "New Tag", "temp" ], "source": "manual", "segments": [ "Temp Customer" ], "customFields": { "company": "Acme Corporation", "position": "Software Engineer" }, "activity": [], "automationWorkflows": [], "lists": [ "Temp List" ], "totalSent": 0, "totalDelivered": 0, "totalOpens": 0, "totalUniqueOpens": 0, "totalUniqueClick": 0, "totalClicks": 0, "deleteAfter": null, "campaignDetails": [], "createdAt": "2025-12-29T11:00:09.547Z", "updatedAt": "2025-12-29T11:00:39.970Z" } } ``` #### GET /custom-fields — Get All Custom Fields Prerequites: You need a valid API token generated from your Pabbly Email Marketing account. Retrieves all custom fields defined for a specific business. Returns custom field names and personalization tags. Custom fields are sorted alphabetically by name. Use this endpoint to get valid custom field names before creating or updating subscribers. **Example Response (200):** ```json { "success": true, "status": "success", "message": "Custom fields retrieved successfully", "data": { "businessId": "695b6aabf58d3822ac852e28", "customFields": [ { "name": "NewLead", "personalizationTag": "{newlead}" } ], "total": 1 } } ``` ### Campaigns #### POST /campaigns — Create Campaign Only HTML builder type is supported. The campaign is automatically set to "live" status and "API / Workflow Campaign" type. You can paste HTML content directly to create the campaign.EndFragment Body Fields **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | campaignDetails | object | No | | |   ↳ campaignName | string | No | | |   ↳ senderName | string | No | | |   ↳ subject | string | No | | |   ↳ preheaderText | string | No | | | builderType | string | No | | | content | string | No | | **Example Response (201):** ```json { "success": true, "status": "success", "message": "Campaign created successfully via public API.", "data": { "campaignDetails": { "campaignType": "API / Workflow Campaign", "campaignName": "Welcome Newsletddter", "senderName": "John Doe", "subject": "Welcome to our newsletter", "preheaderText": "Check out our latest updates" }, "sendDetails": { "deliveryServerRouting": false, "deliveryServerRoutingConfig": [] }, "recipientDetails": { "includedList": [], "excludedList": [], "sentToIndividuals": [], "autoFollow": false }, "totalStats": { "sent": 0, "delivered": 0, "failed": 0, "queued": 0, "opened": 0, "uniqueOpens": 0, "clicked": 0, "unsubscribed": 0, "bounced": 0, "softBounced": 0, "hardBounced": 0 }, "linksStats": { "clicks": 0 }, "batchProcessing": { "currentListIndex": 0, "currentBatchSkip": 0, "batchSize": 10000, "isInitialized": false, "processedSubscribers": 0, "allSubscribersQueued": false, "totalUniqueEmails": 0, "completionRetryCount": 0, "validationMismatch": false, "forceCompleted": false }, "_id": "695264982011e7f242b9cd9c", "userId": "682db2da6ef7e93a3eceb126", "businessId": "69398c24e90b87748e209d9b", "campaignFolder": null, "status": "live", "templateId": "695264982011e7f242b9cd9e", "totalSubscribers": 0, "isDeleted": false, "deletedAt": null, "permanentDeleteAt": null, "countryStats": [], "deviceStats": [], "osStats": [], "createdAt": "2025-12-29T11:23:04.838Z", "updatedAt": "2025-12-29T11:23:04.841Z", "__v": 0 } } ``` #### GET /campaigns — Get All Campaigns Retrieves a paginated list of campaigns for your business. Supports filtering by campaign type (Regular, API / Workflow Campaign, or All). Returns campaigns with template information and pagination metadata.Filter Options: "all" (default): Returns all campaigns regardless of type - includes both Regular campaigns and API / Workflow Campaigns mixed together. Use this when you want to see all your campaigns without any type-based filtering. "Regular": Returns only Regular type campaigns. These are traditional email campaigns created through the dashboard interface using Drag-&-Drop or Rich-Text builders. Regular campaigns are manually created and managed through the UI, and they can have different statuses like draft, scheduled, or live. "API / Workflow Campaign": Returns only API / Workflow Campaign type campaigns. These are campaigns created programmatically via API or integrated with workflows. They typically use HTML builder type, are automatically set to "live" status, and are designed for programmatic use and workflow integrations. Use this filter when you want to manage only API-created campaigns separately from Regular campaigns. Pagination: Default page size is 10 campaigns per page Maximum limit is 100 campaigns per page (automatically capped if exceeded) Page numbers start from 1 Response includes pagination metadata: totalCount, totalPages, hasNextPage, hasPrevPage Response Structure: Each campaign in the response includes complete campaign details (campaignName, senderName, subject, preheaderText), status, associated template information (name, htmlContent, builderType), and timestamps (createdAt, updatedAt). The response also includes pagination object with current page, limit, total count, total pages, and navigation flags. Query Parameters: **Query parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | page | integer | No | | | limit | integer | No | | | campaignType | string | No | | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Campaigns retrieved successfully", "data": { "campaigns": [ { "_id": "694eddfb5b445a55127ce174", "campaignDetails": { "campaignType": "Regular", "campaignName": "ff", "senderName": "fwef", "subject": "ef", "preheaderText": "dbfff" }, "status": "draft", "templateId": { "_id": "694eddfb5b445a55127ce172", "name": "sdds Copy", "builderType": "HTML", "htmlContent": "\n\n\n \n \n Email Template\n \n\n\n
\n
\n

Welcome to Our Newsletter!

\n

Stay updated with our latest news and offers

\n
\n \n
\n

Hello there!

\n

Thank you for subscribing to our newsletter. We're excited to share amazing content with you.

\n \n Get Started\n \n

What you can expect:

\n \n
\n \n
\n
\n

This email was sent to {email}

\n |\n
\n Unsubscribe\n |\n View in Browser \n
\n
\n

\n You are receiving this email because you have signed up on our website or subscribed to our email list.\n

\n
\n \"Google\n
\n
\n
\n\n" }, "createdAt": "2025-12-26T19:11:55.131Z", "updatedAt": "2025-12-26T19:11:55.131Z" } ], "pagination": { "page": 1, "limit": 10, "totalCount": 1, "totalPages": 1, "hasNextPage": false, "hasPrevPage": false } } } ``` #### GET /campaigns/{Campaign ID} — Get Campaign by ID Retrieves complete details of a specific campaign by its unique ID. Returns campaign information including template details, campaign details, status, and timestamps. Only returns campaigns belonging to your authenticated business. URL Parameters: **Example Response (200):** ```json { "success": true, "status": "success", "message": "Campaign fetched successfully", "data": { "_id": "694eddfb5b445a55127ce174", "userId": "682db2da6ef7e93a3eceb126", "businessId": "69398c24e90b87748e209d9b", "campaignDetails": { "campaignType": "Regular", "campaignName": "ff", "senderName": "fwef", "subject": "ef", "preheaderText": "dbfff" }, "campaignFolder": "Home", "status": "draft", "templateId": { "_id": "694eddfb5b445a55127ce172", "name": "sdds Copy", "builderType": "HTML", "htmlContent": "\n\n\n \n \n Email Template\n \n\n\n
\n
\n

Welcome to Our Newsletter!

\n

Stay updated with our latest news and offers

\n
\n \n
\n

Hello there!

\n

Thank you for subscribing to our newsletter. We're excited to share amazing content with you.

\n \n Get Started\n \n

What you can expect:

\n \n
\n \n
\n
\n

This email was sent to {email}

\n |\n
\n Unsubscribe\n |\n View in Browser \n
\n
\n

\n You are receiving this email because you have signed up on our website or subscribed to our email list.\n

\n
\n \"Google\n
\n
\n
\n\n" }, "sendDetails": { "deliveryServerRouting": false, "deliveryServerRoutingConfig": [] }, "recipientDetails": { "sentToIndividuals": [], "autoFollow": false, "includedList": [], "excludedList": [] }, "totalStats": { "sent": 0, "delivered": 0, "failed": 0, "queued": 0, "opened": 0, "uniqueOpens": 0, "clicked": 0, "unsubscribed": 0, "bounced": 0, "softBounced": 0, "hardBounced": 0 }, "linksStats": { "clicks": 0 }, "totalSubscribers": 0, "batchProcessing": { "currentListIndex": 0, "currentBatchSkip": 0, "batchSize": 10000, "isInitialized": false, "processedSubscribers": 0, "allSubscribersQueued": false, "totalUniqueEmails": 0, "completionRetryCount": 0, "validationMismatch": false, "forceCompleted": false }, "isDeleted": false, "deletedAt": null, "permanentDeleteAt": null, "countryStats": [], "deviceStats": [], "osStats": [], "createdAt": "2025-12-26T19:11:55.131Z", "updatedAt": "2025-12-26T19:11:55.131Z", "__v": 0 } } ``` #### POST /campaigns/send-to-individual — Send Campaign to Individual The token must be included in the Authorization header as a Bearer token. The campaign must exist and belong to your business. Sends a campaign to one or more individual email addresses using the campaign's template. This endpoint allows you to send personalized emails to specific recipients without requiring them to be in a subscriber list. The campaign template content is used, but you can optionally override the subject line. Emails are queued for sending asynchronously. Only campaigns with status "live" can be sent. All specified email addresses must be in a valid format. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | campaignId | string | No | | | emails | array | No | | | deliveryServerId | string | No | | | senderEmail | string | No | | | fromName | string | No | | | subject | string | No | | **Example Response (200):** ```json { "success": true, "status": "success", "message": "All emails queued successfully", "data": { "campaignId": "693a741cb1dd9aa1a3c770eb", "campaignName": "Sarah Mcgowan", "totalEmails": 1, "queued": 1, "message": "1 email(s) queued for sending" } } ``` #### POST /campaigns/send-to-list — Send Campaign to Lists The token must be included in the Authorization header as a Bearer token. The campaign must exist, belong to your business, and have a status of "live". The specified lists/segments must exist in your account. Sends a campaign to all active subscribers in one or more subscriber lists or segments using the campaign's template. Supports advanced filtering with included lists (required) and excluded lists (optional). Subscribers must have status "subscribed", not be deleted, and not be suppressed. The endpoint processes emails asynchronously in the background and returns immediately. Emails are queued in batches to handle large lists efficiently. Supports both regular subscriber lists and segments. Duplicate email addresses across multiple lists are automatically deduplicated. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | campaignId | string | No | | | includedList | array | No | | | excludedList | array | No | | | deliveryServerId | string | No | | | senderEmail | string | No | | | fromName | string | No | | | subject | string | No | | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Email sending initiated successfully", "data": { "campaignId": "693a741cb1dd9aa1a3c770eb", "campaignName": "Sarah Mcgowan", "includedList": [ "pem-dev" ], "excludedList": [], "totalSubscribers": 6, "message": "6 email(s) are being queued in the background. Processing may take a few minutes.", "note": "Emails are being processed asynchronously. Check campaign status for delivery updates." } } ``` ### Subscriber Lists #### GET /lists — Get All Subscriber Lists Retrieves all subscriber lists associated with your account. Returns list IDs, names, subscriber counts, and metadata for each list. Lists are sorted alphabetically by name. **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber lists retrieved successfully", "data": { "subscriberLists": [ { "id": "695ca9409a8ed4e65738c3b7", "name": "New User", "count": 1, "counts": { "totalSubscribers": 1, "unsubscribedCount": 0, "engagedCount": 0, "lastUpdated": "2026-01-06T09:50:35.504Z" }, "createdAt": "2026-01-06T06:18:40.487Z", "updatedAt": "2026-01-06T06:18:40.487Z" }, { "id": "695cdac06fa49c6ac63dca11", "name": "Pabbly Email Marketing ", "count": 0, "counts": { "totalSubscribers": 0, "unsubscribedCount": 0, "engagedCount": 0, "lastUpdated": "2026-01-06T09:50:35.511Z" }, "createdAt": "2026-01-06T09:49:52.925Z", "updatedAt": "2026-01-06T09:49:52.925Z" } ], "total": 2 } } ``` #### GET /lists/{{listId}} — Get Single Subscriber List by ID Retrieves a single subscriber list by its unique ID or name. The API automatically detects whether you're using a list ID or list name (via query parameter). Returns detailed information including subscriber counts and metadata. URL Parameters: **Path parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | listId | string | Yes | | **Example Response (200):** ```json { "success": true, "status": "success", "message": "List retrieved successfully", "data": { "list": { "id": "695ca9409a8ed4e65738c3b7", "name": "New User", "count": 1, "counts": { "totalSubscribers": 1, "unsubscribedCount": 0, "engagedCount": 0, "lastUpdated": "2026-01-06T09:50:35.504Z" }, "createdAt": "2026-01-06T06:18:40.487Z", "updatedAt": "2026-01-06T06:18:40.487Z" } } } ``` #### POST /lists/add-subscriber — Add Subscriber to Lists Adds an existing subscriber to one or more subscriber lists. You can identify the subscriber by email address or subscriber ID. The subscriber will be added to all valid lists provided. If the subscriber is already in a list, that list will be skipped. List counts are automatically updated. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | email | string | No | Email address of the subscriber (required if subscriberId is not provided) | | listIds | array | Yes | Array of list IDs to add the subscriber to (must contain at least one list ID) | | subscriberId | string | No | ID of the subscriber (required if email is not provided) | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber added to lists successfully", "data": { "subscriberId": "695ca95b9a8ed4e65738d1c5", "email": "s001gourav@gmail.com", "addedLists": [ "New User" ], "currentLists": [ "Pabbly Email Marketing", "New User" ] } } ``` #### POST /lists/remove-subscriber — Remove Subscriber from Lists Removes an existing subscriber from one or more subscriber lists. You can identify the subscriber by email address or subscriber ID. The subscriber will be removed from all valid lists provided. If the subscriber is not in a list, that list will be skipped. List counts are automatically updated. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | email | string | No | Email address of the subscriber (required if subscriberId is not provided) | | listIds | array | Yes | Array of list IDs to remove the subscriber from (must contain at least one list ID) | | subscriberId | string | No | ID of the subscriber (required if email is not provided) | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber removed from lists successfully", "data": { "subscriberId": "695ca95b9a8ed4e65738d1c5", "email": "s001gourav@gmail.com", "removedLists": [ "New User" ], "currentLists": [ "Pabbly Email Marketing" ] } } ``` #### POST /lists — Create Subscriber List Creates a new subscriber list in your account. The list name must be unique (case-insensitive) and cannot conflict with existing segment names. List name must be between 1 and 100 characters. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | name | string | Yes | The name of the subscriber list to create (1-100 characters) | **Example Response (201):** ```json { "success": true, "status": "success", "message": "Subscriber list created successfully", "data": { "list": { "id": "695ce285efb6f84c1a193d2a", "name": "Newsletter Subscribers", "count": 0, "counts": { "totalSubscribers": 0, "unsubscribedCount": 0, "engagedCount": 0, "lastUpdated": "2026-01-06T10:23:01.285Z" }, "createdAt": "2026-01-06T10:23:01.285Z", "updatedAt": "2026-01-06T10:23:01.285Z" } } } ``` #### GET /lists — Get Single Subscriber List by List Name Retrieves a single subscriber list by its name. The list name search is case-insensitive and will match the exact name (trimmed). Returns detailed information including subscriber counts and metadata. URL Parameters: **Query parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | listName | string | No | | **Example Response (200):** ```json { "success": true, "status": "success", "message": "List retrieved successfully", "data": { "list": { "id": "695ca9409a8ed4e65738c3b7", "name": "new", "count": 0, "counts": { "totalSubscribers": 0, "unsubscribedCount": 0, "engagedCount": 0, "lastUpdated": "2026-01-06T10:37:41.525Z" }, "createdAt": "2026-01-06T06:18:40.487Z", "updatedAt": "2026-01-06T06:18:40.487Z" } } } ``` #### POST /lists/move-subscriber — Move Subscriber Between Lists Moves an existing subscriber from one subscriber list to another. The subscriber will be removed from the source list and added to the target list. If the subscriber is already in the target list, they will only be removed from the source list. List counts are automatically updated for both lists. **Body parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | email | string | No | Email address of the subscriber (required if subscriberId is not provided) | | fromListId | string | Yes | ID of the source list to move subscriber from | | toListId | string | Yes | ID of the target list to move subscriber to | | subscriberId | string | No | ID of the subscriber (required if email is not provided) | **Example Response (200):** ```json { "success": true, "status": "success", "message": "Subscriber moved between lists successfully", "data": { "subscriberId": "695ca95b9a8ed4e65738d1c5", "email": "s001gourav@gmail.com", "movedFrom": "new", "movedTo": "cvbcbbc", "alreadyInToList": false, "currentLists": [ "Pabbly Email Marketing", "cvbcbbc" ] } } ``` #### GET /lists-and-segments — Get all Lists and Segments The token must be included in the Authorization header as a Bearer token. Retrieves a complete list of all subscriber lists and segments belonging to your authenticated business. Returns both lists and segments with their IDs, names, subscriber counts, and metadata. Lists and segments are sorted alphabetically by name (A-Z). This endpoint is useful for selecting target lists or segments when sending campaigns via the API. The response includes separate arrays for lists and segments, along with total counts for each type. **Example Response (200):** ```json { "success": true, "status": "success", "message": "Lists and segments retrieved successfully", "data": { "lists": [ { "id": "1024158", "name": "Default list", "type": "list", "count": 9156, "counts": { "totalSubscribers": 9156, "unsubscribedCount": 6, "engagedCount": 5, "lastUpdated": "2026-02-02T06:47:24.447Z" }, "createdAt": "2025-12-16T10:57:37.141Z", "updatedAt": "2025-12-16T10:57:37.141Z" }, { "id": "1024165", "name": "new demo", "type": "list", "count": 0, "counts": { "totalSubscribers": 0, "unsubscribedCount": 0, "engagedCount": 0, "lastUpdated": "2026-02-02T06:47:24.447Z" }, "createdAt": "2025-12-16T10:57:37.170Z", "updatedAt": "2025-12-16T10:57:37.170Z" }, { "id": "69412881c231c8db46a01b23", "name": "pem-dev", "type": "list", "count": 6, "counts": { "totalSubscribers": 6, "unsubscribedCount": 0, "engagedCount": 6, "lastUpdated": "2026-02-02T06:47:24.447Z" }, "createdAt": "2025-12-16T09:38:09.224Z", "updatedAt": "2025-12-16T09:38:09.224Z" }, { "id": "6965320222f445bcaacb5ef8", "name": "test-1", "type": "list", "count": 0, "counts": { "totalSubscribers": 0, "unsubscribedCount": 0, "engagedCount": 0, "lastUpdated": "2026-02-02T06:47:24.447Z" }, "createdAt": "2026-01-12T17:40:18.139Z", "updatedAt": "2026-01-12T17:40:18.139Z" } ], "segments": [ { "id": "6952345b2011e7f242a11836", "name": "test", "type": "segment", "conditions": [ [ { "filterBy": "Custom Field", "customField": "firstName", "filterType": "Contains", "value": "user", "_id": "695234652011e7f242a11a2a" } ] ], "createdAt": "2025-12-29T07:57:15.811Z", "updatedAt": "2026-01-13T07:35:42.766Z" }, { "id": "695255f52011e7f242adc8bf", "name": "test1", "type": "segment", "conditions": [ [ { "filterBy": "Custom Field", "customField": "email", "filterType": "Contains", "value": "user", "_id": "695256002011e7f242add121" } ] ], "createdAt": "2025-12-29T10:20:37.265Z", "updatedAt": "2026-01-13T07:35:42.765Z" } ], "totalLists": 4, "totalSegments": 2, "total": 6 } } ``` ### Delivery server #### GET /delivery-servers — Get Delivery Servers The token must be included in the Authorization header as a Bearer token. Retrieves a list of all active delivery servers belonging to your authenticated business. Only returns delivery servers with status "active". Supports search functionality to filter servers by server name, from email, or server type. Returns essential server information including server name, type, from email, verification status, and creation timestamp. Results are sorted by creation date (newest first). This endpoint is useful for selecting a delivery server when sending campaigns via the API. Query Parameters: **Example Response (200):** ```json { "success": true, "status": "success", "message": "Delivery servers fetched successfully", "data": [ { "_id": "696b3fd5b8426ea8d11c14f5", "serverName": "gmail", "serverType": "custom", "fromEmail": "tanish.mangal@pabbly.com", "status": "active", "verified": true, "createdAt": "2026-01-17T07:52:53.181Z" }, { "_id": "694fc94248ead5fec68f71bd", "serverName": "ethereal", "serverType": "custom", "fromEmail": "misael.homenick@ethereal.email", "status": "active", "verified": true, "createdAt": "2025-12-27T11:55:46.672Z" }, { "_id": "694a3c492be0f610781f9eb0", "serverName": "smtp", "serverType": "custom", "fromEmail": "tanish@pabbly.com", "status": "active", "verified": true, "createdAt": "2025-12-23T06:52:57.889Z" }, { "_id": "6942576598c9f014dc02f062", "serverName": "brevo", "serverType": "sendinblue", "fromEmail": "abemailmark@gmail.com", "status": "active", "verified": true, "createdAt": "2025-12-17T07:10:29.117Z" }, { "_id": "6939a325e90b87748e20a505", "serverName": "smtp-pool", "serverType": "custom", "fromEmail": "tanish@pabbly.com", "status": "active", "verified": true, "createdAt": "2025-12-10T16:43:17.230Z" } ] } ```