### GET Brands Source: https://sendy.co/api/index This endpoint retrieves a list of all brands (IDs and names) available in the Sendy installation. It requires an API key. ```APIDOC ## POST /api/brands/get-brands.php ### Description This method returns the full list of brands (ids and names) that exists in the Sendy installation. ### Method POST ### Endpoint http://your_sendy_installation/api/brands/get-brands.php ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - `api_key` (string) - Required - Your API key, available in Settings. ### Request Example { "api_key": "your_api_key" } ### Response #### Success Response (200) - JSON containing a list of brands (IDs and names). #### Response Example `You'll get a list of brands (ids and names) in JSON format` #### Error Responses - `No data passed` - `API key not passed` - `Invalid API key` - `No brands found` ``` -------------------------------- ### GET Lists Source: https://sendy.co/api/index This endpoint retrieves a list of all lists (IDs and names) associated with a specific brand. It requires an API key and brand ID, with an optional parameter to include hidden lists. ```APIDOC ## POST /api/lists/get-lists.php ### Description This method returns all lists (ids and names) from a particular brand. ### Method POST ### Endpoint http://your_sendy_installation/api/lists/get-lists.php ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - `api_key` (string) - Required - Your API key, available in Settings. - `brand_id` (string) - Required - The ID of the brand you want to get the list of lists from. Brand IDs can be found under 'Brands' page named ID. - `include_hidden` (string) - Optional - If you want to retrieve lists that are hidden as well, set this to `yes`. Default is `no`. ### Request Example { "api_key": "your_api_key", "brand_id": "brand_id", "include_hidden": "yes" } ### Response #### Success Response (200) - JSON containing a list of lists (IDs and names). #### Response Example `You'll get a list of lists (ids and names) in JSON format` #### Error Responses - `No data passed` - `API key not passed` - `Invalid API key` - `Brand ID not passed` - `Brand does not exist` - `No lists found` ``` -------------------------------- ### GET Active Subscriber Count Source: https://sendy.co/api/index This endpoint retrieves the total active subscriber count for a specified list. It requires an API key and the list ID. ```APIDOC ## POST /api/subscribers/active-subscriber-count.php ### Description This method gets the total active subscriber count of a list. ### Method POST ### Endpoint http://your_sendy_installation/api/subscribers/active-subscriber-count.php ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - `api_key` (string) - Required - Your API key, available in Settings. - `list_id` (string) - Required - The ID of the list you want to get the active subscriber count. This encrypted ID can be found under View all lists section named ID. ### Request Example { "api_key": "your_api_key", "list_id": "encrypted_list_id" } ### Response #### Success Response (200) - Plain text containing the active subscriber count (integer). #### Response Example `You'll get an integer of the active subscriber count` #### Error Responses - `No data passed` - `API key not passed` - `Invalid API key` - `List ID not passed` - `List does not exist` ``` -------------------------------- ### POST /api/campaigns/create.php Source: https://sendy.co/api/index This endpoint creates a new email campaign, optionally sends it immediately or schedules it for later. It requires an API key and various campaign details, with support for selecting lists or segments of recipients. A cron job must be configured in Sendy for sending or scheduling to function properly. ```APIDOC ## POST /api/campaigns/create.php ### Description This endpoint allows you to create a draft, send, or schedule an email campaign in Sendy. It supports specifying recipients via lists or segments, excluding certain groups, and configuring tracking options. Note that a cron job must be set up in Sendy for campaigns to be sent or scheduled via this API. ### Method POST ### Endpoint http://your_sendy_installation/api/campaigns/create.php ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **api_key** (string) - Required - Your API key from Sendy Settings. - **from_name** (string) - Required - The 'From name' of your campaign. - **from_email** (string) - Required - The 'From email' of your campaign. - **reply_to** (string) - Required - The 'Reply to' email of your campaign. - **title** (string) - Required - The 'Title' of your campaign. - **subject** (string) - Required - The 'Subject' of your campaign. - **plain_text** (string) - Optional - The plain text version of your campaign. - **html_text** (string) - Required - The HTML version of your campaign. - **list_ids** (string) - Required if send_campaign=1 and no segment_ids - Single or comma-separated list IDs (encrypted & hashed from View all lists). - **segment_ids** (string) - Required if send_campaign=1 and no list_ids - Single or comma-separated segment IDs from segments setup. - **exclude_list_ids** (string) - Optional - Single or comma-separated list IDs to exclude. - **exclude_segment_ids** (string) - Optional - Single or comma-separated segment IDs to exclude. - **brand_id** (string) - Required if creating a draft (send_campaign=0) - Brand ID from Brands page. - **query_string** (string) - Optional - e.g., Google Analytics tags. - **track_opens** (integer) - Optional - 0 to disable, 1 to enable, 2 for anonymous tracking (default: enabled). - **track_clicks** (integer) - Optional - 0 to disable, 1 to enable, 2 for anonymous tracking (default: enabled). - **send_campaign** (integer) - Optional - 1 to send immediately (default: 0 for draft). - **schedule_date_time** (string) - Optional - Date/time for scheduling, e.g., 'June 15, 2021 6:05pm' (minutes in 5-minute increments). - **schedule_timezone** (string) - Optional - Timezone, e.g., 'America/New_York' (uses default if empty; only for scheduling). ### Request Example { "api_key": "your_api_key", "from_name": "Sender Name", "from_email": "sender@example.com", "reply_to": "reply@example.com", "title": "Campaign Title", "subject": "Campaign Subject", "html_text": "Hello World", "list_ids": "list_id_1,list_id_2", "send_campaign": 1 } ### Response #### Success Response (200) - Plain text message indicating success, such as 'Campaign created', 'Campaign created and now sending', or 'Campaign scheduled'. #### Response Example Campaign created #### Error Responses - Plain text error messages, e.g., 'No data passed', 'API key not passed', 'Invalid API key', 'From name not passed', 'From email not passed', 'Reply to email not passed', 'Subject not passed', 'HTML not passed', 'List or segment ID(s) not passed', 'One or more list IDs are invalid', 'One or more segment IDs are invalid', 'List or segment IDs does not belong to a single brand', 'Brand ID not passed', 'Unable to create campaign', 'Unable to create and send campaign', 'Unable to schedule campaign', 'Unable to calculate totals'. ``` -------------------------------- ### POST /subscribe Source: https://sendy.co/api/index Adds a new subscriber to a list or updates an existing one. Supports custom fields, GDPR compliance, and bypassing double opt-in. ```APIDOC ## POST /subscribe ### Description This method adds a new subscriber to a list. You can also use this method to update an existing subscriber. On another note, you can also embed a subscribe form on your website using Sendy's subscribe form HTML code. ### Method POST ### Endpoint `http://your_sendy_installation/subscribe` ### Parameters #### POST Parameters - **api_key** (string) - Required - Your API key, available in Settings. - **name** (string) - Optional - User's name. - **email** (string) - Required - User's email. - **list** (string) - Required - The list ID you want to subscribe a user to. This encrypted & hashed ID can be found under **View all lists** section named **ID**. - **country** (string) - Optional - User's 2 letter country code. - **ipaddress** (string) - Optional - User's IP address. - **referrer** (string) - Optional - The URL where the user signed up from. - **gdpr** (boolean) - Optional - Set to "true" if you're signing up EU users in a GDPR compliant manner. - **silent** (boolean) - Optional - Set to "true" to bypass double opt-in and signup the user as 'Single Opt-in instead' for a 'Double opt-in' list. - **hp** (string) - Optional - Include this 'honeypot' field to prevent spambots from signing up via this API call. Supported in Sendy 3.0 onwards. - **boolean** (boolean) - Optional - Set this to "true" for a plain text response. *Note: You can also pass values into custom fields or update them. To do so, use the personalization tag of the custom field as the parameter. Say, your custom field tag is [Birthday,fallback=], you can use the parameter, 'Birthday' to add values to this custom field or update it.* ### Request Example ```json { "api_key": "YOUR_API_KEY", "name": "John Doe", "email": "john.doe@example.com", "list": "LIST_ID", "country": "US", "gdpr": "true" } ``` ### Response #### Success Response (Plain text) `true` #### Error Responses (Plain text) - `Some fields are missing.` - `API key not passed` - `Invalid API key` - `Invalid email address.` - `Already subscribed.` - `Bounced email address.` - `Email is suppressed.` - `Invalid list ID.` ``` -------------------------------- ### POST /api/subscribers/subscription-status.php Source: https://sendy.co/api/index Retrieves the current subscription status of a subscriber for a given list. ```APIDOC ## POST /api/subscribers/subscription-status.php ### Description This method gets the current status of a subscriber (eg. subscribed, unsubscribed, bounced, complained). ### Method POST ### Endpoint `http://your_sendy_installation/api/subscribers/subscription-status.php` ### Parameters #### POST Parameters - **api_key** (string) - Required - Your API key, available in Settings. - **email** (string) - Required - User's email. - **list_id** (string) - Required - The ID of the list this email belongs to. This encrypted ID can be found under **View all lists** section named **ID**. ### Request Example ```json { "api_key": "YOUR_API_KEY", "email": "john.doe@example.com", "list_id": "LIST_ID" } ``` ### Response #### Success Responses (Plain text) - `Subscribed` - `Unsubscribed` - `Unconfirmed` - `Bounced` - `Soft bounced` - `Complained` #### Error Responses (Plain text) - `No data passed` - `API key not passed` - `Invalid API key` - `Email not passed` - `List ID not passed` - `Email does not exist in list` ``` -------------------------------- ### POST /unsubscribe Source: https://sendy.co/api/index Unsubscribes a user from a specific list. ```APIDOC ## POST /unsubscribe ### Description This method unsubscribes a user from a list. ### Method POST ### Endpoint `http://your_sendy_installation/unsubscribe` ### Parameters #### POST Parameters - **email** (string) - Required - User's email. - **list** (string) - Required - The list ID you want to unsubscribe a user from. This encrypted & hashed ID can be found under **View all lists** section named **ID**. - **boolean** (boolean) - Optional - Set this to "true" so that you'll get a plain text response. ### Request Example ```json { "email": "john.doe@example.com", "list": "LIST_ID" } ``` ### Response #### Success Response (Plain text) `true` #### Error Responses (Plain text) - `Some fields are missing.` - `Invalid email address.` - `Email does not exist.` ``` -------------------------------- ### POST /api/subscribers/delete.php Source: https://sendy.co/api/index Deletes a subscriber from a list permanently. ```APIDOC ## POST /api/subscribers/delete.php ### Description This method deletes a subscriber off a list. ### Method POST ### Endpoint `http://your_sendy_installation/api/subscribers/delete.php` ### Parameters #### POST Parameters - **api_key** (string) - Required - Your API key, available in Settings. - **list_id** (string) - Required - The ID of the list you want to delete the subscriber from. This encrypted ID can be found under **View all lists** section named **ID**. - **email** (string) - Required - The email address you want to delete. ### Request Example ```json { "api_key": "YOUR_API_KEY", "list_id": "LIST_ID", "email": "john.doe@example.com" } ``` ### Response #### Success Response (Plain text) `true` #### Error Responses (Plain text) - `No data passed` - `API key not passed` - `Invalid API key` - `List ID not passed` - `List does not exist` - `Email address not passed` - `Subscriber does not exist` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.