{
 "openapi": "3.1.0",
 "info": {
  "title": "Mailercloud Marketing API",
  "version": "1.0.0",
  "description": "Campaigns, contacts, lists, segments, automations, and webhooks for the Mailercloud Marketing Platform."
 },
 "servers": [
  {
   "url": "https://cloudapi.mailercloud.com/v1"
  }
 ],
 "security": [
  {
   "apiKey": []
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "Authorization",
    "description": "Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings \u2192 API."
   }
  }
 },
 "paths": {
  "/campaign": {
   "post": {
    "summary": "Create Campaign",
    "operationId": "create-campaign",
    "description": "> A newer version of this endpoint with more options is available: [Create Campaign (v2)](/api-reference/campaigns/create-campaign-v2).\n\nAPI for creating an email campaign. For creating a campaign, HTML or plain text and list id or segment are mandatory.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "list_ids",
         "name",
         "sender",
         "subject"
        ],
        "properties": {
         "email_preheader": {
          "type": "string",
          "minLength": 1,
          "description": "Email preheader is the summary text that follows a subject line when the email is viewed in an inbox. In many cases, it\u2019s used to provide a short summary of the email, and is typically one sentence long.\n\nMinimum: 1\n\nMaximum: 150"
         },
         "html": {
          "type": "string",
          "minLength": 1,
          "description": "HTML template content for your email campaign."
         },
         "list_ids": {
          "type": "array",
          "description": "Recipients of your email campaign.",
          "items": {
           "type": "string",
           "description": "List of contact lists ids, to which you want to send your campaign. \n\nFormat: Array of strings."
          }
         },
         "mailing_preference": {
          "type": "boolean",
          "description": "true - Mailing preference option will be displayed in footer of email campaign template.\n\nfalse - Mailing preference option will not be dispalyed.",
          "default": true
         },
         "name": {
          "type": "string",
          "minLength": 1,
          "description": "Name of the campaign.\n\nMinimum: 1\n\nMaximum: 150"
         },
         "pause_rules": {
          "type": "object",
          "description": "Optional\n\nIf you want to set a rule for sending a campaign, use this option. Based on the configured rule, the campaign will be sent.",
          "required": [
           "pause_condition",
           "pause_criteria",
           "pause_limit",
           "pause_target",
           "wait_time"
          ],
          "properties": {
           "pause_condition": {
            "type": "string",
            "minLength": 1,
            "description": "Rule for setting open or click percentage greater than or less than pause target.\n\nSupported pause_condition - greater than, less than"
           },
           "pause_criteria": {
            "type": "string",
            "minLength": 1,
            "description": "Supported pause_criteria - open, click"
           },
           "pause_limit": {
            "type": "number",
            "description": "The percentage of list contacts to which we want to send campaigns first. In the order we set in rules.\n\nMinimum: 1\n\nMaximum: 50"
           },
           "pause_target": {
            "type": "number",
            "description": "Value  of open/click (in percentage) to be achieved.\n\nMinimum: 1\n\nMaximum: 100"
           },
           "wait_time": {
            "type": "number",
            "description": "After getting click rate or open rate grater than or less than pause limit , How many time we have to wait to send campaign to other contacts in the list.\n\nWait time in minutes .\n\nMinimum: 1\n\nMaximum: 43200"
           }
          }
         },
         "permission_reminder": {
          "type": "string",
          "minLength": 1,
          "description": "The email disclaimer content in your email campaign. If you want give unsubscribe link give %%unsubscribe%%\n\nMinimum: 1\n\nMaximum: 150"
         },
         "plain_text": {
          "type": "string",
          "minLength": 1,
          "description": "Plain text content of your email campaign."
         },
         "reply_email": {
          "type": "string",
          "minLength": 1,
          "description": "Email on which the campaign recipients will be able to reply to. If replay_email empty then sender email will be the reply email."
         },
         "report_spam": {
          "type": "boolean",
          "description": "Spam reporting enable or disable.",
          "default": true
         },
         "rules": {
          "type": "object",
          "properties": {
           "limit": {
            "type": "number",
            "description": "Count of subscribers in list to which campaign sends based on the contacts_order."
           },
           "contacts_order": {
            "type": "string",
            "description": "The order of contact list in which you want to send your email campaign.\n\nSupported: first,last"
           }
          }
         },
         "scheduled_at": {
          "type": "string",
          "minLength": 1,
          "description": "Schedule time for your email campaign. Pass your timezone date-time format for accurate results.\n\nFormat: 2021-04-23 15:04:05"
         },
         "segments": {
          "type": "string",
          "minLength": 1,
          "description": "Your recipient segment id."
         },
         "sender": {
          "type": "object",
          "required": [
           "sender_email",
           "sender_name"
          ],
          "properties": {
           "sender_email": {
            "type": "string",
            "minLength": 1,
            "description": "From email for your email campaign."
           },
           "sender_name": {
            "type": "string",
            "minLength": 1,
            "description": "From name for email campaign.\n\nMaximum: 100"
           }
          }
         },
         "subject": {
          "type": "string",
          "minLength": 1,
          "description": "Subject of the campaign.\n\nMinimum: 1\n\nMaximum: 150"
         },
         "viewin_browser": {
          "type": "boolean",
          "description": "true: Enable the \"View this email in your browser\"  in Campaign preview page.\n\nfalse: Disable the \"View this email in your browser\"  in Campaign preview page.",
          "default": true
         }
        }
       },
       "examples": {
        "example-1": {
         "value": {
          "html": "<html><body> Sample HTML  </body></html>",
          "list_ids": [
           "sCVJ",
           "ghy"
          ],
          "name": "Campaign name",
          "sender": {
           "sender_email": "sender@yourdomain.com",
           "sender_name": "Sender Name"
          },
          "scheduled_at": "2021-04-17 15:48:00",
          "subject": "Prime member notification."
         }
        },
        "example-2": {
         "value": {
          "email_preheader": "Prime member: You have an unused Prime benefit",
          "rules": {
           "contacts_order": "last",
           "limit": 5
          },
          "report_spam": false,
          "mailing_preference": false,
          "name": "Campaign name",
          "pause_rules": {
           "pause_limit": 1,
           "pause_criteria": "open",
           "pause_condition": "greater than",
           "pause_target": 1,
           "wait_time": 10
          },
          "permission_reminder": "If you wish to opt out of all type of emails, click Unsubscribe. ",
          "plain_text": "plain text",
          "reply_email": "sender@yourdomain.com",
          "sender": {
           "sender_email": "sender@yourdomain.com",
           "sender_name": "Sender Name"
          },
          "segments": "hju",
          "subject": "Prime member notification.",
          "viewin_browser": false
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {}
        },
        "examples": {
         "example-1": {
          "value": {
           "id": "hdjh"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "sender_email",
             "message": "sender_email  must be a valid email address"
            },
            {
             "field": "reply_email",
             "message": "reply_email  must be a valid email address"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/save": {
   "post": {
    "summary": "Create Campaign (v2)",
    "operationId": "create-campaign-v2",
    "description": "**The newer version of Create Campaign with additional options \u2014 prefer this endpoint for new integrations.**\n\n**Required:** `name`, `subject`, and `sender` (with `sender_name` + `sender_email`). **Content:** provide `html` or `plain_text`. **Audience:** provide at least one of `list_ids`, `segments`, or `tag_ids`.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "email_preheader": {
          "type": "string"
         },
         "exclude_list_ids": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "exclude_segments": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "exclude_tag_ids": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "frequency_cap": {
          "type": "string"
         },
         "html": {
          "type": "string"
         },
         "is_publish": {
          "type": "string",
          "enum": [
           "0",
           "1"
          ],
          "description": "`\"1\"` publishes/schedules the campaign; `\"0\"` saves it as a draft."
         },
         "list_ids": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "mailing_preference": {
          "type": "boolean"
         },
         "name": {
          "type": "string",
          "maxLength": 150,
          "minLength": 1
         },
         "pause_rules": {
          "type": "object",
          "properties": {
           "pause_condition": {
            "type": "string",
            "enum": [
             "greater than",
             "less than"
            ]
           },
           "pause_criteria": {
            "type": "string",
            "enum": [
             "open",
             "click"
            ]
           },
           "pause_limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
           },
           "pause_target": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
           },
           "wait_time": {
            "type": "integer",
            "minimum": 1,
            "maximum": 43200,
            "description": "Minutes to wait before evaluating pause rules (max 30 days)."
           }
          }
         },
         "permission_reminder": {
          "type": "string"
         },
         "plain_text": {
          "type": "string"
         },
         "reply_email": {
          "type": "string"
         },
         "reply_id": {
          "type": "string"
         },
         "report_spam": {
          "type": "boolean"
         },
         "rules": {
          "type": "object",
          "properties": {
           "contacts_order": {
            "type": "string",
            "enum": [
             "first",
             "last"
            ]
           },
           "limit": {
            "type": "integer"
           }
          }
         },
         "scheduled_at": {
          "type": "string",
          "description": "Schedule time in `YYYY-MM-DD HH:MM:SS` format. Omit to send according to `is_publish`."
         },
         "segments": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "sender": {
          "type": "object",
          "properties": {
           "sender_email": {
            "type": "string",
            "format": "email"
           },
           "sender_name": {
            "type": "string",
            "maxLength": 100
           }
          },
          "required": [
           "sender_name",
           "sender_email"
          ]
         },
         "sender_id": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "subject": {
          "type": "string",
          "maxLength": 65000,
          "minLength": 1
         },
         "tag_id": {
          "type": "string"
         },
         "tag_ids": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "tag_name": {
          "type": "string"
         }
        },
        "x-examples": {
         "Example 1": {
          "email_preheader": "string",
          "exclude_list_ids": [
           "string"
          ],
          "exclude_segments": [
           "string"
          ],
          "exclude_tag_ids": [
           "string"
          ],
          "frequency_cap": "string",
          "html": "string",
          "is_publish": "string",
          "list_ids": [
           "string"
          ],
          "mailing_preference": true,
          "name": "string",
          "pause_rules": {
           "pause_condition": "string",
           "pause_criteria": "string",
           "pause_limit": 0,
           "pause_target": 0,
           "wait_time": 0
          },
          "permission_reminder": "string",
          "plain_text": "string",
          "reply_email": "string",
          "reply_id": "string",
          "report_spam": true,
          "rules": {
           "contacts_order": "string",
           "limit": 0
          },
          "scheduled_at": "string",
          "segments": [
           "string"
          ],
          "sender": {
           "sender_email": "string",
           "sender_name": "string"
          },
          "sender_id": [
           "string"
          ],
          "subject": "string",
          "tag_id": "string",
          "tag_ids": [
           "string"
          ],
          "tag_name": "string"
         }
        },
        "required": [
         "name",
         "subject",
         "sender"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "email_preheader": "Prime member: You have an unused Prime benefit",
          "exclude_list_ids": [
           "123",
           "456"
          ],
          "exclude_segments": [
           "segment1",
           "segment2"
          ],
          "exclude_tag_ids": [
           "tag1",
           "tag2"
          ],
          "frequency_cap": "daily",
          "html": "<html><body>Sample HTML</body></html>",
          "is_publish": "1",
          "list_ids": [
           "sCVJ",
           "ghy"
          ],
          "mailing_preference": true,
          "name": "Campaign name",
          "pause_rules": {
           "pause_condition": "greater than",
           "pause_criteria": "open",
           "pause_limit": 1,
           "pause_target": 1,
           "wait_time": 10
          },
          "permission_reminder": "If you wish to opt out of all types of emails, click Unsubscribe.",
          "plain_text": "Plain text content",
          "reply_email": "sender@yourdomain.com",
          "reply_id": "reply-id-1",
          "report_spam": false,
          "rules": {
           "contacts_order": "last",
           "limit": 5
          },
          "scheduled_at": "2021-04-17 15:48:00",
          "segments": [
           "hju"
          ],
          "sender": {
           "sender_email": "sender@yourdomain.com",
           "sender_name": "Sender Name"
          },
          "sender_id": [
           "sender-123"
          ],
          "subject": "Prime member notification.",
          "tag_id": "prime-tag",
          "tag_ids": [
           "tag-123",
           "tag-456"
          ],
          "tag_name": "Prime Campaign Tag"
         }
        },
        "example-2": {
         "value": {
          "email_preheader": "Your weekly newsletter is here!",
          "exclude_list_ids": [
           "exclude-list-1"
          ],
          "exclude_segments": [
           "exclude-segment-1"
          ],
          "exclude_tag_ids": [
           "exclude-tag-1"
          ],
          "frequency_cap": "weekly",
          "html": "<html><body>Weekly newsletter content</body></html>",
          "is_publish": "0",
          "list_ids": [
           "list1",
           "list2"
          ],
          "mailing_preference": false,
          "name": "Weekly Newsletter",
          "pause_rules": {
           "pause_condition": "less than",
           "pause_criteria": "click",
           "pause_limit": 3,
           "pause_target": 2,
           "wait_time": 20
          },
          "permission_reminder": "You are receiving this email because you subscribed to our newsletter.",
          "plain_text": "Plain text newsletter content",
          "reply_email": "newsletter@yourdomain.com",
          "reply_id": "reply-id-2",
          "report_spam": true,
          "rules": {
           "contacts_order": "first",
           "limit": 10
          },
          "scheduled_at": "2022-01-10 10:00:00",
          "segments": [
           "segment1",
           "segment2"
          ],
          "sender": {
           "sender_email": "newsletter@yourdomain.com",
           "sender_name": "MailerCloud Team"
          },
          "sender_id": [
           "sender-456"
          ],
          "subject": "Weekly Newsletter",
          "tag_id": "newsletter-tag",
          "tag_ids": [
           "tag-789",
           "tag-101"
          ],
          "tag_name": "Newsletter Tag"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "{\n  \"id\": \"a\"\n}",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string",
           "description": "ID of the created campaign."
          }
         }
        },
        "examples": {
         "created": {
          "value": {
           "id": "aBc12"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "sender_email",
             "message": "sender_email  must be a valid email address"
            },
            {
             "field": "reply_email",
             "message": "reply_email  must be a valid email address"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    },
    "servers": [
     {
      "url": "https://cloudapi.mailercloud.com/v2"
     }
    ]
   }
  },
  "/campaign/domain/report/{id}": {
   "post": {
    "summary": "Campaign Domain Report",
    "operationId": "get-statistics-for-the-top-performing-email-domains-in-a-campaign",
    "description": "This report contains statistics for the top-performing email domains in a campaign. The domains report allows you to break down your customers into groups according to their mailbox service provider.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Campaign id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "application/json",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return.\n\nMaximum: 100 Minimum: 10"
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1"
         },
         "sort_field": {
          "type": "string",
          "minLength": 1,
          "description": "Sort list data based on this field\n\nAvailable sort fields\n\ndomain,sent,soft_bounce,hard_bounce,opens,\nclicks,unsubscribe,abuse,spam_complaints"
         },
         "sort_order": {
          "type": "string",
          "minLength": 1,
          "description": "Sorting order for sort field\n\nAvailable sort orders\n\nasc, ASC, desc, DESC"
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 10,
          "page": 1,
          "sort_field": "sent",
          "sort_order": "asc"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number"
          },
          "data": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "abuse": {
              "type": "number"
             },
             "abuse_pct": {
              "type": "string",
              "minLength": 1
             },
             "clicks": {
              "type": "number"
             },
             "clicks_pct": {
              "type": "string",
              "minLength": 1
             },
             "domain": {
              "type": "string",
              "minLength": 1
             },
             "hard_bounce": {
              "type": "number"
             },
             "hard_bounce_pct": {
              "type": "string",
              "minLength": 1
             },
             "opens": {
              "type": "number"
             },
             "opens_pct": {
              "type": "string",
              "minLength": 1
             },
             "sent": {
              "type": "number"
             },
             "sent_pct": {
              "type": "string",
              "minLength": 1
             },
             "soft_bounce": {
              "type": "number"
             },
             "soft_bounce_pct": {
              "type": "string",
              "minLength": 1
             },
             "spam_complaints": {
              "type": "number"
             },
             "spam_complaints_pct": {
              "type": "string",
              "minLength": 1
             },
             "unsubscribe": {
              "type": "number"
             },
             "unsubscribe_pct": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          },
          "name": {
           "type": "string",
           "minLength": 1
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 1,
           "data": [
            {
             "abuse": 0,
             "abuse_pct": "0.00",
             "clicks": 0,
             "clicks_pct": "0.00",
             "domain": "bulk.regalwork.com",
             "hard_bounce": 0,
             "hard_bounce_pct": "0.00",
             "opens": 15548,
             "opens_pct": "15.54",
             "sent": 100000,
             "sent_pct": "100.00",
             "soft_bounce": 0,
             "soft_bounce_pct": "0.00",
             "spam_complaints": 0,
             "spam_complaints_pct": "0.00",
             "unsubscribe": 307,
             "unsubscribe_pct": "1.97"
            }
           ],
           "name": "Campaign name"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "sort_order",
            "message": "Invalid sort_order"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/list": {
   "post": {
    "summary": "Campaign List",
    "operationId": "campaign-list",
    "description": "Get the details of all the campaigns you have created.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "application/json",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "date_from": {
          "type": "string",
          "minLength": 1,
          "description": "When the campaign type is a draft or duplicate, date_from checks modified date; otherwise, date_from checks your scheduled date.\n\nFormat Y-m-d."
         },
         "date_to": {
          "type": "string",
          "minLength": 1,
          "description": "When the campaign type is a draft or duplicate, date_to checks modified date; otherwise, date_to checks your scheduled date.\n\nFormat Y-m-d."
         },
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return.\n\nMaximum: 100 Minimum: 10"
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1"
         },
         "search": {
          "type": "string",
          "minLength": 1,
          "description": "Filter campaign list by campaign name"
         },
         "sender_email": {
          "type": "string",
          "minLength": 1,
          "description": "Filter campaign list by sender email."
         },
         "sort_field": {
          "type": "string",
          "minLength": 1,
          "description": "Sort list data based on the following field.\n\nAvailable sort fields\nname,schedule_date,open_percentage,\nmodified_date,clicks,opens,sent,unsubscribe"
         },
         "sort_order": {
          "type": "string",
          "minLength": 1,
          "description": "Sorting order for sort field\n\nAvailable sort orders\n\nasc, ASC, desc, DESC "
         },
         "status": {
          "type": "string",
          "minLength": 1,
          "description": "Filter campaign list by campaign status\n\nAvailable statuses\n\nProcessing,Queued,Sending,Paused,Finished,\nAborted,Duplicate,Draft,Scheduled,Rescheduled,Failed\n"
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "date_from": "2021-03-01",
          "date_to": "2021-04-30",
          "limit": 10,
          "page": 1,
          "search": "",
          "sender_email": "",
          "sort_field": "name",
          "sort_order": "asc",
          "status": ""
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "count": {
              "type": "number"
             }
            }
           }
          },
          "data": {
           "type": "object",
           "properties": {
            "0": {
             "type": "object",
             "properties": {
              "blacklisted_domains": {
               "type": "object"
              },
              "broken_links": {
               "type": "object"
              },
              "conversion_tracking": {
               "type": "object"
              },
              "created_date": {
               "type": "string",
               "minLength": 1
              },
              "email_preheader": {
               "type": "string",
               "minLength": 1
              },
              "finish_date": {
               "type": "string",
               "minLength": 1
              },
              "html": {
               "type": "string"
              },
              "modified_date": {
               "type": "string",
               "minLength": 1
              },
              "name": {
               "type": "string",
               "minLength": 1
              },
              "pause_rules": {
               "type": "object"
              },
              "permission_reminder": {
               "type": "string"
              },
              "plain_text": {
               "type": "string"
              },
              "recepiant": {
               "type": "object",
               "properties": {
                "lists": {
                 "type": "string",
                 "minLength": 1
                },
                "lists_contact_count": {
                 "type": "number"
                },
                "segments": {
                 "type": "string"
                },
                "segments_contact_count": {
                 "type": "number"
                },
                "total_lists": {
                 "type": "number"
                }
               }
              },
              "reply_email": {
               "type": "string",
               "minLength": 1
              },
              "report_abuse": {
               "type": "boolean"
              },
              "report_summary": {
               "type": "object",
               "properties": {
                "abuse": {
                 "type": "number"
                },
                "abuse_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "clicks": {
                 "type": "number"
                },
                "clicks_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "conversions": {
                 "type": "number"
                },
                "conversions_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "delivered": {
                 "type": "number"
                },
                "delivered_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "hard_bounce": {
                 "type": "number"
                },
                "hard_bounce_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "open_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "opens": {
                 "type": "number"
                },
                "queue": {
                 "type": "number"
                },
                "queue_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "queued_total": {
                 "type": "number"
                },
                "sent": {
                 "type": "number"
                },
                "sent_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "soft_bounce": {
                 "type": "number"
                },
                "soft_bounce_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "spam_complaints_count": {
                 "type": "number"
                },
                "spam_complaints_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "unsubscribe": {
                 "type": "number"
                },
                "unsubscribe_percentage": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "rule": {
               "type": "object",
               "properties": {
                "contacts_order": {
                 "type": "string",
                 "minLength": 1
                },
                "limit": {
                 "type": "string"
                }
               }
              },
              "scheduled_date": {
               "type": "object",
               "properties": {
                "date": {
                 "type": "string",
                 "minLength": 1
                },
                "timezone": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "sender": {
               "type": "object",
               "properties": {
                "sender_email": {
                 "type": "string",
                 "minLength": 1
                },
                "sender_name": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "start_date": {
               "type": "string",
               "minLength": 1
              },
              "status": {
               "type": "string",
               "minLength": 1
              },
              "status_change_date": {
               "type": "string",
               "minLength": 1
              },
              "status_change_message": {
               "type": "string"
              },
              "subject": {
               "type": "string",
               "minLength": 1
              },
              "tag": {
               "type": "string",
               "minLength": 1
              },
              "time_rule": {
               "type": "object"
              },
              "type": {
               "type": "string",
               "minLength": 1
              }
             }
            },
            "1": {
             "type": "object",
             "properties": {
              "blacklisted_domains": {
               "type": "object"
              },
              "broken_links": {
               "type": "object"
              },
              "conversion_tracking": {
               "type": "object"
              },
              "created_date": {
               "type": "string",
               "minLength": 1
              },
              "email_preheader": {
               "type": "string",
               "minLength": 1
              },
              "finish_date": {
               "type": "string",
               "minLength": 1
              },
              "html": {
               "type": "string"
              },
              "modified_date": {
               "type": "string",
               "minLength": 1
              },
              "name": {
               "type": "string",
               "minLength": 1
              },
              "pause_rules": {
               "type": "object"
              },
              "permission_reminder": {
               "type": "string"
              },
              "plain_text": {
               "type": "string"
              },
              "recepiant": {
               "type": "object",
               "properties": {
                "lists": {
                 "type": "string",
                 "minLength": 1
                },
                "lists_contact_count": {
                 "type": "number"
                },
                "segments": {
                 "type": "string"
                },
                "segments_contact_count": {
                 "type": "number"
                },
                "total_lists": {
                 "type": "number"
                }
               }
              },
              "reply_email": {
               "type": "string",
               "minLength": 1
              },
              "report_abuse": {
               "type": "boolean"
              },
              "report_summary": {
               "type": "object",
               "properties": {
                "abuse": {
                 "type": "number"
                },
                "abuse_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "clicks": {
                 "type": "number"
                },
                "clicks_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "conversions": {
                 "type": "number"
                },
                "conversions_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "delivered": {
                 "type": "number"
                },
                "delivered_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "hard_bounce": {
                 "type": "number"
                },
                "hard_bounce_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "open_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "opens": {
                 "type": "number"
                },
                "queue": {
                 "type": "number"
                },
                "queue_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "queued_total": {
                 "type": "number"
                },
                "sent": {
                 "type": "number"
                },
                "sent_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "soft_bounce": {
                 "type": "number"
                },
                "soft_bounce_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "spam_complaints_count": {
                 "type": "number"
                },
                "spam_complaints_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "unsubscribe": {
                 "type": "number"
                },
                "unsubscribe_percentage": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "rule": {
               "type": "object",
               "properties": {
                "contacts_order": {
                 "type": "string",
                 "minLength": 1
                },
                "limit": {
                 "type": "string"
                }
               }
              },
              "scheduled_date": {
               "type": "object",
               "properties": {
                "date": {
                 "type": "string",
                 "minLength": 1
                },
                "timezone": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "sender": {
               "type": "object",
               "properties": {
                "sender_email": {
                 "type": "string",
                 "minLength": 1
                },
                "sender_name": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "start_date": {
               "type": "string",
               "minLength": 1
              },
              "status": {
               "type": "string",
               "minLength": 1
              },
              "status_change_date": {
               "type": "string",
               "minLength": 1
              },
              "status_change_message": {
               "type": "string"
              },
              "subject": {
               "type": "string",
               "minLength": 1
              },
              "tag": {
               "type": "string",
               "minLength": 1
              },
              "time_rule": {
               "type": "object"
              },
              "type": {
               "type": "string",
               "minLength": 1
              }
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "count": [
            {
             "count": 2
            }
           ],
           "data": {
            "0": {
             "blacklisted_domains": {},
             "broken_links": {},
             "conversion_tracking": {},
             "created_date": "2021-04-27 11:31:04",
             "email_preheader": "Save more on your Home & Kitchen shopping",
             "finish_date": "2021-04-27 15:07:02",
             "html": "",
             "id": "BBBghIFI",
             "modified_date": "2021-04-27 11:44:15",
             "name": "Offer Of The Day",
             "pause_rules": {},
             "permission_reminder": "",
             "plain_text": "",
             "recepiant": {
              "lists": "Subscriber list",
              "lists_contact_count": 100000,
              "segments": "",
              "segments_contact_count": 0,
              "total_lists": 1
             },
             "reply_email": "sender@yourdomain.com",
             "report_abuse": true,
             "report_summary": {
              "abuse": 0,
              "abuse_percentage": "0.00",
              "clicks": 0,
              "clicks_percentage": "0.00",
              "conversions": 0,
              "conversions_percentage": "0.00",
              "delivered": 100000,
              "delivered_percentage": "100.00",
              "hard_bounce": 0,
              "hard_bounce_percentage": "0.00",
              "open_percentage": "15.55",
              "opens": 15548,
              "queue": 0,
              "queue_percentage": "0.00",
              "queued_total": 100000,
              "sent": 100000,
              "sent_percentage": "100.00",
              "soft_bounce": 0,
              "soft_bounce_percentage": "0.00",
              "spam_complaints_count": 0,
              "spam_complaints_percentage": "0.00",
              "unsubscribe": 307,
              "unsubscribe_percentage": "1.97"
             },
             "rule": {
              "contacts_order": "first",
              "limit": ""
             },
             "scheduled_date": {
              "date": "2021-04-27 17:14:15",
              "timezone": "Asia/Kolkata"
             },
             "sender": {
              "sender_email": "sender@yourdomain.com",
              "sender_name": "Sender Name Shan"
             },
             "start_date": "2021-04-27 11:47:04",
             "status": "Finished",
             "status_change_date": "2021-04-27 15:07:02",
             "status_change_message": "",
             "subject": "Amazon offers",
             "tag": "Amazon offers",
             "time_rule": {},
             "type": "Normal campaign"
            },
            "1": {
             "blacklisted_domains": {},
             "broken_links": {},
             "conversion_tracking": {},
             "created_date": "2021-04-27 11:31:04",
             "email_preheader": "How To Make Veg Pizza",
             "finish_date": "2021-04-27 15:07:02",
             "html": "",
             "id": "BBBghIFI",
             "modified_date": "2021-04-27 11:44:15",
             "name": "Offer Of The Day",
             "pause_rules": {},
             "permission_reminder": "",
             "plain_text": "",
             "recepiant": {
              "lists": "newsletter subscriber list",
              "lists_contact_count": 100000,
              "segments": "",
              "segments_contact_count": 0,
              "total_lists": 1
             },
             "reply_email": "sender@yourdomain.com",
             "report_abuse": true,
             "report_summary": {
              "abuse": 0,
              "abuse_percentage": "0.00",
              "clicks": 0,
              "clicks_percentage": "0.00",
              "conversions": 0,
              "conversions_percentage": "0.00",
              "delivered": 100000,
              "delivered_percentage": "100.00",
              "hard_bounce": 0,
              "hard_bounce_percentage": "0.00",
              "open_percentage": "15.55",
              "opens": 15548,
              "queue": 0,
              "queue_percentage": "0.00",
              "queued_total": 100000,
              "sent": 100000,
              "sent_percentage": "100.00",
              "soft_bounce": 0,
              "soft_bounce_percentage": "0.00",
              "spam_complaints_count": 0,
              "spam_complaints_percentage": "0.00",
              "unsubscribe": 307,
              "unsubscribe_percentage": "1.97"
             },
             "rule": {
              "contacts_order": "first",
              "limit": ""
             },
             "scheduled_date": {
              "date": "2021-04-27 17:14:15",
              "timezone": "Asia/Kolkata"
             },
             "sender": {
              "sender_email": "sender@yourdomain.com",
              "sender_name": "Sender Name Shan"
             },
             "start_date": "2021-04-27 11:47:04",
             "status": "Finished",
             "status_change_date": "2021-04-27 15:07:02",
             "status_change_message": "",
             "subject": "Pizza",
             "tag": "Pizz noodles",
             "time_rule": {},
             "type": "Normal campaign"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "sort_order",
            "message": "Invalid sort_order"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/testmail-groups/list": {
   "post": {
    "summary": "Testmail Group List",
    "operationId": "testmail-group-list",
    "description": "Get the details of all the testmail groups you have created.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "application/json",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "search": {
          "type": "string"
         }
        },
        "x-examples": {
         "Example 1": {
          "search": "dkjdkjdkjdss"
         }
        }
       },
       "examples": {
        "example-1": {
         "value": {
          "search": "group_name/email"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "emails": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "group_name": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "data": [
            {
             "emails": [
              "test@vinmail.io",
              "hii@vinmail.io",
              "bii@vinmail.io",
              "sdjfhjk@vinmail.io",
              "nii@vinmail.io",
              "live@vinmail.io"
             ],
             "group_name": "Most"
            },
            {
             "emails": [
              "test@vinmail.io",
              "hii@vinmail.io",
              "bii@vinmail.io",
              "sdjfhjk@vinmail.io"
             ],
             "group_name": "Name"
            },
            {
             "emails": [
              "test@vinmail.io",
              "hii@vinmail.io",
              "bii@vinmail.io"
             ],
             "group_name": "Group"
            },
            {
             "emails": [
              "test@vinmail.io",
              "hii@vinmail.io"
             ],
             "group_name": "New"
            },
            {
             "emails": [
              "test@vinmail.io"
             ],
             "group_name": "Test"
            },
            {
             "emails": [
              "test@vinmail.io"
             ],
             "group_name": "dkjdkjdkjdss"
            }
           ]
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "data": [
            {
             "emails": [
              "sender@yourdomain.com",
              "jacobwilson@gmail.com",
              "harrybrook@yahoo.com"
             ],
             "group_name": "Demo Group",
             "id": "SS"
            },
            {
             "emails": [
              "sender@yourdomain.com"
             ],
             "group_name": "Demo",
             "id": "SK"
            }
           ]
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "-",
            "message": "Invalid input"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/schedule/{id}": {
   "post": {
    "summary": "Schedule Campaign",
    "operationId": "schedule-campaign",
    "description": "API for scheduling campaign. If the schedule_at  is not given, the campaign will schedule for the current time.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Campaign Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "application/json",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "scheduled_at": {
          "type": "string",
          "minLength": 1,
          "description": "Schedule time for your email campaign. Pass your timezone date-time format for accurate results.\n\nFormat: 2021-04-23 15:04:05"
         }
        }
       },
       "examples": {
        "example-1": {
         "value": {
          "scheduled_at": "2021-04-17 15:48:00"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "message": "Campaign has been scheduled"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "scheduled_at",
             "message": "scheduled_at does not match the YYYY-MM-DD hh:mm:ss format"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/testmail/{id}": {
   "post": {
    "summary": "Send a Test Email",
    "operationId": "send-a-test-email",
    "description": "Send a test email.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Campaign Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "application/json",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "email": {
          "type": "string"
         },
         "testmail_group": {
          "type": "string"
         }
        },
        "x-examples": {
         "Example 1": {
          "email": "qa1@vinmail.io",
          "testmail_group": "dkjdkjdkjdss"
         }
        }
       },
       "examples": {
        "example-1": {
         "value": {
          "email": "sender@yourdomain.com",
          "testmail_group": "group_name/group_id"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "message": {
           "type": "string",
           "minLength": 1
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "message": "Test mail was successfully sent"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "email",
             "message": "Email must be a valid email address"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "id",
            "message": "Record not found with the given Id"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/{id}": {
   "get": {
    "summary": "Get Single Campaign Details",
    "operationId": "get-single-campaign-details",
    "description": "Get the details of a single campaign.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Campaign Id",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Ok",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "0": {
             "type": "object",
             "properties": {
              "blacklisted_domains": {
               "type": "object"
              },
              "broken_links": {
               "type": "object"
              },
              "conversion_tracking": {
               "type": "object"
              },
              "created_date": {
               "type": "string",
               "minLength": 1
              },
              "email_preheader": {
               "type": "string",
               "minLength": 1
              },
              "finish_date": {
               "type": "string",
               "minLength": 1
              },
              "html": {
               "type": "string"
              },
              "modified_date": {
               "type": "string",
               "minLength": 1
              },
              "name": {
               "type": "string",
               "minLength": 1
              },
              "pause_rules": {
               "type": "object"
              },
              "permission_reminder": {
               "type": "string"
              },
              "plain_text": {
               "type": "string"
              },
              "recepiant": {
               "type": "object",
               "properties": {
                "lists": {
                 "type": "string",
                 "minLength": 1
                },
                "lists_contact_count": {
                 "type": "number"
                },
                "segments": {
                 "type": "string"
                },
                "segments_contact_count": {
                 "type": "number"
                },
                "total_lists": {
                 "type": "number"
                }
               }
              },
              "reply_email": {
               "type": "string",
               "minLength": 1
              },
              "report_abuse": {
               "type": "boolean"
              },
              "report_summary": {
               "type": "object",
               "properties": {
                "abuse": {
                 "type": "number"
                },
                "abuse_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "clicks": {
                 "type": "number"
                },
                "clicks_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "conversions": {
                 "type": "number"
                },
                "conversions_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "delivered": {
                 "type": "number"
                },
                "delivered_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "hard_bounce": {
                 "type": "number"
                },
                "hard_bounce_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "open_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "opens": {
                 "type": "number"
                },
                "queue": {
                 "type": "number"
                },
                "queue_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "queued_total": {
                 "type": "number"
                },
                "sent": {
                 "type": "number"
                },
                "sent_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "soft_bounce": {
                 "type": "number"
                },
                "soft_bounce_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "spam_complaints_count": {
                 "type": "number"
                },
                "spam_complaints_percentage": {
                 "type": "string",
                 "minLength": 1
                },
                "unsubscribe": {
                 "type": "number"
                },
                "unsubscribe_percentage": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "rule": {
               "type": "object",
               "properties": {
                "contacts_order": {
                 "type": "string",
                 "minLength": 1
                },
                "limit": {
                 "type": "string"
                }
               }
              },
              "scheduled_date": {
               "type": "object",
               "properties": {
                "date": {
                 "type": "string",
                 "minLength": 1
                },
                "timezone": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "sender": {
               "type": "object",
               "properties": {
                "sender_email": {
                 "type": "string",
                 "minLength": 1
                },
                "sender_name": {
                 "type": "string",
                 "minLength": 1
                }
               }
              },
              "start_date": {
               "type": "string",
               "minLength": 1
              },
              "status": {
               "type": "string",
               "minLength": 1
              },
              "status_change_date": {
               "type": "string",
               "minLength": 1
              },
              "status_change_message": {
               "type": "string"
              },
              "subject": {
               "type": "string",
               "minLength": 1
              },
              "tag": {
               "type": "string",
               "minLength": 1
              },
              "time_rule": {
               "type": "object"
              },
              "type": {
               "type": "string",
               "minLength": 1
              }
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "data": {
            "0": {
             "blacklisted_domains": {},
             "broken_links": {},
             "conversion_tracking": {},
             "created_date": "2021-04-27 11:31:04",
             "email_preheader": "Save more on your Home & Kitchen shopping",
             "finish_date": "2021-04-27 15:07:02",
             "html": "",
             "id": "BBBghIFI",
             "modified_date": "2021-04-27 11:44:15",
             "name": "Offer Of The Day",
             "pause_rules": {},
             "permission_reminder": "",
             "plain_text": "",
             "recepiant": {
              "lists": "Subscriber list",
              "lists_contact_count": 100000,
              "segments": "",
              "segments_contact_count": 0,
              "total_lists": 1
             },
             "reply_email": "sender@yourdomain.com",
             "report_abuse": true,
             "report_summary": {
              "abuse": 0,
              "abuse_percentage": "0.00",
              "clicks": 0,
              "clicks_percentage": "0.00",
              "conversions": 0,
              "conversions_percentage": "0.00",
              "delivered": 100000,
              "delivered_percentage": "100.00",
              "hard_bounce": 0,
              "hard_bounce_percentage": "0.00",
              "open_percentage": "15.55",
              "04\"": null,
              "status": "Finished",
              "opens": 15548,
              "queue": 0,
              "queue_percentage": "0.00",
              "queued_total": 100000,
              "sent": 100000,
              "sent_percentage": "100.00",
              "soft_bounce": 0,
              "soft_bounce_percentage": "0.00",
              "spam_complaints_count": 0,
              "spam_complaints_percentage": "0.00",
              "unsubscribe": 307,
              "unsubscribe_percentage": "1.97"
             },
             "rule": {
              "contacts_order": "first",
              "limit": ""
             },
             "scheduled_date": {
              "date": "2021-04-27 17:14:15",
              "timezone": "Asia/Kolkata"
             },
             "sender": {
              "sender_email": "sender@yourdomain.com",
              "sender_name": "Sender Name Shan"
             },
             "start_date": "2021-04-27 11:47:04",
             "status": "Finished",
             "status_change_date": "2021-04-27 15:07:02",
             "status_change_message": "",
             "subject": "Amazon offers",
             "tag": "Amazon offers",
             "time_rule": {},
             "type": "Normal campaign"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "string",
            "message": "string"
           }
          }
         }
        }
       }
      }
     }
    }
   },
   "put": {
    "summary": "Update Campaign",
    "operationId": "update-campaign",
    "description": "API for updating the campaign. Can't change or edit the list, segments, pause_rule, rules for the campaigns in sending status. Pause the campaign to edit the scheduled date.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Campaign Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "application/json",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "email_preheader": {
          "type": "string",
          "minLength": 1,
          "description": "Email preheader is the summary text that follows a subject line when the email is viewed in an inbox. In many cases, it\u2019s used to provide a short summary of the email, and is typically one sentence long.\n\nMinimum: 1\n\nMaximum: 150"
         },
         "html": {
          "type": "string",
          "minLength": 1,
          "description": "HTML template content for your email campaign."
         },
         "list_ids": {
          "type": "array",
          "description": "Recipients of your email campaign.",
          "items": {
           "type": "string",
           "description": "Contact list id. Before setting list id please check your contact count in list."
          }
         },
         "mailing_preference": {
          "type": "boolean",
          "description": "true -  Mailing preference option will be displayed in footer of email campaign template.\n\nfalse - Mailing preference option will not be dispalyed."
         },
         "name": {
          "type": "string",
          "minLength": 1,
          "description": "Name of the campaign.\n\nMinimum: 1\n\nMaximum: 150"
         },
         "pause_rules": {
          "type": "object",
          "description": "Optional\n\nIf you want to set a rule for sending a campaign, use this option. Based on the configured rule, the campaign will be sent.",
          "properties": {
           "pause_condition": {
            "type": "string",
            "minLength": 1,
            "description": "Rule for setting open or click percentage greater than or less than pause target.\n\nSupported pause_condition - greater than, less than"
           },
           "pause_criteria": {
            "type": "string",
            "minLength": 1,
            "description": "Supported pause_criteria - open, click"
           },
           "pause_limit": {
            "type": "number",
            "description": "The percentage of list contacts to which we want to send campaigns first. In the order we set in rules.\n\nMinimum: 1\n\nMaximum: 50"
           },
           "pause_target": {
            "type": "number",
            "description": "After achieving pause condition how many percentage of subscribers we have to send campaign.\n\nMinimum: 1\n\nMaximum: 100"
           },
           "wait_time": {
            "type": "number",
            "description": "After getting click rate or open rate grater than or less than pause limit , How many time we have to wait to send campaign to other contacts in the list.\n\nWait time in minutes .\n\nMinimum: 1\n\nMaximum: 43200"
           }
          }
         },
         "permission_reminder": {
          "type": "string",
          "minLength": 1,
          "description": "The permission reminder content in your email campaign. If you want give unsubscribe link give %%unsubscribe%%\n\nMinimum: 1\n\nMaximum: 150"
         },
         "plain_text": {
          "type": "string",
          "minLength": 1,
          "description": "Plain text content of your email campaign."
         },
         "reply_email": {
          "type": "string",
          "minLength": 1,
          "description": "Email on which the campaign recipients will be able to reply to. If replay_email empty then sender email will be the reply email "
         },
         "report_spam": {
          "type": "boolean",
          "description": "Spam reporting enable or disable. "
         },
         "rules": {
          "type": "object",
          "description": "Supported contacts_order : first, last.",
          "properties": {
           "contacts_order": {
            "type": "string",
            "minLength": 1,
            "description": "The order of contact list in which you want to send your email campaign.\n\nSupported: first,last"
           },
           "limit": {
            "type": "number",
            "description": "count of subscribers in list to which campaign sends based on the contacts_order. "
           }
          }
         },
         "scheduled_at": {
          "type": "string",
          "minLength": 1,
          "description": "Schedule time for your email campaign. Pass your timezone date-time format for accurate results.\n\nFormat: 2021-04-23 15:04:05"
         },
         "segments": {
          "type": "string",
          "minLength": 1,
          "description": "Your recipient segment id."
         },
         "sender": {
          "type": "object",
          "properties": {
           "sender_email": {
            "type": "string",
            "minLength": 1,
            "description": "From email for your email campaign."
           },
           "sender_name": {
            "type": "string",
            "minLength": 1,
            "description": "From name for email campaign.\n\nMaximum: 100"
           }
          }
         },
         "subject": {
          "type": "string",
          "minLength": 1,
          "description": "Subject of the campaign.\n\nMinimum: 1\n\nMaximum: 150"
         },
         "viewin_browser": {
          "type": "boolean",
          "description": "true: Enable the \"View this email in your browser\"  in Campaign preview page.\n\nfalse: Disable the \"View this email in your browser\"  in Campaign preview page."
         }
        }
       },
       "examples": {
        "example-1": {
         "value": {
          "email_preheader": "Prime member: You have an unused Prime benefit",
          "html": "<html><body> Edited Sample HTML  </body></html>"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "message": {
           "type": "string",
           "minLength": 1
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "message": "Campaign has been updated"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "string",
            "message": "string"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/{id}/opens": {
   "post": {
    "summary": "List Campaign Opens",
    "operationId": "list-campaign-opens",
    "description": "Get a paginated list of contacts who opened a specific campaign.\n\nEach row carries the contact's encrypted id, email, name, the tags currently assigned to the contact, the lists the contact currently belongs to (with their ids and names), and the time of the open in your account timezone.\n\nEach contact appears at most once in the response. If a contact opened the campaign multiple times, the time shown is the most recent open.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Encrypted campaign id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "page",
         "limit"
        ],
        "properties": {
         "page": {
          "type": "integer",
          "minimum": 1,
          "description": "Page number (1-indexed).\n\nMinimum: 1"
         },
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Maximum rows per page.\n\nMinimum: 1\nMaximum: 100"
         },
         "date_from": {
          "type": "string",
          "description": "Optional. Only return opens on or after this date. Format `YYYY-MM-DD`, interpreted in your account timezone."
         },
         "date_to": {
          "type": "string",
          "description": "Optional. Only return opens on or before this date. Format `YYYY-MM-DD`, interpreted in your account timezone. Must be on or after `date_from`."
         }
        }
       },
       "examples": {
        "Example-1---Default": {
         "value": {
          "page": 1,
          "limit": 25
         }
        },
        "Example-2---With-date-filter": {
         "value": {
          "page": 1,
          "limit": 50,
          "date_from": "2026-01-01",
          "date_to": "2026-01-31"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "campaign": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string",
             "description": "Campaign name."
            },
            "subject_line": {
             "type": "string",
             "description": "Campaign subject line."
            },
            "created_date": {
             "type": "string",
             "description": "Campaign creation date and time. Format: `YYYY-MM-DD HH:mm:ss` in your account timezone."
            }
           }
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "contact_id": {
              "type": "string",
              "description": "Encrypted contact id (use with `GET /v1/contacts/{id}`)."
             },
             "email": {
              "type": "string",
              "description": "Contact email."
             },
             "first_name": {
              "type": "string",
              "description": "Contact first name."
             },
             "last_name": {
              "type": "string",
              "description": "Contact last name."
             },
             "tags": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "description": "Names of the tags currently assigned to the contact. Empty array when the contact has no tags."
             },
             "lists": {
              "type": "string",
              "description": "Comma-separated encrypted ids of the lists the contact currently belongs to. The literal string `\"no lists\"` when the contact belongs to no lists."
             },
             "list_name": {
              "type": "string",
              "description": "Comma-separated names of the lists the contact currently belongs to. Each list appears only once. The literal string `\"no lists\"` when the contact belongs to no lists."
             },
             "created_date": {
              "type": "string",
              "description": "Time of the open. Format: `YYYY-MM-DD HH:mm:ss` in your account timezone."
             }
            }
           }
          },
          "total": {
           "type": "integer",
           "description": "Total number of contacts who opened the campaign, ignoring pagination."
          }
         }
        },
        "examples": {
         "Example-1---With-rows": {
          "value": {
           "campaign": {
            "name": "May newsletter",
            "subject_line": "Big update inside",
            "created_date": "2026-05-10 11:30:00"
           },
           "data": [
            {
             "contact_id": "SuwESEuwZZ",
             "email": "alice@example.com",
             "first_name": "Alice",
             "last_name": "Anderson",
             "tags": [
              "VIP",
              "Newsletter"
             ],
             "lists": "SuSwZS,KkfHZw",
             "list_name": "Newsletter Subscribers, Beta Testers",
             "created_date": "2026-05-15 08:42:11"
            },
            {
             "contact_id": "SuwESEuwZf",
             "email": "bob@example.com",
             "first_name": "Bob",
             "last_name": "",
             "tags": [],
             "lists": "no lists",
             "list_name": "no lists",
             "created_date": "2026-05-15 09:14:02"
            }
           ],
           "total": 1234
          }
         },
         "Example-2---Empty-result": {
          "value": {
           "campaign": {
            "name": "May newsletter",
            "subject_line": "Big update inside",
            "created_date": "2026-05-10 11:30:00"
           },
           "data": [],
           "total": 0
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request - validation failure",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Page-required": {
          "value": {
           "errors": [
            {
             "field": "page",
             "message": "Page is a required field"
            }
           ]
          }
         },
         "Limit-out-of-range": {
          "value": {
           "errors": [
            {
             "field": "limit",
             "message": "Limit must be 100 or less"
            }
           ]
          }
         },
         "Bad-date-format": {
          "value": {
           "errors": [
            {
             "field": "date_from",
             "message": "Invalid date_from"
            }
           ]
          }
         },
         "Date-range-invalid": {
          "value": {
           "errors": [
            {
             "field": "date_to",
             "message": "date_to must be on or after date_from"
            }
           ]
          }
         },
         "Malformed-JSON": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Invalid json"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized - missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found - the campaign id does not exist in your account",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Campaign not found"
            }
           ]
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too Many Requests - rate limit exceeded",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Too Many Requests"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Sorry, we are experiencing some technical difficulties. Please try after some time."
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/{id}/clicks": {
   "post": {
    "summary": "List Campaign Clicks",
    "operationId": "list-campaign-clicks",
    "description": "Get a paginated list of contacts who clicked a link in a specific campaign.\n\nEach row carries the contact's encrypted id, email, name, the tags currently assigned to the contact, the lists the contact currently belongs to (with their ids and names), and the time of the click in your account timezone.\n\nEach contact appears at most once in the response. If a contact clicked more than once, the time shown is the most recent click.",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Encrypted campaign id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "page",
         "limit"
        ],
        "properties": {
         "page": {
          "type": "integer",
          "minimum": 1,
          "description": "Page number (1-indexed).\n\nMinimum: 1"
         },
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Maximum rows per page.\n\nMinimum: 1\nMaximum: 100"
         },
         "date_from": {
          "type": "string",
          "description": "Optional. Only return clicks on or after this date. Format `YYYY-MM-DD`, interpreted in your account timezone."
         },
         "date_to": {
          "type": "string",
          "description": "Optional. Only return clicks on or before this date. Format `YYYY-MM-DD`, interpreted in your account timezone. Must be on or after `date_from`."
         }
        }
       },
       "examples": {
        "Example-1---Default": {
         "value": {
          "page": 1,
          "limit": 25
         }
        },
        "Example-2---With-date-filter": {
         "value": {
          "page": 1,
          "limit": 50,
          "date_from": "2026-01-01",
          "date_to": "2026-01-31"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "campaign": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string",
             "description": "Campaign name."
            },
            "subject_line": {
             "type": "string",
             "description": "Campaign subject line."
            },
            "created_date": {
             "type": "string",
             "description": "Campaign creation date and time. Format: `YYYY-MM-DD HH:mm:ss` in your account timezone."
            }
           }
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "contact_id": {
              "type": "string",
              "description": "Encrypted contact id (use with `GET /v1/contacts/{id}`)."
             },
             "email": {
              "type": "string",
              "description": "Contact email."
             },
             "first_name": {
              "type": "string",
              "description": "Contact first name."
             },
             "last_name": {
              "type": "string",
              "description": "Contact last name."
             },
             "tags": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "description": "Names of the tags currently assigned to the contact. Empty array when the contact has no tags."
             },
             "lists": {
              "type": "string",
              "description": "Comma-separated encrypted ids of the lists the contact currently belongs to. The literal string `\"no lists\"` when the contact belongs to no lists."
             },
             "list_name": {
              "type": "string",
              "description": "Comma-separated names of the lists the contact currently belongs to. Each list appears only once. The literal string `\"no lists\"` when the contact belongs to no lists."
             },
             "created_date": {
              "type": "string",
              "description": "Time of the click. Format: `YYYY-MM-DD HH:mm:ss` in your account timezone."
             }
            }
           }
          },
          "total": {
           "type": "integer",
           "description": "Total number of contacts who clicked the campaign, ignoring pagination."
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "campaign": {
            "name": "May newsletter",
            "subject_line": "Big update inside",
            "created_date": "2026-05-10 11:30:00"
           },
           "data": [
            {
             "contact_id": "SuwESEuwZy",
             "email": "alice@example.com",
             "first_name": "Alice",
             "last_name": "Anderson",
             "tags": [
              "VIP"
             ],
             "lists": "SuSwZS",
             "list_name": "Newsletter Subscribers",
             "created_date": "2026-05-15 08:50:33"
            }
           ],
           "total": 217
          }
         },
         "Example-2---Empty-result": {
          "value": {
           "campaign": {
            "name": "May newsletter",
            "subject_line": "Big update inside",
            "created_date": "2026-05-10 11:30:00"
           },
           "data": [],
           "total": 0
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request - validation failure",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Limit-too-high": {
          "value": {
           "errors": [
            {
             "field": "limit",
             "message": "Limit must be 100 or less"
            }
           ]
          }
         },
         "Bad-date-format": {
          "value": {
           "errors": [
            {
             "field": "date_from",
             "message": "Invalid date_from"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found - the campaign id does not exist in your account",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Campaign not found"
            }
           ]
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too Many Requests - rate limit exceeded",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Too Many Requests"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Sorry, we are experiencing some technical difficulties. Please try after some time."
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/campaign/{id}/unsubs": {
   "post": {
    "summary": "List Campaign Unsubscribes",
    "operationId": "list-campaign-unsubscribes",
    "description": "Get a paginated list of contacts who unsubscribed via a specific campaign.\n\nEach row carries the contact's encrypted id, email, name, the tags currently assigned to the contact, the lists the contact currently belongs to (with their ids and names), the time of the unsubscribe in your account timezone, and the reason the contact gave (if any).",
    "tags": [
     "Campaigns"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Encrypted campaign id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "page",
         "limit"
        ],
        "properties": {
         "page": {
          "type": "integer",
          "minimum": 1,
          "description": "Page number (1-indexed).\n\nMinimum: 1"
         },
         "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Maximum rows per page.\n\nMinimum: 1\nMaximum: 100"
         },
         "date_from": {
          "type": "string",
          "description": "Optional. Only return unsubscribes on or after this date. Format `YYYY-MM-DD`, interpreted in your account timezone."
         },
         "date_to": {
          "type": "string",
          "description": "Optional. Only return unsubscribes on or before this date. Format `YYYY-MM-DD`, interpreted in your account timezone. Must be on or after `date_from`."
         }
        }
       },
       "examples": {
        "Example-1---Default": {
         "value": {
          "page": 1,
          "limit": 25
         }
        },
        "Example-2---With-date-filter": {
         "value": {
          "page": 1,
          "limit": 50,
          "date_from": "2026-01-01",
          "date_to": "2026-01-31"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "campaign": {
           "type": "object",
           "properties": {
            "name": {
             "type": "string",
             "description": "Campaign name."
            },
            "subject_line": {
             "type": "string",
             "description": "Campaign subject line."
            },
            "created_date": {
             "type": "string",
             "description": "Campaign creation date and time. Format: `YYYY-MM-DD HH:mm:ss` in your account timezone."
            }
           }
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "contact_id": {
              "type": "string",
              "description": "Encrypted contact id (use with `GET /v1/contacts/{id}`)."
             },
             "email": {
              "type": "string",
              "description": "Contact email."
             },
             "first_name": {
              "type": "string",
              "description": "Contact first name."
             },
             "last_name": {
              "type": "string",
              "description": "Contact last name."
             },
             "tags": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "description": "Names of the tags currently assigned to the contact. Empty array when the contact has no tags."
             },
             "lists": {
              "type": "string",
              "description": "Comma-separated encrypted ids of the lists the contact currently belongs to. The literal string `\"no lists\"` when the contact belongs to no lists."
             },
             "list_name": {
              "type": "string",
              "description": "Comma-separated names of the lists the contact currently belongs to. Each list appears only once. The literal string `\"no lists\"` when the contact belongs to no lists."
             },
             "created_date": {
              "type": "string",
              "description": "Time of the unsubscribe. Format: `YYYY-MM-DD HH:mm:ss` in your account timezone."
             },
             "reason": {
              "type": "string",
              "description": "Reason the contact gave when unsubscribing. Empty string when no reason was provided. The literal string `\"Abuse\"` when the contact reported the campaign as spam instead of unsubscribing."
             }
            }
           }
          },
          "total": {
           "type": "integer",
           "description": "Total number of contacts who unsubscribed from the campaign, ignoring pagination."
          }
         }
        },
        "examples": {
         "Example-1---With-rows": {
          "value": {
           "campaign": {
            "name": "May newsletter",
            "subject_line": "Big update inside",
            "created_date": "2026-05-10 11:30:00"
           },
           "data": [
            {
             "contact_id": "SuwESEuwZZ",
             "email": "alice@example.com",
             "first_name": "Alice",
             "last_name": "Anderson",
             "tags": [
              "VIP"
             ],
             "lists": "SuSwZS",
             "list_name": "Newsletter Subscribers",
             "created_date": "2026-05-15 09:24:11",
             "reason": "no longer interested"
            },
            {
             "contact_id": "SuwESEuHaa",
             "email": "bob@example.com",
             "first_name": "Bob",
             "last_name": "",
             "tags": [],
             "lists": "no lists",
             "list_name": "no lists",
             "created_date": "2026-05-15 11:02:47",
             "reason": "Abuse"
            }
           ],
           "total": 42
          }
         },
         "Example-2---Empty-result": {
          "value": {
           "campaign": {
            "name": "May newsletter",
            "subject_line": "Big update inside",
            "created_date": "2026-05-10 11:30:00"
           },
           "data": [],
           "total": 0
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request - validation failure",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Limit-too-high": {
          "value": {
           "errors": [
            {
             "field": "limit",
             "message": "Limit must be 100 or less"
            }
           ]
          }
         },
         "Date-range-invalid": {
          "value": {
           "errors": [
            {
             "field": "date_to",
             "message": "date_to must be on or after date_from"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found - the campaign id does not exist in your account",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Campaign not found"
            }
           ]
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too Many Requests - rate limit exceeded",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Too Many Requests"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Sorry, we are experiencing some technical difficulties. Please try after some time."
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contact/property": {
   "post": {
    "summary": "Create Property",
    "operationId": "create-property",
    "description": "API for creating custom property of contacts. Custom properties store specific information for contact records in Mailercloud. You are allowed to create a maximum of 100 properties.",
    "tags": [
     "Custom Properties"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "description": {
          "type": "string",
          "description": "Description for your property\n\nMinimum: 3\n \nMaximum: 500 ",
          "minLength": 3,
          "maxLength": 500
         },
         "name": {
          "type": "string",
          "description": "Your name for your property \n\nMinimum: 3\n \nMaximum: 30 ",
          "minLength": 3,
          "maxLength": 30
         },
         "type": {
          "type": "string",
          "description": "Your property type\n \n supported types\n  \n text,number,date,textarea"
         }
        },
        "required": [
         "name",
         "type"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "description": "string",
          "name": "string",
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {},
         "required": [
          "id"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "id": "xyz"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           },
           "required": [
            "field",
            "message"
           ]
          }
         },
         "required": [
          "error"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "name",
            "message": "The name field must be at least 3 characters"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contact/property/{id}": {
   "delete": {
    "summary": "Delete Property",
    "operationId": "delete-property",
    "description": "API for deleting custom property of contacts. If the property is used in a webform you won't be able to delete it.",
    "tags": [
     "Custom Properties"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Custom property Id",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "message": {
           "type": "string",
           "minLength": 1
          }
         },
         "required": [
          "message"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "message": "Custom property deleted successfully"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error_code": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "patch": {
    "summary": "Update Property",
    "operationId": "update-property",
    "description": "API for updating custom property of contacts. Editing custom property type using this API is not possible. You can only edit the name and description.",
    "tags": [
     "Custom Properties"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Custom Property Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "description": {
          "type": "string",
          "description": "Description for your property\n\nMinimum: 3\n \nMaximum: 500 ",
          "minLength": 3,
          "maxLength": 500
         },
         "name": {
          "type": "string",
          "description": "Your name for your property \n\nMinimum: 3\n \nMaximum: 30 ",
          "minLength": 3,
          "maxLength": 30
         }
        },
        "required": [
         "name"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "description": "Gender of your contact",
          "name": "Gender"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {},
         "required": [
          "id"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "id": "YCJ"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           },
           "required": [
            "field",
            "message"
           ]
          }
         },
         "required": [
          "error"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "name",
            "message": "The name field must be at least 3 characters"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contact/property/search": {
   "post": {
    "summary": "List Property",
    "operationId": "list-property",
    "description": "Using this API, you can list all the properties of your contacts in your Mailercloud account. You can also make segments based on these properties",
    "tags": [
     "Custom Properties"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": false,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return. \n\nMaximum: 100\nMinimum: 10",
          "minimum": 10,
          "maximum": 100
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1"
         },
         "search": {
          "type": "string",
          "minLength": 1,
          "description": "Filter property list by name , giving name as search keyword "
         },
         "type": {
          "type": "string",
          "description": "Filter property based on type.\n \nAvailable types - default,custom"
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 0,
          "page": 0,
          "search": "string",
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number"
          },
          "data": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field_description",
             "field_name",
             "field_type",
             "field_value",
             "id",
             "is_default"
            ],
            "properties": {
             "field_description": {
              "type": "string",
              "minLength": 1
             },
             "field_name": {
              "type": "string",
              "minLength": 1
             },
             "field_type": {
              "type": "string",
              "minLength": 1
             },
             "field_value": {
              "type": "string",
              "minLength": 1
             },
             "is_default": {
              "type": "number"
             }
            }
           }
          }
         },
         "required": [
          "count",
          "data"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 20,
           "data": [
            {
             "field_description": "Created via webform as a template property.",
             "field_name": "Message",
             "field_type": "Textarea",
             "field_value": "message",
             "id": "dcK",
             "is_default": 0
            },
            {
             "field_description": " ",
             "field_name": "Countryin",
             "field_type": "Text",
             "field_value": "countryin",
             "id": "szB",
             "is_default": 0
            },
            {
             "field_description": "IP address of the subscriber",
             "field_name": "IP",
             "field_type": "Text",
             "field_value": "userip",
             "id": "Bg",
             "is_default": 1
            },
            {
             "field_description": "Lead source",
             "field_name": "Lead source",
             "field_type": "Text",
             "field_value": "lead_source",
             "id": "BF",
             "is_default": 1
            },
            {
             "field_description": "Salary of the subscriber",
             "field_name": "Salary",
             "field_type": "Number",
             "field_value": "salary",
             "id": "kv",
             "is_default": 1
            },
            {
             "field_description": "Job of the subscriber",
             "field_name": "Job title",
             "field_type": "Text",
             "field_value": "job_title",
             "id": "Ku",
             "is_default": 1
            },
            {
             "field_description": "Department of the subscriber",
             "field_name": "Department",
             "field_type": "Text",
             "field_value": "department",
             "id": "bC",
             "is_default": 1
            },
            {
             "field_description": "company name of the subscriber",
             "field_name": "company_name",
             "field_type": "Text",
             "field_value": "organization",
             "id": "kb",
             "is_default": 1
            }
           ]
          }
         },
         "example-2": {
          "value": {
           "count": 0,
           "data": [
            {
             "field_description": "string",
             "field_name": "string",
             "field_type": "string",
             "field_value": "string",
             "id": "string",
             "is_default": 0
            }
           ]
          }
         }
        }
       }
      }
     },
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {}
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Invalid input"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contacts": {
   "post": {
    "summary": "Create Contact",
    "operationId": "create-contact",
    "description": "API for creating contact. For creating a contact, email and list id is required. If you try to create a contact that already exists, it gives an \"already exists\" message . You can add custom property data by mapping the property id : value. You can add contacts until your contact quota limit is reached. If you create a contact in a suppressed list and if this contact is also present in the active list,  the contact will be removed from the active list to the suppressed list.",
    "tags": [
     "Contacts"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "email",
         "list_id"
        ],
        "properties": {
         "city": {
          "type": "string",
          "description": "The city of the contact\n\nMaximum: 100 ",
          "maxLength": 100
         },
         "country": {
          "type": "string",
          "description": "The country of the contact\n\nMaximum: 50",
          "maxLength": 50
         },
         "custom_fields": {
          "type": "object",
          "description": "Json for custom property\n \nText - maximum: 100\n\nTextarea - maximum: 500\n\nNumber - Numeric values only\n\nDate - maximum: 10,format = 2006-01-02 ",
          "properties": {
           "enc_id1": {
            "type": "string",
            "minLength": 1,
            "description": " property id : value of property\n string can store upto 100 characters"
           },
           "enc_id2": {
            "type": "number",
            "description": " property id : value of property\n Number field can store numbers with 30 characters long"
           }
          }
         },
         "department": {
          "type": "string",
          "minLength": 1,
          "description": "The department of contact\n\nMaximum: 100"
         },
         "email": {
          "type": "string",
          "maxLength": 200,
          "description": "The email for the contact. This is required to be a valid email.\n\nMaximum: 200"
         },
         "industry": {
          "type": "string",
          "description": "The industry of the contact\n\nMaximum: 100",
          "maxLength": 100
         },
         "job_title": {
          "type": "string",
          "description": "The job title of the contact \n\nMaximum: 100",
          "maxLength": 100
         },
         "last_name": {
          "type": "string",
          "description": "The last name for the contact\n\nMaximum: 25",
          "maxLength": 25
         },
         "lead_source": {
          "type": "string",
          "description": "The lead sorce of contact\n\nMaximum: 50",
          "maxLength": 50
         },
         "list_id": {
          "type": "string",
          "minLength": 1,
          "description": "The contact list id to which you want to add this contact"
         },
         "middle_name": {
          "type": "string",
          "maxLength": 25,
          "description": "The middle name of contact\n\nMaximum: 25"
         },
         "first_name": {
          "type": "string",
          "maxLength": 25,
          "description": "Name of your contact\n\nMaximum: 25"
         },
         "company_name": {
          "type": "string",
          "description": "The company name of your contact\n\nMaximum: 150",
          "maxLength": 150
         },
         "phone": {
          "type": "string",
          "minLength": 1,
          "description": "The phone number of your contact\n\nMaximum: 25"
         },
         "salary": {
          "type": "number",
          "description": "The salary of your contact\n\nMaximum: 15"
         },
         "state": {
          "type": "string",
          "description": "The state of your contact\n\nMaximum: 100",
          "maxLength": 100
         },
         "postal_code": {
          "type": "string",
          "description": "The postal code of your contact\n\nMaximum: 25",
          "maxLength": 25
         },
         "contact_type": {
          "type": "string",
          "description": "Allowed values - active, bounce, abuse, unsubscribe, suppressed, spam complaints\n\nDefault: active",
          "default": "active"
         },
         "tags": {
          "type": "array",
          "description": "The tags of your contact\n",
          "items": {}
         }
        }
       },
       "examples": {
        "example-1": {
         "value": {
          "city": "string",
          "country": "string",
          "custom_fields": {
           "enc_id1": "string",
           "enc_id2": 0
          },
          "department": "string",
          "email": "string",
          "industry": "string",
          "job_title": "string",
          "last_name": "string",
          "lead_source": "string",
          "list_id": "string",
          "middle_name": "string",
          "first_name": "string",
          "company_name": "string",
          "phone": "string",
          "salary": 0,
          "state": "string",
          "postal_code": "string",
          "contact_type": "active",
          "tags": [
           "string"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {}
        },
        "examples": {
         "example-1": {
          "value": {
           "id": "xc"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "email",
            "message": "Invalid email"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contacts/upsert": {
   "post": {
    "summary": "Create or Update Contact",
    "operationId": "create-or-update-contact",
    "description": "API to manage your contacts, allowing you to either create new contacts or update existing ones based on your needs.\n\nWhen you send a request, the API first checks if the contact already exists in your database.\nIf the contact is found, the API will automatically update the existing contact with the new information provided. This ensures that your contact list remains up-to-date without creating duplicates.\n\n**Custom Property Data:**\nThe API allows you to add custom properties to each contact. You can do this in two ways:\n- By Property ID: Map the property ID to its corresponding value. \n- By Personalization Tag: Alternatively, you can use personalization tag for that property to specify values.\n\n**Contact Quota Limit:**\nPlease note that you can continue adding or updating contacts until you reach your designated contact quota limit. \nIf you reach your quota limit, further attempts to add new contacts will be rejected until you either remove some existing contacts or increase your quota.",
    "tags": [
     "Contacts"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "city": {
          "type": "string"
         },
         "country": {
          "type": "string"
         },
         "custom_fields": {
          "type": "object",
          "properties": {
           "enc_id1": {
            "type": "string"
           },
           "personalisation_tag_4": {
            "type": "integer"
           }
          }
         },
         "department": {
          "type": "string"
         },
         "email": {
          "type": "string"
         },
         "industry": {
          "type": "string"
         },
         "job_title": {
          "type": "string"
         },
         "last_name": {
          "type": "string"
         },
         "lead_source": {
          "type": "string"
         },
         "list_id": {
          "type": "string"
         },
         "middle_name": {
          "type": "string"
         },
         "first_name": {
          "type": "string"
         },
         "company_name": {
          "type": "string"
         },
         "phone": {
          "type": "string"
         },
         "salary": {
          "type": "integer"
         },
         "state": {
          "type": "string"
         },
         "postal_code": {
          "type": "string"
         },
         "contact_type": {
          "type": "string"
         },
         "tags": {
          "type": "array",
          "items": {
           "type": "string"
          }
         }
        },
        "x-examples": {
         "Example 1": {
          "city": "San Francisco",
          "country": "USA",
          "custom_fields": {
           "enc_id1": "ABC123",
           "personalisation_tag_4": 456
          },
          "department": "Engineering",
          "email": "john.doe@example.com",
          "industry": "Software Development",
          "job_title": "Software Engineer",
          "last_name": "Doe",
          "lead_source": "Website",
          "list_id": "KYHH",
          "middle_name": "A.",
          "first_name": "John A. Doe",
          "company_name": "Tech Innovations Inc.",
          "phone": "+1-234-567-8901",
          "salary": 95000,
          "state": "California",
          "postal_code": "94105",
          "contact_type": "active",
          "tags": [
           "prospect",
           "customer",
           "lead"
          ]
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "city": "San Francisco",
          "country": "USA",
          "custom_fields": {
           "enc_id1": "ABC123",
           "personalisation_tag_4": 456
          },
          "department": "Engineering",
          "email": "john.doe@example.com",
          "industry": "Software Development",
          "job_title": "Software Engineer",
          "last_name": "Doe",
          "lead_source": "Website",
          "list_id": "KYHH",
          "middle_name": "A.",
          "first_name": "John A. Doe",
          "company_name": "Tech Innovations Inc.",
          "phone": "+1-234-567-8901",
          "salary": 95000,
          "state": "California",
          "postal_code": "94105",
          "contact_type": "active",
          "tags": [
           "prospect",
           "customer",
           "lead"
          ]
         }
        },
        "Example-2": {
         "value": {
          "city": "San Francisco",
          "country": "USA",
          "custom_fields": {
           "enc_id1": "ABC123",
           "personalisation_tag_4": 456
          },
          "department": "Engineering",
          "email": "john.doe@example.com",
          "industry": "Software Development",
          "job_title": "Software Engineer",
          "last_name": "Doe",
          "lead_source": "Website",
          "list_id": "KYHH",
          "middle_name": "A.",
          "first_name": "John A. Doe",
          "company_name": "Tech Innovations Inc.",
          "phone": "+1-234-567-8901",
          "salary": 95000,
          "state": "California",
          "postal_code": "94105",
          "contact_type": "active",
          "tags": [
           "prospect",
           "customer",
           "lead"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "contact_id": {
           "type": "string"
          },
          "status": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "contact_id": "fZuKHSuwK",
           "status": "updated"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "contact_id": "fZuKHSuwK",
           "status": "updated"
          }
         },
         "Example-2": {
          "value": {
           "contact_id": "fZuKHSuwK",
           "status": "created"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "error": {
            "field": "email",
            "message": "Invalid email"
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": {
            "field": "email",
            "message": "Invalid email"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contacts/{id}": {
   "put": {
    "summary": "Update Contact",
    "operationId": "update-contact",
    "description": "Update contact details based on contact ID or Email using this API. However, you can't update the list ID and email.",
    "tags": [
     "Contacts"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Contact Id or Email",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "city": {
          "type": "string",
          "description": "The city of the contact\n\nMaximum: 100 ",
          "maxLength": 100
         },
         "country": {
          "type": "string",
          "description": "The country of the contact\n\nMaximum: 50",
          "maxLength": 50
         },
         "custom_fields": {
          "type": "object",
          "description": "Json for custom property\n \nText - maximum: 100\n\nTextarea - maximum: 500\n\nNumber - Numeric values only\n\nDate - maximum: 10,format = 2006-01-02 ",
          "properties": {
           "enc_id1": {
            "type": "string",
            "minLength": 1,
            "description": " property id : value of property"
           },
           "enc_id2": {
            "type": "number",
            "description": " property id : value of property"
           }
          },
          "required": [
           "enc_id1",
           "enc_id2"
          ]
         },
         "department": {
          "type": "string",
          "description": "The department of contact\n\nMaximum: 100",
          "maxLength": 100
         },
         "industry": {
          "type": "string",
          "description": "The industry of the contact\n\nMaximum: 100",
          "maxLength": 100
         },
         "job_title": {
          "type": "string",
          "description": "The job title of the contact \n\nMaximum: 100",
          "maxLength": 100
         },
         "last_name": {
          "type": "string",
          "description": "The last name for the contact\n\nMaximum: 25",
          "maxLength": 25
         },
         "lead_source": {
          "type": "string",
          "description": "The lead sorce of contact\n\nMaximum: 50",
          "maxLength": 50
         },
         "middle_name": {
          "type": "string",
          "description": "The middle name of contact\n\nMaximum: 25",
          "maxLength": 25
         },
         "first_name": {
          "type": "string",
          "description": "Name of your contact\n\nMaximum: 25",
          "maxLength": 25
         },
         "company_name": {
          "type": "string",
          "description": "The company name of your contact\n\nMaximum: 150",
          "maxLength": 150
         },
         "phone": {
          "type": "string",
          "description": "The phone number of your contact\n\nMaximum: 25",
          "maxLength": 25
         },
         "salary": {
          "type": "number",
          "description": "The salary of your contact\n\nMaximum: 15"
         },
         "state": {
          "type": "string",
          "description": "The state of your contact\n\nMaximum: 100",
          "maxLength": 100
         },
         "postal_code": {
          "type": "string",
          "description": "The postal code of your contact\n\nMaximum: 25",
          "maxLength": 25
         },
         "contact_type": {
          "type": "string",
          "description": "Allowed values - active, bounce, abuse, unsubscribe, suppressed, spam complaints"
         },
         "tags": {
          "type": "array",
          "description": "The tags of your contact",
          "items": {}
         }
        }
       },
       "examples": {
        "example-1": {
         "value": {
          "city": "string",
          "country": "string",
          "custom_fields": {
           "xyz": "string",
           "ncx": 0
          },
          "department": "string",
          "industry": "string",
          "job_title": "string",
          "last_name": "string",
          "lead_source": "string",
          "middle_name": "string",
          "first_name": "string",
          "company_name": "string",
          "phone": "string",
          "salary": 0,
          "state": "string",
          "postal_code": "string",
          "tags": [
           "string"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "message": {
           "type": "string",
           "minLength": 1
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "message": "Contact updated"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "name",
            "message": "Invalid name"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Contact",
    "operationId": "delete-contact",
    "description": "Delete a contact based on their ID",
    "tags": [
     "Contacts"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Contact id or Email",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "message": {
           "type": "string",
           "minLength": 1
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "message": "Contact deleted successfully"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "get": {
    "summary": "Get Contact Details",
    "operationId": "get-contact-details",
    "description": "Get contact details based on their Contact ID or Email",
    "tags": [
     "Contacts"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Contact id or Email",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {}
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "city",
            "country",
            "custom_fields",
            "department",
            "dob",
            "email",
            "firstname",
            "id",
            "industry",
            "job_title",
            "last_name",
            "lead_source",
            "list_id",
            "middle_name",
            "name",
            "company_name",
            "phone",
            "salary",
            "state",
            "user_ip",
            "postal_code"
           ],
           "properties": {
            "city": {
             "type": "string",
             "minLength": 1
            },
            "country": {
             "type": "string",
             "minLength": 1
            },
            "custom_fields": {
             "type": "object"
            },
            "department": {
             "type": "string",
             "minLength": 1
            },
            "dob": {
             "type": "string",
             "minLength": 1
            },
            "email": {
             "type": "string",
             "minLength": 1
            },
            "firstname": {
             "type": "string",
             "minLength": 1
            },
            "industry": {
             "type": "string",
             "minLength": 1
            },
            "job_title": {
             "type": "string",
             "minLength": 1
            },
            "last_name": {
             "type": "string",
             "minLength": 1
            },
            "lead_source": {
             "type": "string",
             "minLength": 1
            },
            "list_id": {
             "type": "string",
             "minLength": 1
            },
            "middle_name": {
             "type": "string",
             "minLength": 1
            },
            "first_name": {
             "type": "string",
             "minLength": 1
            },
            "company_name": {
             "type": "string",
             "minLength": 1
            },
            "phone": {
             "type": "string",
             "minLength": 1
            },
            "salary": {
             "type": "string",
             "minLength": 1
            },
            "state": {
             "type": "string",
             "minLength": 1
            },
            "user_ip": {
             "type": "string",
             "minLength": 1
            },
            "postal_code": {
             "type": "string",
             "minLength": 1
            },
            "tags": {
             "type": "string"
            }
           }
          }
         },
         "required": [
          "data"
         ]
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contact/tag/remove": {
   "post": {
    "summary": "Remove Contact Tag",
    "operationId": "remove-contact-tag",
    "description": "API to remove contact-tags from individual contacts\n\nWhen you send a request, the API first checks if the contact already exists in your database.\nIf the contact is found, the API will check if the tags you provided are valid. You can give both tag names or tag ids.\n\nThe API allows you to  remove contact-tags. You can do this in two ways:\n- By Contact ID: You can add the **contact ID** from your panel to remove tags.\n- By Email: Alternatively, you can use the **email ID** of the contact whose tag you want to update.",
    "tags": [
     "Contacts"
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "tag_ids": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "tag_names": {
          "type": "array",
          "items": {
           "type": "string"
          }
         }
        },
        "x-examples": {
         "Example 1": {
          "tag_ids": [
           "ccj",
           "ddg"
          ],
          "tag_names": [
           "my tag",
           "new tag"
          ]
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "id": "example@example.com",
          "tag_ids": [
           "ccj",
           "ddg"
          ],
          "tag_names": [
           "my tag",
           "new tag"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "message": "Contact tag removed successfully"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Contact tag removed successfully"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "provide tag does not exists"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Contact Id is a required field"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contact/search/{id}": {
   "post": {
    "summary": "Get Contacts in a List",
    "operationId": "get-contacts-in-a-list",
    "description": "You can collect all your contacts on a single list.",
    "tags": [
     "Contacts"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "List id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return. \n\nMaximum: 100\nMinimum: 10",
          "minimum": 10,
          "maximum": 100
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1"
         },
         "search": {
          "type": "string",
          "description": "Filter contact list by name , giving name as search keyword "
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 10,
          "page": 1,
          "search": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number"
          },
          "data": {
           "type": "object",
           "properties": {
            "city": {
             "type": "string",
             "minLength": 1
            },
            "country": {
             "type": "string",
             "minLength": 1
            },
            "custom_fields": {
             "type": "object"
            },
            "department": {
             "type": "string",
             "minLength": 1
            },
            "dob": {
             "type": "string",
             "minLength": 1
            },
            "email": {
             "type": "string",
             "minLength": 1
            },
            "firstname": {
             "type": "string",
             "minLength": 1
            },
            "industry": {
             "type": "string",
             "minLength": 1
            },
            "job_title": {
             "type": "string",
             "minLength": 1
            },
            "last_name": {
             "type": "string",
             "minLength": 1
            },
            "lead_source": {
             "type": "string",
             "minLength": 1
            },
            "middle_name": {
             "type": "string",
             "minLength": 1
            },
            "name": {
             "type": "string",
             "minLength": 1
            },
            "company_name": {
             "type": "string",
             "minLength": 1
            },
            "phone": {
             "type": "string",
             "minLength": 1
            },
            "salary": {
             "type": "string",
             "minLength": 1
            },
            "state": {
             "type": "string",
             "minLength": 1
            },
            "user_ip": {
             "type": "string",
             "minLength": 1
            },
            "postal_code": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 0,
           "data": {
            "city": "string",
            "country": "string",
            "custom_fields": {},
            "department": "string",
            "dob": "string",
            "email": "string",
            "firstname": "string",
            "id": "string",
            "industry": "string",
            "job_title": "string",
            "last_name": "string",
            "lead_source": "string",
            "middle_name": "string",
            "first_name": "string",
            "company_name": "string",
            "phone": "string",
            "salary": "string",
            "state": "string",
            "user_ip": "string",
            "postal_code": "string"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Invalid input"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/contacts/batch": {
   "post": {
    "summary": "Create Batch Contact",
    "operationId": "create-batch-contact",
    "description": "Create a  Batch contact. You can create a maximum of 50 contact through this API.",
    "tags": [
     "Contacts"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "contacts": {
          "type": "array",
          "uniqueItems": true,
          "minItems": 1,
          "maxItems": 50,
          "description": "Batches of contact",
          "items": {
           "type": "object",
           "properties": {
            "city": {
             "type": "string",
             "description": "The city of the contact\n\nMaximum: 100",
             "maxLength": 100
            },
            "country": {
             "type": "string",
             "description": "The country of the contact\n\nMaximum: 50",
             "maxLength": 50
            },
            "custom_fields": {
             "type": "object",
             "description": "Json for custom property\n \nText - maximum: 100\n\nTextarea - maximum: 500\n\nNumber - Numeric values only\n\nDate - maximum: 10,format = 2006-01-02 ",
             "properties": {
              "enc_id1": {
               "type": "string",
               "minLength": 1,
               "description": "property id : value of property"
              },
              "enc_id2": {
               "type": "number",
               "description": "property id : value of property"
              }
             }
            },
            "department": {
             "type": "string",
             "description": "The department of contact\n\nMaximum: 100",
             "maxLength": 100
            },
            "email": {
             "type": "string",
             "description": "The email for the contact. This is required to be a valid email.\n\nMaximum: 200",
             "maxLength": 200
            },
            "industry": {
             "type": "string",
             "description": "The industry of the contact\n\nMaximum: 100",
             "maxLength": 100
            },
            "job_title": {
             "type": "string",
             "description": "The job title of the contact \n\nMaximum: 100",
             "maxLength": 100
            },
            "last_name": {
             "type": "string",
             "description": "The last name for the contact\n\nMaximum: 25",
             "maxLength": 25
            },
            "lead_source": {
             "type": "string",
             "description": "The lead sorce of contact\n\nMaximum: 50",
             "maxLength": 50
            },
            "middle_name": {
             "type": "string",
             "description": "The middle name of contact\n\nMaximum: 25",
             "maxLength": 25
            },
            "name": {
             "type": "string",
             "description": "Name of your contact\n\nMaximum: 25",
             "maxLength": 25
            },
            "company_name": {
             "type": "string",
             "description": "The company name of your contact\n\nMaximum: 150",
             "maxLength": 150
            },
            "phone": {
             "type": "string",
             "description": "The phone number of your contact\n\nMaximum: 25",
             "maxLength": 25
            },
            "salary": {
             "type": "number",
             "description": "The salary of your contact\n\nMaximum: 15"
            },
            "state": {
             "type": "string",
             "description": "The state of your contact\n\nMaximum: 100",
             "maxLength": 100
            },
            "postal_code": {
             "type": "string",
             "description": "The postal code of your contact\n\nMaximum: 25",
             "maxLength": 25
            },
            "contact_type": {
             "type": "string",
             "description": "Allowed values - active, bounce, abuse, unsubscribe, suppressed, spam complaints\n\nDefault: active",
             "default": "active"
            },
            "tags": {
             "type": "array",
             "items": {}
            }
           },
           "required": [
            "email"
           ]
          }
         },
         "list_id": {
          "type": "string",
          "description": "The contact list id to which you want to add this contact"
         }
        },
        "required": [
         "contacts",
         "list_id"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "contacts": [
           {
            "city": "string",
            "country": "string",
            "custom_fields": {
             "enc_id1": "string",
             "enc_id2": 0
            },
            "department": "string",
            "email": "string",
            "industry": "string",
            "job_title": "string",
            "last_name": "string",
            "lead_source": "string",
            "middle_name": "string",
            "name": "string",
            "company_name": "string",
            "phone": "string",
            "salary": 0,
            "state": "string",
            "postal_code": "string",
            "tags": [
             "string"
            ]
           }
          ],
          "list_id": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "inserted": {
             "type": "number"
            },
            "skipped": {
             "type": "number"
            },
            "submitted": {
             "type": "number"
            },
            "updated": {
             "type": "number"
            }
           }
          },
          "message": {
           "type": "string",
           "minLength": 1
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "data": {
            "inserted": 2,
            "skipped": 1,
            "submitted": 3,
            "updated": 0
           },
           "message": "Batch contacts processed"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "email",
            "message": "Invalid email"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/list": {
   "post": {
    "summary": "Create a New List",
    "operationId": "create-a-new-list",
    "description": "Your Mailercloud list, also known as your recipient, is where you store and manage all of your contacts.",
    "tags": [
     "Lists"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "list_type": {
          "type": "number",
          "description": "Your List type .\n\nAvailable Choices\n\nNormal List: 1",
          "default": 1
         },
         "name": {
          "type": "string",
          "description": "Your List name. \nOnly alphanumeric characters, underscore, hyphen, dot and space allowed.\n\nMinimum: 3\nMaximum: 100",
          "minLength": 3,
          "maxLength": 100,
          "pattern": "^[a-zA-Z0-9._ \\-]+$/i"
         }
        },
        "required": [
         "list_type",
         "name"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "list_type": 1,
          "name": "Email subscription-list"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {}
        },
        "examples": {
         "example-1": {
          "value": {
           "id": "xyz"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "name",
            "message": "The name field must be at least 3 characters"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/list/{id}": {
   "patch": {
    "summary": "Update a List",
    "operationId": "update-a-list",
    "description": "Update the details of a specific list by id. However, you can only update the names using this API",
    "tags": [
     "Lists"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "List Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "minLength": 3,
          "description": "Your List name. \nOnly alphanumeric characters, underscore, hyphen, dot and space allowed.\n\nMinimum: 3\nMaximum: 100",
          "maxLength": 100,
          "pattern": "^[a-zA-Z0-9._ \\-]+$/i"
         }
        },
        "required": [
         "name"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "name": "Subscibers List"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "listdetails": {
           "type": "object",
           "properties": {
            "list_type": {
             "type": "string",
             "minLength": 1
            },
            "name": {
             "type": "string",
             "minLength": 1
            }
           },
           "required": [
            "id",
            "list_type",
            "name"
           ]
          }
         },
         "required": [
          "listdetails"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "listdetails": {
            "id": "HHda",
            "list_type": "Normal",
            "name": "List Registration"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "name",
             "message": "Only alphanumeric characters, underscore, hyphen, dot and space allowed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete a List",
    "operationId": "delete-a-list",
    "description": "This API deletes a specific list by id. However, you can't delete your list if its used in an active campaign , active automation or in an active webform .",
    "tags": [
     "Lists"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "List Id",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "string"
        },
        "examples": {
         "example-1": {
          "value": {
           "message": "List deleted successfully"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "get": {
    "summary": "Get Single List Details",
    "operationId": "get-single-list-details",
    "description": "Get single list details based on id.",
    "tags": [
     "Lists"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "List Id",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number"
          },
          "data": {
           "type": "object",
           "properties": {
            "contact_count": {
             "type": "number"
            },
            "list_status": {
             "type": "string",
             "minLength": 1
            },
            "list_type": {
             "type": "string",
             "minLength": 1
            },
            "name": {
             "type": "string",
             "minLength": 1
            },
            "open_percentage": {
             "type": "number"
            }
           },
           "required": [
            "contact_count",
            "id",
            "list_status",
            "list_type",
            "name",
            "open_percentage"
           ]
          }
         },
         "required": [
          "count",
          "data"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 10,
           "data": {
            "contact_count": 1000,
            "id": "xze",
            "list_status": "Waiting for approval",
            "list_type": "Normal List",
            "name": "Email subscription-list",
            "open_percentage": 50
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "field",
             "message"
            ],
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "errors"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         },
         "example-2": {
          "value": {
           "errors": [
            {
             "field": "string",
             "message": "string"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/lists/search": {
   "post": {
    "summary": "List Lists",
    "operationId": "get-all-list-and-search-list",
    "description": "Use this API to return an array of all of your contact lists. You can filter, search  and sort list.",
    "tags": [
     "Lists"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return. \n\nMaximum: 100\nMinimum: 10",
          "minimum": 10,
          "maximum": 100
         },
         "list_type": {
          "type": "number",
          "description": "Your List type .\n\nAvailable Choices\n\nNormal List: 1"
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1",
          "maximum": 3
         },
         "search_name": {
          "type": "string",
          "minLength": 1,
          "description": "Filter list by name , giving name in search keyword "
         },
         "sort_field": {
          "type": "string",
          "minLength": 1,
          "description": "Sort list data based on this field\n\nAvailable sort fields\n\nname,contact_count,open_percentage"
         },
         "sort_order": {
          "type": "string",
          "minLength": 1,
          "description": "Sorting order for sort field\n\nAvailable sort orders\n \nasc, ASC, desc, DESC "
         }
        },
        "required": [
         "limit",
         "list_type",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 10,
          "list_type": 1,
          "page": 1,
          "search_name": "subscription",
          "sort_field": "name",
          "sort_order": "asc"
         }
        },
        "example-2": {
         "value": {
          "limit": 10,
          "page": 10
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number"
          },
          "data": {
           "type": "object",
           "properties": {
            "contact_count": {
             "type": "number"
            },
            "list_status": {
             "type": "string",
             "minLength": 1
            },
            "list_type": {
             "type": "string",
             "minLength": 1
            },
            "name": {
             "type": "string",
             "minLength": 1
            },
            "open_percentage": {
             "type": "number"
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 100,
           "data": {
            "contact_count": 100,
            "id": "ws",
            "list_status": "Updating",
            "list_type": "Normal List",
            "name": "Subscription list",
            "open_percentage": 50
           }
          }
         },
         "example-2": {
          "value": {
           "data": {
            "0": {
             "contact_count": "1",
             "id": "hXUA",
             "list_status": "Updating",
             "list_type": "Normal",
             "name": "List Registration",
             "open_percentage": "0.00"
            },
            "1": {
             "contact_count": "0",
             "id": "YxGF",
             "list_status": "Uploading",
             "list_type": "Normal",
             "name": "Form 1",
             "open_percentage": "0.00"
            },
            "2": {
             "contact_count": "2",
             "id": "xhef",
             "list_status": "Waiting for approval",
             "list_type": "Normal",
             "name": "sample 2 updated",
             "open_percentage": "0.00"
            },
            "3": {
             "contact_count": "1",
             "id": "ixss",
             "list_status": "Verifying",
             "list_type": "Normal",
             "name": "uptest up test on",
             "open_percentage": "0.00"
            },
            "4": {
             "contact_count": "1",
             "id": "yFXf",
             "list_status": "Verifying",
             "list_type": "Normal",
             "name": "list f updated",
             "open_percentage": "0.00"
            },
            "5": {
             "contact_count": "0",
             "id": "IXCa",
             "list_status": "",
             "list_type": "Normal",
             "name": "test ddd List-23 Feb 2021 04.22 PM",
             "open_percentage": "0.00"
            },
            "6": {
             "contact_count": "0",
             "id": "iFfF",
             "list_status": "Verifying new contacts",
             "list_type": "Normal",
             "name": "string nnnnn",
             "open_percentage": "0.00"
            },
            "7": {
             "contact_count": "0",
             "id": "iFEh",
             "list_status": "Verifying new contacts",
             "list_type": "Normal",
             "name": "string",
             "open_percentage": "0.00"
            },
            "8": {
             "contact_count": "0",
             "id": "yDJX",
             "list_status": "Verifying new contacts",
             "list_type": "Normal",
             "name": "lucky list                 ",
             "open_percentage": "0.00"
            },
            "9": {
             "contact_count": "0",
             "id": "iDXJ",
             "list_status": "Verifying new contacts",
             "list_type": "Normal",
             "name": "lucksy renamed 1",
             "open_percentage": "0.00"
            }
           },
           "list_count": 56
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "error": {
            "field": "sort_order",
            "message": "Invalid sort_order"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/segment/search": {
   "post": {
    "summary": "List Segment",
    "operationId": "list-segment",
    "description": "List all your created segments.",
    "tags": [
     "Segments"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": false,
      "description": "application/json",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return.\n\nMaximum: 100 Minimum: 10"
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1"
         },
         "search": {
          "type": "string",
          "minLength": 1,
          "description": "Filter segment list by name , giving name as search keyword "
         },
         "sort_field": {
          "type": "string",
          "minLength": 1,
          "description": "Sort segment list data based on the following field.\n\nAvailable sort fields: name,active_count "
         },
         "sort_order": {
          "type": "string",
          "minLength": 1,
          "description": "Sorting order for sort field\n\nAvailable sort orders\n\nasc, ASC, desc, DESC"
         }
        },
        "required": [
         "limit",
         "page",
         "search",
         "sort_field",
         "sort_order"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 10,
          "page": 1
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number"
          },
          "data": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "required": [
             "active_count",
             "id",
             "list",
             "name"
            ],
            "properties": {
             "active_count": {
              "type": "number"
             },
             "list": {
              "type": "string",
              "minLength": 1
             },
             "name": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         },
         "required": [
          "count",
          "data"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 2,
           "data": [
            {
             "active_count": 8690337,
             "id": "KyGa",
             "list": "Default List,Sending list,sending list 2,Auto Test 3,Auto Test 0,Auto Test 1,Auto list New,List bounce,Multy domain,lowww,List10lac1,LIST10lac2,List10lac3,List10lac4,List10Lac6,Fineecho copy paste,List auto test -1,List auto test -2,Vinmail Open,list vinmail,Tb live test-Multydomain,Api test",
             "name": "Sending list-1"
            },
            {
             "active_count": 8408779,
             "id": "Kxwf",
             "list": "Default List,Sending list,sending list 2,Auto Test 3,Auto Test 0,Auto Test 1,Auto list New,List bounce,Multy domain,lowww,List10lac1,LIST10lac2,List10lac3,List10lac4,List10Lac6,Fineecho copy paste,List auto test -1,List auto test -2,Vinmail Open",
             "name": "ryth"
            }
           ]
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error_code": {
           "type": "integer"
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/segments": {
   "post": {
    "summary": "Create Segment",
    "operationId": "create-segment",
    "description": "API to create a segment in a single request. `name`, `match` and `rules` are required. `lists` is optional - if omitted, the segment evaluates against all contacts.\n\nA segment is a dynamic contact filter built from a list of rules. Each rule belongs to one of 4 filter_types: `contact_details` (built-in contact fields), `contact_property` (custom properties), `tag` (contact tags), or `activity` (campaign / automation / engagement events). The `match` field controls whether ALL rules must match (`all`) or ANY rule is enough (`any`).",
    "tags": [
     "Segments"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "match",
         "rules"
        ],
        "properties": {
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "description": "Segment display name. Must be unique within the account.\n\nMinimum: 1\nMaximum: 100"
         },
         "match": {
          "type": "string",
          "enum": [
           "all",
           "any"
          ],
          "description": "How rules combine.\n\nall: every rule must match (AND)\nany: at least one rule must match (OR)\n\nSupported values: all, any"
         },
         "lists": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 150,
          "description": "Optional. Restrict the segment to contacts in these lists. Provide list names (cid-scoped). Maximum 150 lists."
         },
         "rules": {
          "type": "array",
          "minItems": 1,
          "description": "Filter rules. At least one rule is required.",
          "items": {
           "type": "object",
           "required": [
            "filter_type"
           ],
           "properties": {
            "filter_type": {
             "type": "string",
             "enum": [
              "contact_details",
              "contact_property",
              "tag",
              "activity"
             ],
             "description": "Type of filter rule.\n\ncontact_details: built-in contact fields (email_status, contact_rating, email_domain, etc.)\ncontact_property: custom field defined in your account\ntag: contact tags (encrypted tag IDs)\nactivity: campaign / automation / engagement events\n\nSupported values: contact_details, contact_property, tag, activity"
            },
            "field": {
             "type": "string",
             "description": "Field name. Required for contact_details and contact_property.\n\nFor contact_details, allowed values: email_status, verification_status, contact_rating, email_domain, mailbox_provider, signup_source\n\nFor contact_property, use the property mapping_name (e.g. custom_1, country, salary). Must match ^[A-Za-z0-9_]+$\n\nNote: verification_status is a write-side alias and collapses to email_status in storage; GET round-trip always returns field=email_status."
            },
            "property_type": {
             "type": "string",
             "enum": [
              "text",
              "number",
              "date"
             ],
             "description": "For contact_property only. Picks the operator family. Defaults from the custom field's type in gyh_custom_fields if omitted."
            },
            "operator": {
             "type": "string",
             "description": "Comparison operator. Allowed values depend on the filter_type / field / property_type.\n\nText operators: equal_to (also accepts is, equals), not_equal_to (also is_not), exact_match, contains, does_not_contain, starts_with, does_not_start_with, ends_with, does_not_end_with, any_of, is_known, is_unknown\n\nNumber operators (per PR #142 operator-canonical fix): equal_to (canonical, also accepts equal_to_number, is_number), not_equal_to (canonical, also accepts not_equal_to_number), less_than, less_than_number (verbatim - kept distinct because of its SQL > 0 guard), greater_than, between, is_known_number, is_unknown_number\n\nDate operators: in_the_last_days (also in_last_days), not_in_the_last_days, date_between, on_a_specific_date, is_after, is_before, date_is_not, date_is_known, date_is_unknown\n\nTag operators: is_tagged, is_not_tagged\n\nemail_status field: equal_to, not_equal_to, any_of\nsignup_source field: was, was_not"
            },
            "value": {
             "description": "Filter value. Type depends on operator.\n\nText/number equality: string or number\nany_of: array of strings\nbetween: { from: number, to: number }\ndate_between: { from: YYYY-MM-DD, to: YYYY-MM-DD }\nin_the_last_days / not_in_the_last_days: integer 1-365\nis_known / is_unknown / is_known_number / is_unknown_number / date_is_known / date_is_unknown / is_empty / is_not_empty: omit value\n\nemail_status enum: valid, unknown, suppressed, unsubscribed, spam, bounced, external_group_mailbox, spam_trap, external_abusers, external_invalid, spam_complaints, frequent_abusers, external_verified, blacklisted, account_level_bounce\n\nsignup_source enum: admin_add, import, api, webform"
            },
            "filter_by": {
             "type": "string",
             "description": "Sub-selector for tag and activity rules.\n\nFor tag filter_type with is_tagged / is_not_tagged: any_of, all_of\n\nFor activity filter_type: any_of_the_last_five, all_of_the_last_five, any_of_last_seven_day, any_of_last_one_month, any_of_last_three_month, between, in_the_last_days, not_in_the_last_days, count, count_between, order_by_count, before, after, on, for, between_time"
            },
            "category": {
             "type": "string",
             "enum": [
              "campaign",
              "automation",
              "webform",
              "list",
              "audience",
              "engagement_status",
              "global_engagers",
              "global_openers",
              "subscriber_opened",
              "subscriber_clicked"
             ],
             "description": "Activity category. Required when filter_type=activity.\n\nSupported values: campaign, automation, webform, list, audience, engagement_status, global_engagers, global_openers, subscriber_opened, subscriber_clicked"
            },
            "activity": {
             "type": "string",
             "description": "Activity event name. Required for some activity categories (campaign, automation, webform, list, audience).\n\nSupported values: opened, not_opened, clicked, not_clicked, sent, not_sent, started, completed, not_started, not_completed, happened, not_happened"
            }
           }
          }
         }
        }
       },
       "examples": {
        "Example-1---Active-gmail-subscribers": {
         "value": {
          "name": "Active gmail subscribers",
          "match": "all",
          "lists": [
           "Newsletter Subscribers"
          ],
          "rules": [
           {
            "filter_type": "contact_details",
            "field": "email_status",
            "operator": "equal_to",
            "value": "valid"
           },
           {
            "filter_type": "contact_details",
            "field": "email_domain",
            "operator": "contains",
            "value": "gmail"
           }
          ]
         }
        },
        "Example-2---High-rated-US-contacts-engaged-last-30-days": {
         "value": {
          "name": "Engaged US contacts - last 30 days",
          "match": "all",
          "rules": [
           {
            "filter_type": "contact_details",
            "field": "contact_rating",
            "operator": "between",
            "value": {
             "from": 3,
             "to": 5
            }
           },
           {
            "filter_type": "contact_property",
            "field": "country",
            "property_type": "text",
            "operator": "equal_to",
            "value": "United States"
           },
           {
            "filter_type": "activity",
            "category": "campaign",
            "activity": "opened",
            "filter_by": "in_the_last_days",
            "value": 30
           }
          ]
         }
        },
        "Example-3---VIP-tag-OR-signed-up-via-API-in-last-7-days": {
         "value": {
          "name": "VIP or recent API signups",
          "match": "any",
          "rules": [
           {
            "filter_type": "tag",
            "operator": "is_tagged",
            "filter_by": "any_of",
            "value": [
             "enc_t1",
             "enc_t2"
            ]
           },
           {
            "filter_type": "contact_details",
            "field": "signup_source",
            "operator": "was",
            "value": "api"
           },
           {
            "filter_type": "activity",
            "category": "list",
            "activity": "happened",
            "filter_by": "in_the_last_days",
            "value": 7
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {}
        },
        "examples": {
         "Example-1": {
          "value": {
           "id": "EKZwS"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request - validation, name resolution, or operator-shape failure",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "rules[0].field",
             "message": "Unknown contact_details field 'foo'"
            },
            {
             "field": "rules[1].value",
             "message": "between requires { from, to }"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Forbidden - caller's plan does not include segmentation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Plan does not include segmentation"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Internal server error"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/senders/search": {
   "post": {
    "summary": "List Senders",
    "operationId": "get-all-senders-and-search-senders",
    "description": "Use this API to return an array of all your active and verified sender email addresses with sender name and reply-to email. You can filter, search and sort senders.",
    "tags": [
     "Senders"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return.\n\nMaximum: 100\nMinimum: 10",
          "minimum": 10,
          "maximum": 100
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1",
          "minimum": 1
         },
         "search": {
          "type": "string",
          "maxLength": 255,
          "description": "Filter senders by email or name. Partial match is supported."
         },
         "sort_field": {
          "type": "string",
          "description": "Sort sender data based on this field.\n\nAvailable sort fields: sender_email, sender_name, created_date"
         },
         "sort_order": {
          "type": "string",
          "description": "Sorting order for sort field.\n\nAvailable sort orders: asc, ASC, desc, DESC"
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 10,
          "page": 1,
          "search": "marketing",
          "sort_field": "sender_email",
          "sort_order": "asc"
         }
        },
        "example-2": {
         "value": {
          "limit": 20,
          "page": 1
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number",
           "description": "Total number of senders matching the search criteria"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "sender_email": {
              "type": "string",
              "description": "Sender email address"
             },
             "sender_name": {
              "type": "string",
              "description": "Display name of the sender"
             },
             "createdDate": {
              "type": "string",
              "description": "Creation date of the sender record"
             },
             "status": {
              "type": "string",
              "description": "Sender status. Values: Verified, Pending"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 2,
           "data": [
            {
             "id": "hXUA",
             "sender_email": "sender1@example.com",
             "sender_name": "Marketing Team",
             "createdDate": "2025-01-01 10:00:00",
             "status": "Verified"
            },
            {
             "id": "YxGF",
             "sender_email": "support@example.com",
             "sender_name": "Support",
             "createdDate": "2025-01-02 10:00:00",
             "status": "Verified"
            }
           ]
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "sort_field",
             "message": "Invalid sort_field"
            }
           ]
          }
         },
         "example-2": {
          "value": {
           "errors": [
            {
             "field": "sort_order",
             "message": "Invalid sort_order"
            }
           ]
          }
         },
         "example-3": {
          "value": {
           "errors": [
            {
             "field": "limit",
             "message": "limit must be at least 10"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/reply-emails/search": {
   "post": {
    "summary": "List Reply Emails",
    "operationId": "get-all-reply-emails-and-search-reply-emails",
    "description": "Use this API to return an array of all your active reply-to email addresses. You can filter and search reply emails with pagination.",
    "tags": [
     "Senders"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "description": "",
        "type": "object",
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return.\n\nMaximum: 100\nMinimum: 10",
          "minimum": 10,
          "maximum": 100
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1",
          "minimum": 1
         },
         "search": {
          "type": "string",
          "maxLength": 255,
          "description": "Filter reply emails by email address. Partial match is supported."
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 10,
          "page": 1,
          "search": "support@"
         }
        },
        "example-2": {
         "value": {
          "limit": 20,
          "page": 1
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "count": {
           "type": "number",
           "description": "Total number of reply emails matching the search criteria"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "reply_email": {
              "type": "string",
              "description": "Reply-to email address"
             },
             "status": {
              "type": "string",
              "description": "Reply email status. Values: Verified, Pending"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "count": 2,
           "data": [
            {
             "id": "ixss",
             "reply_email": "reply1@example.com",
             "status": "Verified"
            },
            {
             "id": "yFXf",
             "reply_email": "support@example.com",
             "status": "Verified"
            }
           ]
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string",
              "minLength": 1
             },
             "message": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "limit",
             "message": "limit must be at least 10"
            }
           ]
          }
         },
         "example-2": {
          "value": {
           "errors": [
            {
             "field": "page",
             "message": "page is required"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "minLength": 1
            },
            "message": {
             "type": "string",
             "minLength": 1
            }
           }
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/client/plan": {
   "get": {
    "summary": "Client Details",
    "operationId": "client-details",
    "description": "API to get current user details",
    "tags": [
     "Account"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "x-examples": {
          "example-1": {
           "data": {
            "email": "user@example.com",
            "name": "MailerCloud User",
            "plan": "Enterprise plan",
            "remaining_contacts": 943,
            "total_contacts": 1000,
            "used_contacts": 57
           }
          }
         },
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "email": {
             "type": "string",
             "minLength": 1,
             "description": "Client email"
            },
            "name": {
             "type": "string",
             "minLength": 1,
             "description": "Client name"
            },
            "plan": {
             "type": "string",
             "minLength": 1,
             "description": "Client current plan"
            },
            "remaining_contacts": {
             "type": "number",
             "description": "Remaining contact for client"
            },
            "total_contacts": {
             "type": "number",
             "description": "Total contacts for client"
            },
            "used_contacts": {
             "type": "number",
             "description": "Client used contact count"
            }
           }
          }
         },
         "required": [
          "data"
         ]
        },
        "examples": {
         "example-1": {
          "value": {
           "data": {
            "email": "user@example.com",
            "name": "MailerCloud User",
            "plan": "Enterprise plan",
            "remaining_contacts": 943,
            "total_contacts": 1000,
            "used_contacts": 57
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/webform/search": {
   "post": {
    "summary": "Webform List",
    "operationId": "webform-list",
    "description": "Use this API to return an array of all of your webforms. You can filter, search and sort webforms.",
    "tags": [
     "Webforms"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": false,
      "description": "application/json",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "x-examples": {
         "example-1": {
          "limit": 0,
          "page": 0,
          "search": "string",
          "sort_field": "string",
          "sort_order": "string",
          "date_from": "string",
          "date_to": "string",
          "status": "string"
         }
        },
        "properties": {
         "limit": {
          "type": "number",
          "description": "Maximum number of elements to return.\n\nMaximum: 100 Minimum: 10"
         },
         "page": {
          "type": "number",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1"
         },
         "search": {
          "type": "string",
          "minLength": 1,
          "description": "Filter form by name , giving name in search keyword"
         },
         "sort_field": {
          "type": "string",
          "minLength": 1,
          "description": "Sort list data based on this field\n\nAvailable sort fields - name, modifiedDate, view_count, submission_count, new_contact_count"
         },
         "sort_order": {
          "type": "string",
          "minLength": 1,
          "description": "If sort_field is given then sort_order is required\n\nSorting order for sort field\n\nAvailable sort orders - asc, ASC, desc, DESC"
         },
         "date_from": {
          "type": "string",
          "minLength": 1,
          "description": "Filter forms based on modified date."
         },
         "date_to": {
          "type": "string",
          "minLength": 1,
          "description": "Filter forms based on modified date."
         },
         "status": {
          "type": "string",
          "minLength": 1,
          "description": "Filter forms based on status. Set status to Active to get forms with embed code.\n\nAvailable status \u2013 Active, Inactive, Draft, Duplicate"
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "example-1": {
         "value": {
          "limit": 0,
          "page": 0,
          "search": "string",
          "sort_field": "string",
          "sort_order": "string",
          "date_from": "string",
          "date_to": "string",
          "status": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "description": "",
         "type": "object",
         "x-examples": {
          "example-1": {
           "count": 1,
           "data": [
            {
             "embed_code": "<script charset=\"utf-8\" type=\"text/javascript\" src=\"https://js.mailercloud.com/form/form.js\"><\\/script>\n<script>\n(function() {\n  mcform.create({\n    formId: \"RUV1QDI1NjBAMDAwMDAwMA==\",\n    targetElement: \"form_element_id\"\n  })\n})();\n<\\/script>",
             "id": "RUV1QDI1NjBAMDAwMDAwMA==",
             "last_updated": "2021-08-25 20:48:29",
             "linked_list": "weee List-25 Aug 2021 08.48 PM",
             "name": "weee",
             "new_contact_count": 1,
             "status": "Active",
             "submission_count": 2,
             "type": "Embedded form",
             "view_count": 6
            }
           ]
          }
         },
         "properties": {
          "count": {
           "type": "number"
          },
          "data": {
           "type": "array",
           "uniqueItems": true,
           "minItems": 1,
           "items": {
            "type": "object",
            "properties": {
             "embed_code": {
              "type": "string",
              "minLength": 1
             },
             "id": {
              "type": "string",
              "minLength": 1,
              "description": "Unique identifier of the webform."
             },
             "last_updated": {
              "type": "string",
              "minLength": 1
             },
             "linked_list": {
              "type": "string",
              "minLength": 1
             },
             "name": {
              "type": "string",
              "minLength": 1
             },
             "new_contact_count": {
              "type": "number",
              "description": "Number of NEW contacts created through the form - submissions from addresses that were not already in your audience. Lifetime total for the form, summed across all of its versions (republishing a form starts a new version and its counters keep accumulating here)."
             },
             "status": {
              "type": "string",
              "minLength": 1
             },
             "submission_count": {
              "type": "number",
              "description": "Number of submissions the form has received. Lifetime total for the form, summed across all of its versions (republishing a form starts a new version and its counters keep accumulating here)."
             },
             "type": {
              "type": "string",
              "minLength": 1
             },
             "view_count": {
              "type": "number",
              "description": "Number of times the form has been viewed. Lifetime total for the form, summed across all of its versions (republishing a form starts a new version and its counters keep accumulating here)."
             }
            }
           }
          }
         }
        },
        "examples": {
         "example-1": {
          "value": {
           "value": {
            "count": 0,
            "data": [
             {
              "embed_code": "string",
              "id": "string",
              "last_updated": "string",
              "linked_list": "string",
              "name": "string",
              "new_contact_count": 0,
              "status": "string",
              "submission_count": 0,
              "type": "string",
              "view_count": 0
             }
            ]
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/tags": {
   "post": {
    "summary": "Create Tag",
    "operationId": "create-tag",
    "description": "API for creating tags for contacts and campaign.",
    "tags": [
     "Tags"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "Name of your tag",
          "minLength": 1,
          "maxLength": 100
         }
        },
        "required": [
         "name"
        ]
       },
       "examples": {
        "Example-1": {
         "value": {
          "name": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {}
        },
        "examples": {
         "Example-1": {
          "value": {
           "id": "xyz"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": {
            "field": "name",
            "message": "Name must be a maximum of 100 characters in length"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {}
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/tags/search": {
   "post": {
    "summary": "List Tags",
    "operationId": "list-tags",
    "description": "Using this API, you can list all the tags of your contacts and campaign in your Mailercloud account",
    "tags": [
     "Tags"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "limit": {
          "type": "integer",
          "minimum": 10,
          "maximum": 100,
          "description": "Maximum number of elements to return"
         },
         "page": {
          "type": "integer",
          "minimum": 1,
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page."
         },
         "search": {
          "type": "string",
          "description": "Filter list by name , giving name in search keyword"
         }
        },
        "required": [
         "limit",
         "page"
        ]
       },
       "examples": {
        "Example-1": {
         "value": {
          "limit": 10,
          "page": 1,
          "search": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "count": {
           "type": "integer"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "count": 0,
           "data": {
            "id": "string",
            "tag_name": "string"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Invalid input"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/tags/{id}": {
   "put": {
    "summary": "Update Tag",
    "operationId": "update-tag",
    "description": "API for updating tag name of contacts and campaign.",
    "tags": [
     "Tags"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Tag Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": false,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "Name of tag",
          "minLength": 1,
          "maxLength": 100
         }
        },
        "required": [
         "name"
        ]
       },
       "examples": {
        "Example-1": {
         "value": {
          "name": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {}
        },
        "examples": {
         "Example-1": {
          "value": {
           "id": "YCJ"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": {
            "field": "name",
            "message": "Name must be a maximum of 100 characters in length"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {}
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {}
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Tag",
    "operationId": "delete-tag",
    "description": "This API deletes a specific tag by id.",
    "tags": [
     "Tags"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Tag Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Tag deleted successfully"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/webhooks": {
   "post": {
    "summary": "Create a New Webhook",
    "operationId": "create-a-new-webhook",
    "description": "Mailercloud webhook is a mechanism that allows external systems to receive real-time updates and notifications about events occurring within your account.",
    "tags": [
     "Webhooks"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "url",
         "events"
        ],
        "properties": {
         "name": {
          "type": "string",
          "description": "Name of your Webhook.\n\nMinimum: 3\nMaximum: 100",
          "minLength": 3,
          "maxLength": 100,
          "pattern": "^[a-zA-Z0-9._ \\-]+$/i"
         },
         "url": {
          "type": "string",
          "description": "Specify the URL where webhook payloads will be delivered.\n    \nSupported URL Protocols - HTTP, HTTPS"
         },
         "events": {
          "type": "array",
          "description": "List the specific events that you would want to trigger webhook.\n\nSupported events :\n\n    \"campaign_sent\",\n    \"campaign_opened\",\n    \"campaign_clicked\",\n    \"unsubscribe\",\n    \"campaign_error\",\n    \"spam\",\n    \"hard_bounce\"",
          "minItems": 0,
          "maxItems": 7,
          "items": {
           "type": "string"
          }
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "name": "Test Webhook",
          "url": "https://example.com",
          "events": [
           "campaign_sent",
           "campaign_opened"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {},
         "x-examples": {
          "Example 1": {}
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "id": "DS"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "field": {
           "type": "string"
          },
          "message": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "field": "dedkoie",
           "message": "djieji"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": {
            "field": "url",
            "message": "url is not valid"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/webhooks/{id}": {
   "put": {
    "summary": "Update a Webhook",
    "operationId": "update-a-webhook",
    "description": "API for modifying webhook information. This allows you to update the webhook's name, URL, and events.",
    "tags": [
     "Webhooks"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Webhook Id",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "x-examples": {
         "Example 1": {
          "name": "Test Webhook",
          "url": "https://example.com",
          "events": [
           "campaign_sent",
           "campaign_opened"
          ]
         }
        },
        "required": [
         "name",
         "url",
         "events"
        ],
        "properties": {
         "name": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9._ \\-]+$/i",
          "minLength": 3,
          "maxLength": 100,
          "description": "Updated name of your Webhook."
         },
         "url": {
          "type": "string",
          "description": "Updated URL for your webhook.\n    \nSupported URL Protocols - HTTP, HTTPS"
         },
         "events": {
          "type": "array",
          "minItems": 0,
          "maxItems": 7,
          "description": "List the specific events that you would want to trigger webhook.\n\nSupported events :\n\n    \"campaign_sent\",\n    \"campaign_opened\",\n    \"campaign_clicked\",\n    \"unsubscribe\",\n    \"campaign_error\",\n    \"spam\",\n    \"hard_bounce\"",
          "items": {
           "type": "string"
          }
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "name": "Test Webhook",
          "url": "https://example.com",
          "events": [
           "campaign_sent",
           "campaign_opened"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "message": "Updated the webhook successfully"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Updated the webhook successfully"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string"
            },
            "message": {
             "type": "string"
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "error": {
            "field": "url",
            "message": "url is not valid"
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": {
            "field": "url",
            "message": "url is not valid"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete a Webhook",
    "operationId": "delete-a-webhook",
    "description": "This API deletes a specific webhook by id.",
    "tags": [
     "Webhooks"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Webhook Id",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "message": "Deleted the webhook"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Deleted the webhook successfully"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "Record not found with the given Id"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Record not found with the given Id"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/webhooks/detail/{id}": {
   "get": {
    "summary": "Get Webhook Details",
    "operationId": "get-webhook-details",
    "description": "Get webhook details based on their ID",
    "tags": [
     "Webhooks"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Webhook Id",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "webhook": {
           "type": "object",
           "properties": {
            "created_date": {
             "type": "string"
            },
            "event": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "modified_date": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "status": {
             "type": "string"
            },
            "url": {
             "type": "string"
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "webhook": {
            "created_date": "2024-02-14 18:10:49",
            "event": [
             "campaign_sent",
             "campaign_opened",
             "campaign_clicked",
             "campaign_error",
             "spam",
             "hard_bounce",
             "unsubscribe"
            ],
            "modified_date": "2024-02-14 18:10:49",
            "name": "new webhook",
            "status": "Active",
            "url": "https://www.example.com"
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "webhook": {
            "created_date": "2024-02-14 18:10:49",
            "event": [
             "campaign_sent",
             "campaign_opened",
             "campaign_clicked",
             "campaign_error",
             "spam",
             "hard_bounce",
             "unsubscribe"
            ],
            "id": "SKuK",
            "modified_date": "2024-02-14 18:10:49",
            "name": "new webhook",
            "status": "Active",
            "url": "https://www.example.com"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "Record not found with the given Id"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Record not found with the given Id"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/webhooks/search": {
   "post": {
    "summary": "Search and List Webhooks",
    "operationId": "search-and-list-webhooks",
    "description": "API to list all webhooks with the ability to search, filter, and sort the results.",
    "tags": [
     "Webhooks"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "x-examples": {
         "Example 1": {
          "limit": 10,
          "page": 1,
          "search": "test",
          "sort_field": "name",
          "sort_order": "asc"
         }
        },
        "required": [
         "limit",
         "page"
        ],
        "properties": {
         "limit": {
          "type": "integer",
          "description": "Maximum number of elements to return. \n\nMinimum: 10\nMaximum: 100\n",
          "minimum": 10,
          "maximum": 100
         },
         "page": {
          "type": "integer",
          "description": "You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.\n\nStarts From: 1",
          "minimum": 1
         },
         "search": {
          "type": "string",
          "description": "Filter webhook by searching through webhook name or url.\n"
         },
         "sort_field": {
          "type": "string",
          "description": "Sort webhook data based on this field.\n\nSupported sort fields:\n\n    - name\n    - url   \n    - modified_date"
         },
         "sort_order": {
          "type": "string",
          "description": "Sorting order for sort field.\n\nSupported sort orders:\n \nasc, ASC, desc, DESC "
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "limit": 10,
          "page": 1,
          "search": "",
          "sort_field": "name",
          "sort_order": "asc"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "created_date": {
              "type": "string"
             },
             "event": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "modified_date": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "status": {
              "type": "integer"
             },
             "url": {
              "type": "string"
             }
            }
           }
          },
          "max_webhook_limit": {
           "type": "integer"
          },
          "total": {
           "type": "integer"
          },
          "webhook_count": {
           "type": "integer"
          }
         },
         "x-examples": {
          "Example 1": {
           "data": [
            {
             "created_date": "2024-02-06 14:33:23",
             "event": [
              "campaign_sent",
              "campaign_opened",
              "campaign_clicked",
              "campaign_error",
              "spam",
              "hard_bounce",
              "unsubscribe"
             ],
             "modified_date": "2024-02-06 14:33:23",
             "name": "gf",
             "status": 0,
             "url": "https://example.com/hooks/mailercloud"
            }
           ],
           "max_webhook_limit": 50,
           "total": 2,
           "webhook_count": 2
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "data": [
            {
             "created_date": "2024-02-15 17:06:56",
             "event": [
              "campaign_sent",
              "campaign_opened",
              "campaign_clicked",
              "campaign_error",
              "spam",
              "hard_bounce",
              "unsubscribe"
             ],
             "id": "f",
             "modified_date": "2024-02-16 16:05:52",
             "name": "Main webhook",
             "status": 1,
             "url": "https://www.randomurl1.com"
            },
            {
             "created_date": "2024-02-15 17:05:51",
             "event": [
              "campaign_sent",
              "campaign_opened",
              "campaign_clicked",
              "campaign_error",
              "spam",
              "hard_bounce",
              "unsubscribe"
             ],
             "id": "E",
             "modified_date": "2024-02-16 16:05:18",
             "name": "new webhook",
             "status": 1,
             "url": "https://www.randomurl2.com"
            },
            {
             "created_date": "2024-02-16 13:50:30",
             "event": [
              "campaign_sent",
              "campaign_opened"
             ],
             "id": "KK",
             "modified_date": "2024-02-16 15:57:18",
             "name": "Test Webhook",
             "status": 0,
             "url": "https://www.randomurl3.com"
            }
           ],
           "max_webhook_limit": 20,
           "total": 10,
           "webhook_count": 3
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "error": [
            {
             "field": "limit",
             "message": "Limit is a required field"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": [
            {
             "field": "limit",
             "message": "Limit is a required field"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/webhooks/test": {
   "post": {
    "summary": "Test Webhook",
    "operationId": "test-webhook",
    "description": "API to send dummy trigger requests to the webhook URL for testing purposes.",
    "tags": [
     "Webhooks"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "application/json",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "x-examples": {
         "Example 1": {
          "parameter": "https://www.example.com",
          "events": [
           "campaign_sent"
          ]
         }
        },
        "required": [
         "parameter"
        ],
        "properties": {
         "parameter": {
          "type": "string",
          "description": "Webhook Id\n"
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "parameter": "ks"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "message": "success"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "success"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "Invalid Parameter"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Invalid Parameter"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/webhooks/toggle/{id}": {
   "post": {
    "summary": "Toggle Webhook Status",
    "operationId": "toggle-webhook-status",
    "description": "API for deactivating or activating the status of a webhook.",
    "tags": [
     "Webhooks"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Webhook Id",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "x-examples": {
         "Example 1": {
          "status": "1"
         }
        },
        "required": [
         "status"
        ],
        "properties": {
         "status": {
          "type": "string",
          "description": "To activate a webhook set status : 1\n\nTo deactivate a webhook set status : 0"
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "status": "1"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "message": "Activated the webhook"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Activated the webhook"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "Invalid status"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Invalid status"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "Record not found with the given Id"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Record not found with the given Id"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/templates/create": {
   "post": {
    "summary": "Create Template",
    "operationId": "create-template",
    "description": "API to create a new template in Mailercloud.\n\n**Required Fields:**\n\n- name:  Name of the template (required, max 100 characters, must be unique)\n\n- html:  Specifies the HTML content (required) \n\n**Optional Fields:**\n\n- categoryId:  Specifies the category ID of the template, you can get it from the **Get Template Categories** API. It would be 0 by default.\n\n- plainText:  Specifies the plain text content",
    "tags": [
     "Templates"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": false,
      "description": "Request body type",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "categoryId": {
          "type": "integer"
         },
         "html": {
          "type": "string"
         },
         "name": {
          "type": "string"
         },
         "plainText": {
          "type": "string"
         }
        },
        "x-examples": {
         "Example 1": {
          "categoryId": 0,
          "html": "<html><body> Sample HTML </body></html>",
          "name": "New Template",
          "plainText": "Sample HTML"
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "categoryId": 0,
          "html": "<html><body> Sample HTML </body></html>",
          "name": "New Template",
          "plainText": "Sample HTML"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {},
         "x-examples": {
          "Example 1": {}
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "id": "EyK"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "html is a required field"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "html is a required field"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/templates/update": {
   "post": {
    "summary": "Update Template",
    "operationId": "update-template",
    "description": "This API allows you to update an existing email template in Mailercloud.\nYou can update a template either by providing its id or by using the templateName \u2014 at least one of them is required.\n\n**Required Fields:**\n\n- id: The unique ID of the template you want to update. (Required if templateName is not provided.)\n\n- templateName: The name of the template you want to update. (Required if id is not provided.)\n\n- name: The new name for the template (maximum 100 characters). The name must be unique.\n\n- html:  The updated HTML content of the template.\n\n**Optional Fields:**\n\n- categoryId:  Specifies the category ID of the template, you can get it from the **Get Template Categories** API. It would be 0 by default.\n\n- plainText:  Specifies the plain text content",
    "tags": [
     "Templates"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": false,
      "description": "Request body type ",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "x-examples": {
         "Example 1": {
          "categoryId": 0,
          "html": "<html><body> Sample HTML </body></html>",
          "name": "New Template",
          "plainText": "Sample HTML"
         }
        },
        "properties": {
         "categoryId": {
          "type": "integer"
         },
         "html": {
          "type": "string"
         },
         "name": {
          "type": "string"
         },
         "plainText": {
          "type": "string"
         },
         "templateName": {
          "type": "string"
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "id": "AXY",
          "categoryId": 0,
          "html": "string",
          "name": "string",
          "plainText": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "message": "updated template successfully"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "updated template successfully"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "HTML is a required field"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "html is a required field"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/templates/details/{id}": {
   "get": {
    "summary": "Get Template Details",
    "operationId": "get-template-details",
    "description": "This API endpoint is used to retrieve the details of a specific\nemail template by its ID in Mailercloud.",
    "tags": [
     "Templates"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "plainText": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "html": {
             "type": "string"
            },
            "categoryId": {
             "type": "integer"
            },
            "createdDate": {
             "type": "string"
            },
            "modifiedDate": {
             "type": "string"
            },
            "status": {
             "type": "string"
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "data": {
            "plainText": "Hello Reader",
            "name": "temp 1",
            "html": "<html>....</html>",
            "categoryId": 10,
            "createdDate": "2023-06-28 14:04:16",
            "modifiedDate": "2023-07-03 11:24:15",
            "status": "active"
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "data": {
            "plainText": "Hello Reader",
            "id": "k",
            "name": "temp 1",
            "html": "<html>....</html>",
            "categoryId": 10,
            "createdDate": "2023-06-28 14:04:16",
            "modifiedDate": "2023-07-03 11:24:15",
            "status": "active"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "Template id does not exist"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Template id does not exist"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/templates/list": {
   "post": {
    "summary": "List Templates",
    "operationId": "list-templates",
    "description": "Get a list of your saved email templates.\n\nBy default the response returns only template metadata (id, name, type, status, dates) \u2014 fast and small, ideal for building a template picker or dashboard.\n\nIf you also want the full template body (HTML, AMP, and plain text) inlined in the same response, set `include_content: true`. This is useful when you need to render or display the templates yourself without making a separate `GET /templates/details/{id}` call for each one.\n\nYou can filter, sort, search, and paginate through your templates:\n\n- Filter by template type (`html`, `amp`, or both)\n- Filter by status (`saved`, `draft`, or both)\n- Filter by category\n- Search by template name (case-insensitive substring match)\n- Sort by name, created date, or modified date \u2014 ascending or descending\n- Paginate with `page` and `limit`\n\n**Response limits when `include_content: true`:**\n\nBecause template bodies can be large, two safeguards apply when you ask for content:\n\n1. `limit` is capped at 20 templates per response (even if you request more).\n2. The total response size is capped at 10 MB.\n\nIf the response would exceed the size cap, you'll receive as many templates as fit, and the response will include `truncated: true`. When this happens, fetch the missing templates one at a time using `GET /templates/details/{id}` \u2014 the `template_count` field tells you the total number of templates that match your filter so you know how many are missing.",
    "tags": [
     "Templates"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "page": {
          "type": "integer",
          "default": 1,
          "minimum": 1,
          "description": "Page number (1-indexed). Defaults to 1 when omitted. `page=0` is silently treated as `page=1`. `page * limit > 100000` returns 400."
         },
         "limit": {
          "type": "integer",
          "default": 10,
          "minimum": 10,
          "maximum": 100,
          "description": "Maximum rows per page.\n\nMinimum: 10\nMaximum: 100\n\nWhen `include_content=true`, server silently clamps to 20 regardless of the requested value."
         },
         "template_type": {
          "type": "string",
          "description": "Comma-separated filter. Allowed tokens: `html`, `amp`.\n\n- Omitted or empty: no filter (all types).\n- `\"html\"`: HTML templates only (matches every non-AMP row, including legacy Stripo/DnD/plugin types).\n- `\"amp\"`: AMP templates only.\n- `\"html,amp\"`: both (equivalent to no filter).\n\nWhitespace around commas is trimmed. Unknown tokens (e.g. `\"plaintext\"`) return 400. Trailing comma returns 400."
         },
         "status": {
          "type": "string",
          "default": "saved",
          "description": "Comma-separated filter. Allowed tokens: `saved`, `draft`.\n\n- Omitted or empty: defaults to `\"saved\"` only.\n- `\"saved\"`: published templates.\n- `\"draft\"`: in-progress templates.\n- `\"saved,draft\"`: both.\n\nUnknown tokens return 400."
         },
         "category_id": {
          "type": "integer",
          "description": "Optional. Filter to a single template category. Omitted = no filter (all categories). `0` filters to uncategorized templates only. Negative values return 400. Not echoed back in response rows.\n\nUse `GET /v1/templates/categories/list` to enumerate available categories."
         },
         "search_name": {
          "type": "string",
          "maxLength": 100,
          "description": "Case-insensitive substring match on template name. Maximum 100 characters. Whitespace-only input is treated as no filter. `%` and `_` are escaped before matching (no SQL LIKE wildcard injection)."
         },
         "sort_field": {
          "type": "string",
          "default": "modified_date",
          "enum": [
           "name",
           "created_date",
           "modified_date"
          ],
          "description": "Field to sort by.\n\nSupported values: `name`, `created_date`, `modified_date`.\n\nAn implicit `id DESC` secondary sort is always applied for stable pagination across rows with tied timestamps."
         },
         "sort_order": {
          "type": "string",
          "default": "desc",
          "enum": [
           "asc",
           "ASC",
           "desc",
           "DESC"
          ],
          "description": "Sort direction.\n\nSupported values: `asc`, `ASC`, `desc`, `DESC`."
         },
         "include_content": {
          "type": "boolean",
          "default": false,
          "description": "When `true`, response rows include `html`, `amp_content`, and `plain_text` fields populated with the full template content. Server-side: `limit` is silently clamped to 20, and the total response is bounded by a 10 MB soft budget. When the budget is exceeded after the first row, remaining rows are skipped and `truncated: true` is set."
         }
        }
       },
       "examples": {
        "Example-1---Default": {
         "value": {
          "page": 1,
          "limit": 50
         }
        },
        "Example-2---HTML-only--name-asc": {
         "value": {
          "page": 1,
          "limit": 100,
          "template_type": "html",
          "sort_field": "name",
          "sort_order": "asc"
         }
        },
        "Example-3---With-content--one-category": {
         "value": {
          "page": 1,
          "limit": 20,
          "category_id": 5,
          "include_content": true
         }
        },
        "Example-4---Search-both-types--drafts-included": {
         "value": {
          "page": 1,
          "limit": 50,
          "template_type": "html,amp",
          "status": "saved,draft",
          "search_name": "Welcome"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "name": {
              "type": "string"
             },
             "template_type": {
              "type": "string",
              "enum": [
               "html",
               "amp"
              ],
              "description": "Canonical string token. Legacy DB types 2/3/4 (Stripo/DnD/plugin) collapse to `\"html\"`."
             },
             "status": {
              "type": "string",
              "enum": [
               "saved",
               "draft"
              ]
             },
             "created_date": {
              "type": "string",
              "description": "Format: YYYY-MM-DD HH:mm:ss in caller's account timezone."
             },
             "modified_date": {
              "type": "string",
              "description": "Format: YYYY-MM-DD HH:mm:ss in caller's account timezone."
             },
             "html": {
              "type": "string",
              "description": "Only present when `include_content=true`."
             },
             "amp_content": {
              "type": "string",
              "description": "Only present when `include_content=true`. Empty string for non-AMP rows."
             },
             "plain_text": {
              "type": "string",
              "description": "Only present when `include_content=true`."
             }
            }
           }
          },
          "template_count": {
           "type": "integer",
           "description": "Total matching rows across the entire result set, ignoring pagination AND truncation."
          },
          "truncated": {
           "type": "boolean",
           "description": "`true` when the response budget engaged and some rows that would otherwise have fit were skipped. Always present in 200 responses, even in metadata mode (where it is always `false`)."
          }
         }
        },
        "examples": {
         "Example-1---Metadata-mode": {
          "value": {
           "data": [
            {
             "id": "uSZy",
             "name": "Welcome Email",
             "template_type": "html",
             "status": "saved",
             "created_date": "2026-06-01 14:32:00",
             "modified_date": "2026-06-01 14:32:00"
            },
            {
             "id": "uuaK",
             "name": "Spring Promo (AMP)",
             "template_type": "amp",
             "status": "saved",
             "created_date": "2026-05-28 09:14:00",
             "modified_date": "2026-05-30 11:02:00"
            }
           ],
           "template_count": 137,
           "truncated": false
          }
         },
         "Example-2---With-content--budget-engaged": {
          "value": {
           "data": [
            {
             "id": "uuaK",
             "name": "Spring Promo (AMP)",
             "template_type": "amp",
             "status": "saved",
             "created_date": "2026-05-28 09:14:00",
             "modified_date": "2026-05-30 11:02:00",
             "html": "<!DOCTYPE html>...",
             "amp_content": "<!doctype html><html \u26a14email>...",
             "plain_text": "Spring Promo. 50% off."
            }
           ],
           "template_count": 137,
           "truncated": true
          }
         },
         "Example-3---Empty-result": {
          "value": {
           "data": [],
           "template_count": 0,
           "truncated": false
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request - validation failure",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Invalid-template_type-token": {
          "value": {
           "errors": [
            {
             "field": "template_type",
             "message": "invalid value"
            }
           ]
          }
         },
         "Invalid-status-token": {
          "value": {
           "errors": [
            {
             "field": "status",
             "message": "invalid value"
            }
           ]
          }
         },
         "Invalid-sort_field": {
          "value": {
           "errors": [
            {
             "field": "sort_field",
             "message": "Invalid sort_field"
            }
           ]
          }
         },
         "Invalid-sort_order": {
          "value": {
           "errors": [
            {
             "field": "sort_order",
             "message": "Invalid sort_order"
            }
           ]
          }
         },
         "Page-out-of-range": {
          "value": {
           "errors": [
            {
             "field": "page",
             "message": "page out of range"
            }
           ]
          }
         },
         "Limit-too-low": {
          "value": {
           "errors": [
            {
             "field": "limit",
             "message": "Limit must be 10 or greater"
            }
           ]
          }
         },
         "Limit-too-high": {
          "value": {
           "errors": [
            {
             "field": "limit",
             "message": "Limit must be 100 or less"
            }
           ]
          }
         },
         "Search-name-too-long": {
          "value": {
           "errors": [
            {
             "field": "search_name",
             "message": "Search_name must be a maximum of 100 characters in length"
            }
           ]
          }
         },
         "Trailing-comma-in-enum": {
          "value": {
           "errors": [
            {
             "field": "template_type",
             "message": "empty value"
            }
           ]
          }
         },
         "Negative-category_id": {
          "value": {
           "errors": [
            {
             "field": "category_id",
             "message": "Invalid category_id"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized - missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Too Many Requests - rate limit exceeded (50 req/sec per IP)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Too Many Requests"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Sorry, we are experiencing some technical difficulties. Please try after some time."
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/templates/categories/list": {
   "get": {
    "summary": "Get Template Categories",
    "operationId": "get-template-categories",
    "description": "This API endpoint is used to list the template categories in Mailercloud.",
    "tags": [
     "Templates"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "label": {
              "type": "string"
             },
             "value": {
              "type": "integer"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "data": [
            {
             "label": "Others",
             "value": 0
            },
            {
             "label": "Auto & Moto",
             "value": 1
            },
            {
             "label": "Beauty & Personal Care",
             "value": 2
            },
            {
             "label": "Beverages",
             "value": 3
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "data": [
            {
             "label": "Others",
             "value": 0
            },
            {
             "label": "Auto & Moto",
             "value": 1
            },
            {
             "label": "Beauty & Personal Care",
             "value": 2
            },
            {
             "label": "Beverages",
             "value": 3
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/templates/details": {
   "get": {
    "summary": "Get Template by Name or ID",
    "operationId": "get-template-by-name-or-id",
    "description": "This endpoint retrieves the full details of an email template in mailercloud. You can fetch a template either by passing the template name or its ID in the query parameters.\n\n```Name\ncurl --request GET \\\n  --url  https://cloudapi.mailercloud.com/v1/templates/details?name=example \\\n  --header 'Authorization: Your API Key here'\n\n```\n```ID\ncurl --request GET \\\n  --url  https://cloudapi.mailercloud.com/v1/templates/details?id=abc \\\n  --header 'Authorization: Your API Key here'\n\n```",
    "tags": [
     "Templates"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "ampContent": {
             "type": "string"
            },
            "plainText": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "html": {
             "type": "string"
            },
            "categoryId": {
             "type": "integer"
            },
            "createdDate": {
             "type": "string"
            },
            "modifiedDate": {
             "type": "string"
            },
            "status": {
             "type": "string"
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "data": {
            "ampContent": "",
            "plainText": "Button Button Button Button Button Button",
            "name": "Edit Preview - 1",
            "html": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\"> <head> <meta charset=\"UTF-8\"> <meta content=\"width=device-width, initial-scale=1\" name=\"viewport\"> <meta name=\"x-apple-disable-message-reformatting\"> <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"> <meta content=\"telephone=no\" name=\"format-detection\"> <title></title> <!--[if (mso 16)]> <style type=\"text/css\"> a {text-decoration: none;} </style> <![endif]--> <!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]--> <!--[if gte mso 9]> <xml> <o:OfficeDocumentSettings> <o:AllowPNG></o:AllowPNG> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings> </xml> <![endif]--> <style type=\"text/css\">@import url(\"http://u0090.devimg.salesjio.com/uploads/fonts.css\");</style>\n<style type=\"text/css\"> .rollover:hover .rollover-first {max-height:0px !important;display:none !important;}\n.rollover:hover .rollover-second {max-height:none !important;display:block !important;}\n#outlook a {padding:0;}\n.ml-button {mso-style-priority:100 !important;text-decoration:none;}\na[x-apple-data-detectors] {color:inherit !important;text-decoration:none !important;font-size:inherit !important;font-family:inherit !important;font-weight:inherit !important;line-height:inherit !important;}\n.ml-desk-hidden {display:none;float:left;overflow:hidden;width:0;max-height:0;line-height:0;mso-hide:all;}\n[data-ogsb] .ml-button {border-width:0 !important;padding:10px 20px 10px 20px !important;} @media only screen and (max-width:600px) { .st-br {padding-left:10px !important;padding-right:10px !important;}\np, ul li, ol li, a {line-height:150% !important;}\nh1 {font-size:30px !important;line-height:150% !important;}\nh2 {font-size:26px !important;line-height:150% !important;}\nh3 {font-size:20px !important;line-height:150% !important;}\n.ml-content-body h1 a {font-size:30px !important;}\n.ml-content-body h2 a {font-size:26px !important;}\n.ml-content-body h3 a {font-size:20px !important;}\n.ml-menu td a {font-size:14px !important;}\n*[class=\"gmail-fix\"] {display:none !important;}\n.ml-m-txt-c, .ml-m-txt-c h1, .ml-m-txt-c h2, .ml-m-txt-c h3 {text-align:center !important;}\n.ml-m-txt-r, .ml-m-txt-r h1, .ml-m-txt-r h2, .ml-m-txt-r h3 {text-align:right !important;}\n.ml-m-txt-l, .ml-m-txt-l h1, .ml-m-txt-l h2, .ml-m-txt-l h3 {text-align:left !important;}\n.ml-m-txt-r img, .ml-m-txt-c img, .ml-m-txt-l img {display:inline !important;}\n.ml-button-border {display:block !important;}\na.ml-button, button.ml-button {display:block !important;border-left-width:0px !important;border-right-width:0px !important;}\n.ml-adaptive table, .ml-left, .ml-right {width:100% !important;}\n.ml-content table, .ml-content {width:100% !important;max-width:600px !important;}\n.ml-adapt-td {display:block !important;width:100% !important;}\n.adapt-img {width:100% !important;height:auto !important;}\n.ml-m-p0 {padding:0 !important;}\n.ml-m-p0r {padding-right:0 !important;}\n.ml-m-p0l {padding-left:0 !important;}\n.ml-m-p0t {padding-top:0 !important;}\n.ml-m-p0b {padding-bottom:0 !important;}\n.ml-m-p20b {padding-bottom:20px !important;}\n.ml-mobile-hidden, .ml-hidden {display:none !important;}\ntr.ml-desk-hidden, td.ml-desk-hidden, table.ml-desk-hidden {width:auto !important;overflow:visible !important;float:none !important;max-height:inherit !important;line-height:inherit !important;}\ntr.ml-desk-hidden {display:table-row !important;}\ntable.ml-desk-hidden {display:table !important;}\ntd.ml-desk-menu-hidden {display:table-cell !important;}\n.ml-menu td {width:1% !important;}\ntable.ml-table-not-adapt, .esd-block-html table {width:auto !important;}\ntable.ml-smedia {display:inline-block !important;}\ntable.ml-smedia td {display:inline-block !important;}\n.mld-url-block {width:100% !important;} }\n</style>\n<!--[if gte mso 12]>\n<style type=\"text/css\">\n.mso-right { padding-left: 20px;\n}\n</style>\n<![endif]--></head><body style=\"width:100%;font-family:arial,'helvetica neue',helvetica,sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;padding:0;Margin:0\"><div bgcolor=\"#F2F6F8\" class=\"ml-wrapper-color\" style=\"background-color: #f2f6f8;\"><!--[if gte mso 9]> <v:background xmlns:v=\"urn:schemas-microsoft-com:vml\" fill=\"t\"> <v:fill type=\"tile\" color=\"#f2f6f8\"></v:fill> </v:background> <![endif]--><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" bgcolor=\"#f2f6f8\" class=\"ml-wrapper\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;padding:0;Margin:0;width:100%;height:100%\"><tr><td valign=\"top\" class=\"mld-email-paddings\" style=\"padding:0;Margin:0\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" align=\"center\" class=\"ml-content\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%\"><tbody><tr><td align=\"center\" style=\"Margin:0;padding:0px\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" align=\"center\" width=\"600\" class=\"ml-content-body\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;width:600px\"><tbody><tr ><td align=\"left\" class=\"mld-structure\" style=\"Margin:0;padding:20px 20px 0px\"><!--[if mso]><table style=\"width:560px\" cellpadding=\"0\" cellspacing=\"0\"><tr><![endif]--><!--[if mso]><td style=\"width:560px\" valign=\"top\"><![endif]--><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" align=\"left\" class=\"ml-left\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left\"><tbody><tr class=\"mld-container\"><td align=\"center\" valign=\"top\" class=\"ml-m-p20b\" style=\"Margin:0;margin:0px;padding:0px;width:560px\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;padding:0px;border-radius:0px;border-collapse:collapse\"><tr class=\"mld-element\"><td align=\"center\" style=\"Margin:0;padding:0px\"><!--[if mso]>\n<a href=\"#\" target=\"_blank\"> <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"#\" style=\"height:39px;v-text-anchor:middle;width:87px;\" arcsize=\"13%\" stroke=\"f\" fillcolor=\"#192028\"> <w:anchorlock></w:anchorlock> <center style=\"color:#FFFFFF;font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:16px;font-weight:normal; font-style:normal; text-decoration: none; \">Button</center> </v:roundrect>\n</a>\n<![endif]--> <!--[if !mso]><!-- --><span class=\"ml-button-border msohide\" style=\"border-radius:5px;width:auto;background:#192028;display:inline-block\"><a href=\"#\" target=\"_blank\" class=\"ml-button\" style=\"-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;border-style:solid;border-width:10px 20px 10px 20px;border-radius:5px;font-size:16px;font-family:arial,'helvetica neue',helvetica,sans-serif;font-weight:normal;font-style:normal;line-height:120%;color:#FFFFFF;text-decoration:none;width:auto;text-align:center;background:#192028;display:inline-block;border-color:#192028\">Button</a></span><!--<![endif]--></td></tr></table></td></tr></tbody></table><!--[if mso]></td><![endif]--><!--[if mso]></tr></table><![endif]--></td></tr><tr ><td align=\"left\" class=\"mld-structure\" style=\"Margin:0;padding:20px 20px 0px\"><!--[if mso]><table style=\"width:560px\" cellpadding=\"0\" cellspacing=\"0\"><tr><![endif]--><!--[if mso]><td style=\"width:270px\" valign=\"top\"><![endif]--><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" align=\"left\" class=\"ml-left\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left\"><tbody><tr class=\"mld-container\"><td align=\"center\" valign=\"top\" class=\"ml-m-p20b\" style=\"Margin:0;margin:0px;padding:0px;width:270px\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;padding:0px;border-radius:0px;border-collapse:collapse\"><tr class=\"mld-element\"><td align=\"center\" style=\"Margin:0;padding:0px\"><!--[if mso]>\n<a href=\"#\" target=\"_blank\"> <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"#\" style=\"height:39px;v-text-anchor:middle;width:87px;\" arcsize=\"13%\" stroke=\"f\" fillcolor=\"#50E3C2\"> <w:anchorlock></w:anchorlock> <center style=\"color:#FFFFFF;font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:16px;font-weight:normal; font-style:normal; text-decoration: none; \">Button</center> </v:roundrect>\n</a>\n<![endif]--> <!--[if !mso]><!-- --><span class=\"ml-button-border msohide\" style=\"border-radius:5px;width:auto;background:#50e3c2;display:inline-block\"><a href=\"#\" target=\"_blank\" class=\"ml-button\" style=\"-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;border-style:solid;border-width:10px 20px 10px 20px;border-radius:5px;font-size:16px;font-family:arial,'helvetica neue',helvetica,sans-serif;font-weight:normal;font-style:normal;line-height:120%;color:#FFFFFF;text-decoration:none;width:auto;text-align:center;background:#50e3c2;display:inline-block;border-color:#50e3c2\">Button</a></span><!--<![endif]--></td></tr></table></td></tr></tbody></table><!--[if mso]></td><td width=\"20\"></td><![endif]--><!--[if mso]><td style=\"width:270px\" valign=\"top\"><![endif]--><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" align=\"right\" class=\"ml-right\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right\"><tbody><tr class=\"mld-container\"><td align=\"center\" valign=\"top\" style=\"Margin:0;margin:0px;padding:0px;width:270px\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;padding:0px;border-radius:0px;border-collapse:collapse\"><tr class=\"mld-element\"><td align=\"center\" style=\"Margin:0;padding:0px\"><!--[if mso]>\n<a href=\"#\" target=\"_blank\"> <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"#\" style=\"height:39px;v-text-anchor:middle;width:87px;\" arcsize=\"13%\" stroke=\"f\" fillcolor=\"#7ED321\"> <w:anchorlock></w:anchorlock> <center style=\"color:#FFFFFF;font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:16px;font-weight:normal; font-style:normal; text-decoration: none; \">Button</center> </v:roundrect>\n</a>\n<![endif]--> <!--[if !mso]><!-- --><span class=\"ml-button-border msohide\" style=\"border-radius:5px;width:auto;background:#7ed321;display:inline-block\"><a href=\"#\" target=\"_blank\" class=\"ml-button\" style=\"-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;border-style:solid;border-width:10px 20px 10px 20px;border-radius:5px;font-family:arial,'helvetica neue',helvetica,sans-serif;font-weight:normal;font-style:normal;line-height:120%;text-decoration:none;width:auto;text-align:center;background:#7ed321;color:#ffffff;font-size:16px;display:inline-block;border-color:#7ed321\">Button</a></span><!--<![endif]--></td></tr></table></td></tr></tbody></table><!--[if mso]></td><![endif]--><!--[if mso]></tr></table><![endif]--></td></tr><tr ><td align=\"left\" class=\"mld-structure\" style=\"Margin:0;padding:20px 20px 0px\"><!--[if mso]><table style=\"width:560px\" cellpadding=\"0\" cellspacing=\"0\"><tr><![endif]--><!--[if mso]><td style=\"width:194px\" valign=\"top\"><![endif]--><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" align=\"left\" class=\"ml-left\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left\"><tbody><tr class=\"mld-container\"><td align=\"center\" valign=\"top\" class=\"ml-m-p20b\" style=\"Margin:0;margin:0px;padding:0px;width:174px\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;padding:0px;border-radius:0px;border-collapse:collapse\"><tr class=\"mld-element\"><td align=\"center\" style=\"Margin:0;padding:0px\"><!--[if mso]>\n<a href=\"#\" target=\"_blank\"> <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"#\" style=\"height:39px;v-text-anchor:middle;width:87px;\" arcsize=\"13%\" stroke=\"f\" fillcolor=\"#007BFF\"> <w:anchorlock></w:anchorlock> <center style=\"color:#FFFFFF;font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:16px;font-weight:normal; font-style:normal; text-decoration: none; \">Button</center> </v:roundrect>\n</a>\n<![endif]--> <!--[if !mso]><!-- --><span class=\"ml-button-border msohide\" style=\"background:#007BFF;border-radius:5px;width:auto;display:inline-block\"><a href=\"#\" target=\"_blank\" class=\"ml-button\" style=\"-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;border-style:solid;border-color:#007BFF;border-width:10px 20px 10px 20px;background:#007BFF;border-radius:5px;font-size:16px;font-family:arial,'helvetica neue',helvetica,sans-serif;font-weight:normal;font-style:normal;line-height:120%;color:#FFFFFF;text-decoration:none;width:auto;text-align:center;display:inline-block\">Button</a></span><!--<![endif]--></td></tr></table></td><td class=\"ml-hidden\" style=\"Margin:0;padding:0px;margin:0px;width:20px\"></td></tr></tbody></table><!--[if mso]></td><![endif]--><!--[if mso]><td style=\"width:173px\" valign=\"top\"><![endif]--><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" align=\"left\" class=\"ml-left\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left\"><tbody><tr class=\"mld-container\"><td align=\"center\" valign=\"top\" class=\"ml-m-p20b\" style=\"Margin:0;margin:0px;padding:0px;width:173px\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;padding:0px;border-radius:0px;border-collapse:collapse\"><tr class=\"mld-element\"><td align=\"center\" style=\"Margin:0;padding:0px\"><!--[if mso]>\n<a href=\"#\" target=\"_blank\"> <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"#\" style=\"height:39px;v-text-anchor:middle;width:87px;\" arcsize=\"13%\" strokecolor=\"#000000\" strokeweight=\"1px\" fillcolor=\"#FB6376\"> <w:anchorlock></w:anchorlock> <center style=\"color:#FFFFFF;font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:16px;font-weight:normal; font-style:normal; text-decoration: none; \">Button</center> </v:roundrect>\n</a>\n<![endif]--> <!--[if !mso]><!-- --><span class=\"ml-button-border msohide\" style=\"border-radius:5px;width:auto;border-bottom:1px solid #000000;background:#fb6376;display:inline-block\"><a href=\"#\" target=\"_blank\" class=\"ml-button\" style=\"-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;border-style:solid;border-width:10px 20px 10px 20px;border-radius:5px;font-family:arial,'helvetica neue',helvetica,sans-serif;font-weight:normal;font-style:normal;line-height:120%;text-decoration:none;width:auto;text-align:center;background:#fb6376;color:#ffffff;font-size:16px;display:inline-block;border-color:#fb6376\">Button</a></span><!--<![endif]--></td></tr></table></td></tr></tbody></table><!--[if mso]></td><td width=\"20\"></td><![endif]--><!--[if mso]><td style=\"width:173px\" valign=\"top\"><![endif]--><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" align=\"right\" class=\"ml-right\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right\"><tbody><tr class=\"mld-container\"><td align=\"center\" valign=\"top\" style=\"Margin:0;margin:0px;padding:0px;width:173px\"><table cellspacing=\"0\" cellpadding=\"0\" role=\"presentation\" width=\"100%\" style=\"mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;padding:0px;border-radius:0px;border-collapse:collapse\"><tr class=\"mld-element\"><td align=\"center\" style=\"Margin:0;padding:0px\"><!--[if mso]>\n<a href=\"#\" target=\"_blank\"> <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"#\" style=\"height:39px;v-text-anchor:middle;width:87px;\" arcsize=\"13%\" stroke=\"f\" fillcolor=\"#007BFF\"> <w:anchorlock></w:anchorlock> <center style=\"color:#FFFFFF;font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:16px;font-weight:normal; font-style:normal; text-decoration: none; \">Button</center> </v:roundrect>\n</a>\n<![endif]--> <!--[if !mso]><!-- --><span class=\"ml-button-border msohide\" style=\"background:#007BFF;border-radius:5px;width:auto;display:inline-block\"><a href=\"#\" target=\"_blank\" class=\"ml-button\" style=\"-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;border-style:solid;border-color:#007BFF;border-width:10px 20px 10px 20px;background:#007BFF;border-radius:5px;font-size:16px;font-family:arial,'helvetica neue',helvetica,sans-serif;font-weight:normal;font-style:normal;line-height:120%;color:#FFFFFF;text-decoration:none;width:auto;text-align:center;display:inline-block\">Button</a></span><!--<![endif]--></td></tr></table></td></tr></tbody></table><!--[if mso]></td><![endif]--><!--[if mso]></tr></table><![endif]--></td></tr></tbody></table></td></tr></tbody></table></td></tr></table></div>\n</body></html>",
            "categoryId": 0,
            "createdDate": "2025-06-13 03:08:30",
            "modifiedDate": "2025-06-13 03:10:28",
            "status": "active"
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "data": {
            "plainText": "Hello Reader",
            "id": "k",
            "name": "temp 1",
            "html": "<html>....</html>",
            "categoryId": 10,
            "createdDate": "2023-06-28 14:04:16",
            "modifiedDate": "2023-07-03 11:24:15",
            "status": "active"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         },
         "x-examples": {
          "Example 1": {
           "error": "Template Name does not exist"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "error": "Template Name does not exist"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Template name to look up. Provide either `name` or `id`."
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Template ID to look up. Provide either `name` or `id`."
     }
    ]
   }
  },
  "/automations/{id}": {
   "post": {
    "summary": "Get Automation Details",
    "operationId": "get-single-automatoin-details",
    "tags": [
     "Automations"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "node_type": {
          "type": "string",
          "description": "Filter nodes by type\n\nTypes: \"delay\",\"wait_for_trigger\",\"if/else\",\"split\",\"goto\",\"email\",\"list\",\"contact_update\",\"tag_actions\""
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "automation": {
           "type": "object",
           "properties": {
            "automation_id": {
             "type": "string"
            },
            "automation_name": {
             "type": "string"
            },
            "created_date": {
             "type": "string"
            },
            "updated_date": {
             "type": "string"
            },
            "start_time": {
             "type": "string"
            },
            "finish_time": {
             "type": "string"
            },
            "timezone": {
             "type": "string"
            },
            "status": {
             "type": "string"
            },
            "total_contacts": {
             "type": "integer"
            },
            "total_triggers": {
             "type": "integer"
            },
            "total_nodes": {
             "type": "integer"
            },
            "skipped_contacts": {
             "type": "integer"
            },
            "completed_contacts": {
             "type": "integer"
            },
            "campaigns": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "blacklisted_domains": {
                "type": "object",
                "properties": {}
               },
               "broken_links": {
                "type": "object",
                "properties": {}
               },
               "conversion_tracking": {
                "type": "object",
                "properties": {
                 "name": {
                  "type": "string"
                 },
                 "type": {
                  "type": "string"
                 }
                }
               },
               "created_date": {
                "type": "string"
               },
               "email_preheader": {
                "type": "string"
               },
               "modified_date": {
                "type": "string"
               },
               "name": {
                "type": "string"
               },
               "permission_reminder": {
                "type": "string"
               },
               "reply_email": {
                "type": "string"
               },
               "report_abuse": {
                "type": "boolean"
               },
               "report_summary": {
                "type": "object",
                "properties": {
                 "abuse": {
                  "type": "integer"
                 },
                 "abuse_percentage": {
                  "type": "string"
                 },
                 "clicks": {
                  "type": "integer"
                 },
                 "clicks_percentage": {
                  "type": "string"
                 },
                 "conversions": {
                  "type": "integer"
                 },
                 "conversions_percentage": {
                  "type": "string"
                 },
                 "delivered": {
                  "type": "integer"
                 },
                 "delivered_percentage": {
                  "type": "string"
                 },
                 "hard_bounce": {
                  "type": "integer"
                 },
                 "hard_bounce_percentage": {
                  "type": "string"
                 },
                 "open_percentage": {
                  "type": "string"
                 },
                 "opens": {
                  "type": "integer"
                 },
                 "queue": {
                  "type": "integer"
                 },
                 "queue_percentage": {
                  "type": "string"
                 },
                 "queued_total": {
                  "type": "integer"
                 },
                 "sent": {
                  "type": "integer"
                 },
                 "sent_percentage": {
                  "type": "string"
                 },
                 "soft_bounce": {
                  "type": "integer"
                 },
                 "soft_bounce_percentage": {
                  "type": "string"
                 },
                 "spam_complaints_count": {
                  "type": "integer"
                 },
                 "spam_complaints_percentage": {
                  "type": "string"
                 },
                 "unsubscribe": {
                  "type": "integer"
                 },
                 "unsubscribe_percentage": {
                  "type": "string"
                 }
                }
               },
               "sender": {
                "type": "object",
                "properties": {
                 "sender_email": {
                  "type": "string"
                 },
                 "sender_name": {
                  "type": "string"
                 }
                }
               },
               "status": {
                "type": "string"
               },
               "subject": {
                "type": "string"
               },
               "tag": {
                "type": "string"
               }
              }
             }
            },
            "triggers": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "activity": {
                "type": "string"
               },
               "activity_id": {
                "type": "string"
               },
               "description": {
                "type": "string"
               },
               "filters": {
                "type": "object",
                "properties": {
                 "group_joiner": {
                  "type": "string"
                 },
                 "groups": {
                  "type": "array",
                  "items": {
                   "type": "object",
                   "properties": {}
                  }
                 }
                }
               },
               "included_import": {
                "type": "boolean"
               },
               "list_id": {
                "type": "string"
               },
               "list_name": {
                "type": "string"
               }
              }
             }
            },
            "steps": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "active_contacts": {
                "type": "integer"
               },
               "campaign_details": {
                "type": "object",
                "properties": {
                 "created_date": {
                  "type": "string"
                 },
                 "email_preheader": {
                  "type": "string"
                 },
                 "modified_date": {
                  "type": "string"
                 },
                 "name": {
                  "type": "string"
                 },
                 "reply_email": {
                  "type": "string"
                 },
                 "report_summary": {
                  "type": "object",
                  "properties": {
                   "abuse": {
                    "type": "integer"
                   },
                   "abuse_percentage": {
                    "type": "string"
                   },
                   "clicks": {
                    "type": "integer"
                   },
                   "clicks_percentage": {
                    "type": "string"
                   },
                   "conversions": {
                    "type": "integer"
                   },
                   "conversions_percentage": {
                    "type": "string"
                   },
                   "delivered": {
                    "type": "integer"
                   },
                   "delivered_percentage": {
                    "type": "string"
                   },
                   "hard_bounce": {
                    "type": "integer"
                   },
                   "hard_bounce_percentage": {
                    "type": "string"
                   },
                   "open_percentage": {
                    "type": "string"
                   },
                   "opens": {
                    "type": "integer"
                   },
                   "queue": {
                    "type": "integer"
                   },
                   "queue_percentage": {
                    "type": "string"
                   },
                   "queued_total": {
                    "type": "integer"
                   },
                   "sent": {
                    "type": "integer"
                   },
                   "sent_percentage": {
                    "type": "string"
                   },
                   "soft_bounce": {
                    "type": "integer"
                   },
                   "soft_bounce_percentage": {
                    "type": "string"
                   },
                   "spam_complaints_count": {
                    "type": "integer"
                   },
                   "spam_complaints_percentage": {
                    "type": "string"
                   },
                   "unsubscribe": {
                    "type": "integer"
                   },
                   "unsubscribe_percentage": {
                    "type": "string"
                   }
                  }
                 },
                 "sender": {
                  "type": "object",
                  "properties": {
                   "sender_email": {
                    "type": "string"
                   },
                   "sender_name": {
                    "type": "string"
                   }
                  }
                 },
                 "status": {
                  "type": "string"
                 },
                 "subject": {
                  "type": "string"
                 },
                 "tag": {
                  "type": "string"
                 }
                }
               },
               "completed_contacts": {
                "type": "integer"
               },
               "name": {
                "type": "string"
               },
               "skipped_contacts": {
                "type": "integer"
               },
               "step_id": {
                "type": "string"
               },
               "type": {
                "type": "string"
               }
              }
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "automation": {
            "automation_id": "EZZ",
            "automation_name": "Draft",
            "created_date": "2025-01-23 18:31:10",
            "updated_date": "2025-01-24 09:59:50",
            "start_time": "",
            "finish_time": "",
            "timezone": "",
            "status": "Draft",
            "total_contacts": 0,
            "total_triggers": 1,
            "total_nodes": 1,
            "skipped_contacts": 0,
            "completed_contacts": 0,
            "campaigns": [
             {
              "blacklisted_domains": {},
              "broken_links": {},
              "conversion_tracking": {
               "name": "ew p",
               "type": "Iframe"
              },
              "created_date": "2025-01-24 09:59:47",
              "email_preheader": "",
              "modified_date": "2025-01-24 09:59:47",
              "name": "Html - 1",
              "permission_reminder": "",
              "reply_email": "test@regalwork.com",
              "report_abuse": false,
              "report_summary": {
               "abuse": 0,
               "abuse_percentage": "0.00",
               "clicks": 0,
               "clicks_percentage": "0.00",
               "conversions": 0,
               "conversions_percentage": "0.00",
               "delivered": 0,
               "delivered_percentage": "0.00",
               "hard_bounce": 0,
               "hard_bounce_percentage": "0.00",
               "open_percentage": "0.00",
               "opens": 0,
               "queue": 0,
               "queue_percentage": "0.00",
               "queued_total": 0,
               "sent": 0,
               "sent_percentage": "0.00",
               "soft_bounce": 0,
               "soft_bounce_percentage": "0.00",
               "spam_complaints_count": 0,
               "spam_complaints_percentage": "0.00",
               "unsubscribe": 0,
               "unsubscribe_percentage": "0.00"
              },
              "sender": {
               "sender_email": "test@regalwork.com",
               "sender_name": "Html - 1"
              },
              "status": "Draft",
              "subject": "Html - 1",
              "tag": "Improvements"
             }
            ],
            "triggers": [
             {
              "activity": "Contact Activity",
              "activity_id": "uSK",
              "description": "Contact joins to a particular list",
              "filters": {
               "group_joiner": "OR",
               "groups": []
              },
              "included_import": true,
              "list_id": "Ewy",
              "list_name": "List Deletion - 1"
             }
            ],
            "steps": [
             {
              "active_contacts": 0,
              "campaign_details": {
               "created_date": "2025-01-24 09:59:47",
               "email_preheader": "",
               "modified_date": "2025-01-24 09:59:47",
               "name": "Html - 1",
               "reply_email": "test@regalwork.com",
               "report_summary": {
                "abuse": 0,
                "abuse_percentage": "0.00",
                "clicks": 0,
                "clicks_percentage": "0.00",
                "conversions": 0,
                "conversions_percentage": "0.00",
                "delivered": 0,
                "delivered_percentage": "0.00",
                "hard_bounce": 0,
                "hard_bounce_percentage": "0.00",
                "open_percentage": "0.00",
                "opens": 0,
                "queue": 0,
                "queue_percentage": "0.00",
                "queued_total": 0,
                "sent": 0,
                "sent_percentage": "0.00",
                "soft_bounce": 0,
                "soft_bounce_percentage": "0.00",
                "spam_complaints_count": 0,
                "spam_complaints_percentage": "0.00",
                "unsubscribe": 0,
                "unsubscribe_percentage": "0.00"
               },
               "sender": {
                "sender_email": "test@regalwork.com",
                "sender_name": "Html - 1"
               },
               "status": "Draft",
               "subject": "Html - 1",
               "tag": "Improvements"
              },
              "completed_contacts": 0,
              "name": "Send Email",
              "skipped_contacts": 0,
              "step_id": "uSS",
              "type": "email"
             }
            ]
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "automation": {
            "automation_id": "EZZ",
            "automation_name": "Draft",
            "created_date": "2025-01-23 18:31:10",
            "updated_date": "2025-01-24 09:59:50",
            "start_time": "",
            "finish_time": "",
            "timezone": "",
            "status": "Draft",
            "total_contacts": 0,
            "total_triggers": 1,
            "total_nodes": 1,
            "skipped_contacts": 0,
            "completed_contacts": 0,
            "campaigns": [
             {
              "blacklisted_domains": {},
              "broken_links": {},
              "conversion_tracking": {
               "name": "ew p",
               "type": "Iframe"
              },
              "created_date": "2025-01-24 09:59:47",
              "email_preheader": "",
              "id": "HZy",
              "modified_date": "2025-01-24 09:59:47",
              "name": "Html - 1",
              "permission_reminder": "",
              "reply_email": "test@regalwork.com",
              "report_abuse": false,
              "report_summary": {
               "abuse": 0,
               "abuse_percentage": "0.00",
               "clicks": 0,
               "clicks_percentage": "0.00",
               "conversions": 0,
               "conversions_percentage": "0.00",
               "delivered": 0,
               "delivered_percentage": "0.00",
               "hard_bounce": 0,
               "hard_bounce_percentage": "0.00",
               "open_percentage": "0.00",
               "opens": 0,
               "queue": 0,
               "queue_percentage": "0.00",
               "queued_total": 0,
               "sent": 0,
               "sent_percentage": "0.00",
               "soft_bounce": 0,
               "soft_bounce_percentage": "0.00",
               "spam_complaints_count": 0,
               "spam_complaints_percentage": "0.00",
               "unsubscribe": 0,
               "unsubscribe_percentage": "0.00"
              },
              "sender": {
               "sender_email": "test@regalwork.com",
               "sender_name": "Html - 1"
              },
              "status": "Draft",
              "subject": "Html - 1",
              "tag": "Improvements"
             }
            ],
            "triggers": [
             {
              "activity": "Contact Activity",
              "activity_id": "uSK",
              "description": "Contact joins to a particular list",
              "filters": {
               "group_joiner": "OR",
               "groups": []
              },
              "included_import": true,
              "list_id": "Ewy",
              "list_name": "List Deletion - 1"
             }
            ],
            "steps": [
             {
              "active_contacts": 0,
              "campaign_details": {
               "created_date": "2025-01-24 09:59:47",
               "email_preheader": "",
               "id": "HZy",
               "modified_date": "2025-01-24 09:59:47",
               "name": "Html - 1",
               "reply_email": "test@regalwork.com",
               "report_summary": {
                "abuse": 0,
                "abuse_percentage": "0.00",
                "clicks": 0,
                "clicks_percentage": "0.00",
                "conversions": 0,
                "conversions_percentage": "0.00",
                "delivered": 0,
                "delivered_percentage": "0.00",
                "hard_bounce": 0,
                "hard_bounce_percentage": "0.00",
                "open_percentage": "0.00",
                "opens": 0,
                "queue": 0,
                "queue_percentage": "0.00",
                "queued_total": 0,
                "sent": 0,
                "sent_percentage": "0.00",
                "soft_bounce": 0,
                "soft_bounce_percentage": "0.00",
                "spam_complaints_count": 0,
                "spam_complaints_percentage": "0.00",
                "unsubscribe": 0,
                "unsubscribe_percentage": "0.00"
               },
               "sender": {
                "sender_email": "test@regalwork.com",
                "sender_name": "Html - 1"
               },
               "status": "Draft",
               "subject": "Html - 1",
               "tag": "Improvements"
              },
              "completed_contacts": 0,
              "name": "Send Email",
              "skipped_contacts": 0,
              "step_id": "uSS",
              "type": "email"
             }
            ]
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "node_type",
             "message": "invalid value"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "node_type",
             "message": "invalid value"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    },
    "description": "Retrieve details and node-level campaign report data for an advanced automation by its ID. The request body filters which node types are included."
   }
  },
  "/automations": {
   "post": {
    "summary": "Create Automation",
    "operationId": "create-automation",
    "description": "API to create an advanced automation in a single request. `name` and `nodes` are required. `auto_publish` is optional (defaults to `false` = draft). `timezone`, `start_time`, `end_time`, `allow_re_enrollment`, `re_enroll_interval`, `re_enroll_unit` are optional.\n\nThe automation is declared as a directed graph of nodes: exactly one trigger node, plus any number of action / wait / condition nodes wired via `parent_id`. Caller-supplied node ids (`id`, `parent_id`, `target_id`) are short strings used only to wire the graph in the request; they are not stored.\n\n**Plan gate:** the caller's plan must include advanced automation, otherwise a `403` is returned.",
    "tags": [
     "Automations"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "nodes"
        ],
        "properties": {
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 150,
          "description": "Automation display name. HTML is stripped server-side.\n\nMinimum: 1\nMaximum: 150"
         },
         "timezone": {
          "type": "string",
          "description": "IANA timezone (e.g. Asia/Kolkata, America/New_York, UTC). Defaults to the caller's account timezone."
         },
         "auto_publish": {
          "type": "boolean",
          "default": false,
          "description": "If true, the automation is published immediately and the response returns status=active. If false (default), it is saved as a draft and returns status=draft."
         },
         "allow_re_enrollment": {
          "type": "boolean",
          "default": false,
          "description": "Allow the same contact to re-enter this automation after completing or exiting."
         },
         "re_enroll_interval": {
          "type": "integer",
          "minimum": 1,
          "maximum": 30,
          "description": "Minimum wait before a contact can re-enroll. Required when allow_re_enrollment is true.\n\nMinimum: 1\nMaximum: 30"
         },
         "re_enroll_unit": {
          "type": "string",
          "enum": [
           "hours",
           "days",
           "weeks"
          ],
          "description": "Unit for re_enroll_interval. Required when allow_re_enrollment is true.\n\nSupported values: hours, days, weeks"
         },
         "start_time": {
          "type": "string",
          "description": "Earliest UTC moment the automation will accept new contacts.\n\nFormat: YYYY-MM-DD HH:mm:ss\n\nMust be in the future."
         },
         "end_time": {
          "type": "string",
          "description": "Latest UTC moment the automation will accept new contacts.\n\nFormat: YYYY-MM-DD HH:mm:ss\n\nMust be in the future and >= start_time."
         },
         "nodes": {
          "type": "array",
          "minItems": 1,
          "maxItems": 500,
          "description": "DAG of trigger + downstream action / condition nodes. Exactly one trigger node is required; no orphans and no cycles allowed.\n\nMinimum items: 1\nMaximum items: 500",
          "items": {
           "type": "object",
           "required": [
            "id",
            "type"
           ],
           "properties": {
            "parent_id": {
             "type": "string",
             "description": "Parent node's id. Required on every node except the trigger."
            },
            "type": {
             "type": "string",
             "enum": [
              "trigger",
              "wait_for_period",
              "wait_until_time",
              "wait_for_event",
              "if_else",
              "random_split",
              "goto",
              "delete_contact",
              "update_contact_property",
              "add_tag",
              "remove_tag",
              "add_to_list",
              "remove_from_list"
             ],
             "description": "Node type. The trigger type must appear exactly once at the root.\n\nSupported types: trigger, wait_for_period, wait_until_time, wait_for_event, if_else, random_split, goto, delete_contact, update_contact_property, add_tag, remove_tag, add_to_list, remove_from_list"
            },
            "branch": {
             "type": "string",
             "enum": [
              "yes",
              "no"
             ],
             "description": "Required on direct children of if_else and random_split.\n\nSupported values: yes, no"
            },
            "target_id": {
             "type": "string",
             "description": "Target node id for goto nodes. Must reference an existing caller id that is NOT in this node's ancestor chain."
            },
            "trigger": {
             "type": "string",
             "enum": [
              "list_subscribed",
              "audience_subscribed",
              "webform_submitted",
              "contact_added_via_api",
              "any_property_changed",
              "list_property_changed",
              "campaign_opened",
              "campaign_not_opened",
              "campaign_clicked",
              "campaign_not_clicked",
              "campaign_sent",
              "date_property",
              "tag_added"
             ],
             "description": "Trigger type. Required when type=trigger.\n\nSupported triggers: list_subscribed, audience_subscribed, webform_submitted, contact_added_via_api, any_property_changed, list_property_changed, campaign_opened, campaign_not_opened, campaign_clicked, campaign_not_clicked, campaign_sent, date_property, tag_added"
            },
            "list": {
             "type": "string",
             "description": "List name (cid-scoped). Required for list_subscribed, contact_added_via_api, any_property_changed, list_property_changed triggers AND for add_to_list / remove_from_list nodes."
            },
            "webform": {
             "type": "string",
             "description": "Webform name (cid-scoped). Required for webform_submitted trigger."
            },
            "campaign": {
             "type": "string",
             "description": "Campaign name (cid-scoped). Required for all 5 campaign_* triggers and for wait_for_event when the event is a campaign trigger."
            },
            "tag": {
             "type": "string",
             "maxLength": 100,
             "description": "Tag name (cid-scoped). Required for tag_added trigger and add_tag / remove_tag nodes. Also accepted as the single-tag form of the if_else contact_tag filter.\n\nMaximum: 100"
            },
            "property": {
             "type": "string",
             "description": "Custom field mapping_name (e.g. custom_1, country). Required for any_property_changed, list_property_changed, date_property triggers; update_contact_property node; and contact_property if_else filter.\n\nAllowed characters: ^[A-Za-z0-9_]+$"
            },
            "property_condition": {
             "type": "string",
             "enum": [
              "equals",
              "not_equals",
              "is_known",
              "is_unknown",
              "contains",
              "does_not_contain",
              "starts_with",
              "ends_with"
             ],
             "description": "Property comparison operator. Required for property triggers and update_contact_property.\n\nSupported values: equals, not_equals, is_known, is_unknown, contains, does_not_contain, starts_with, ends_with"
            },
            "property_value": {
             "type": "string",
             "description": "Comparison value for property triggers. Not required when property_condition is is_known or is_unknown."
            },
            "value": {
             "description": "Used by update_contact_property (new value to assign) and as the generic value slot for some if_else condition operators.\n\nType depends on operator (string / number / object {from, to} for between / object {from_date, to_date} for between_dates)."
            },
            "allow_import": {
             "type": "boolean",
             "description": "If true, contacts imported via CSV / API also trigger this automation. Applies to list_subscribed, audience_subscribed, contact_added_via_api, property triggers and tag_added."
            },
            "set_time_limit": {
             "type": "boolean",
             "description": "If true, the trigger waits at most wait_for / wait_unit before evaluating. Optional on property and campaign_opened / campaign_clicked triggers."
            },
            "wait_for": {
             "type": "integer",
             "minimum": 1,
             "description": "How long to wait before triggering. Required for campaign_not_opened and campaign_not_clicked. Optional for property and campaign_opened / campaign_clicked triggers when set_time_limit is true."
            },
            "wait_unit": {
             "type": "string",
             "enum": [
              "hours",
              "days",
              "weeks"
             ],
             "description": "Unit for wait_for.\n\nSupported values: hours, days, weeks"
            },
            "when": {
             "type": "string",
             "enum": [
              "same_day",
              "before",
              "after"
             ],
             "description": "Required for date_property trigger.\n\nSupported values: same_day, before, after"
            },
            "day": {
             "type": "integer",
             "description": "For date_property trigger when when != same_day: 1-90 days before/after. For wait_until_time node with mode=day_of_month: 1-31."
            },
            "time": {
             "type": "string",
             "description": "HH:mm for date_property trigger. HH:mm:ss (must not be 00:00:00) for wait_until_time node."
            },
            "is_recurring": {
             "type": "boolean",
             "description": "Optional on date_property trigger."
            },
            "days": {
             "type": "integer",
             "minimum": 0,
             "maximum": 90,
             "description": "wait_for_period delay (days). At least one of days / hours / minutes must be > 0.\n\nMinimum: 0\nMaximum: 90"
            },
            "hours": {
             "type": "integer",
             "minimum": 0,
             "maximum": 24,
             "description": "wait_for_period delay (hours).\n\nMinimum: 0\nMaximum: 24"
            },
            "minutes": {
             "type": "integer",
             "minimum": 0,
             "maximum": 60,
             "description": "wait_for_period delay (minutes).\n\nMinimum: 0\nMaximum: 60"
            },
            "mode": {
             "type": "string",
             "enum": [
              "time_of_day",
              "day_of_week",
              "day_of_month",
              "specific_date"
             ],
             "description": "Required for wait_until_time node.\n\nSupported values: time_of_day, day_of_week, day_of_month, specific_date"
            },
            "weeks": {
             "type": "array",
             "minItems": 1,
             "items": {
              "type": "string",
              "enum": [
               "mon",
               "tue",
               "wed",
               "thu",
               "fri",
               "sat",
               "sun"
              ]
             },
             "description": "Required when wait_until_time mode=day_of_week.\n\nSupported values: mon, tue, wed, thu, fri, sat, sun"
            },
            "date": {
             "type": "string",
             "description": "Required when wait_until_time mode=specific_date.\n\nFormat: YYYY-MM-DD (must be >= today)."
            },
            "event": {
             "type": "string",
             "description": "Trigger name to wait for. Required for wait_for_event node. Use one of the trigger values. The matching trigger's required fields must also be supplied on the same node (e.g. event=campaign_opened requires campaign)."
            },
            "tags": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "maxItems": 100,
             "description": "Multi-tag form of the if_else contact_tag filter.\n\nMaximum: 100 entries"
            },
            "filters": {
             "type": "array",
             "maxItems": 3,
             "description": "if_else filter groups. The outer array is OR (max 3 groups). Each inner array is AND (>=1 condition per group).",
             "items": {
              "type": "array",
              "minItems": 1,
              "items": {
               "type": "object",
               "required": [
                "condition",
                "operator"
               ],
               "properties": {
                "condition": {
                 "type": "string",
                 "enum": [
                  "contact_property",
                  "subscriber_status",
                  "contact_rating",
                  "domain",
                  "subscriber_opened",
                  "global_openers",
                  "campaign_tag",
                  "campaign_activity",
                  "contact_tag",
                  "contact_details"
                 ],
                 "description": "Filter condition type.\n\nSupported values: contact_property, subscriber_status, contact_rating, domain, subscriber_opened, global_openers, campaign_tag, campaign_activity, contact_tag, contact_details"
                },
                "operator": {
                 "type": "string",
                 "description": "Allowed values depend on condition.\n\ncontact_property: equals, not_equals, is_known, is_unknown, contains, does_not_contain, starts_with, ends_with\n\nsubscriber_status: is, is_not\n\ncontact_rating: equals, between\n\ndomain: equals, not_equals, is_empty, is_not_empty\n\nsubscriber_opened: count, in_last_days, not_in_last_days\n\nglobal_openers: equals, not_equals, less_than, greater_than, between\n\ncampaign_tag, campaign_activity, contact_tag, contact_details: any_time, between_dates, in_last_days"
                },
                "status_value": {
                 "type": "string",
                 "enum": [
                  "active",
                  "unknown",
                  "valid",
                  "opened",
                  "clicked"
                 ],
                 "description": "Required when condition=subscriber_status. Use this key (not the generic value).\n\nSupported values: active, unknown, valid, opened, clicked"
                },
                "value": {
                 "description": "Operator-shaped value.\n\nbetween: {from: int, to: int}\nbetween_dates: {from_date: YYYY-MM-DD, to_date: YYYY-MM-DD}\nin_last_days / not_in_last_days: int 1-365\nis_known / is_unknown / is_empty / is_not_empty: omit value entirely"
                },
                "tag": {
                 "type": "string",
                 "description": "Single-tag form of the contact_tag filter."
                },
                "tags": {
                 "type": "array",
                 "items": {
                  "type": "string"
                 },
                 "maxItems": 100,
                 "description": "Multi-tag form of the contact_tag filter.\n\nMaximum: 100 entries"
                },
                "property": {
                 "type": "string",
                 "description": "Custom field mapping_name. Required when condition=contact_property.\n\nAllowed characters: ^[A-Za-z0-9_]+$"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       },
       "examples": {
        "Example-1---Welcome-series": {
         "value": {
          "name": "Welcome series for new subscribers",
          "timezone": "Asia/Kolkata",
          "auto_publish": true,
          "nodes": [
           {
            "id": "n1",
            "type": "trigger",
            "trigger": "list_subscribed",
            "list": "Newsletter Subscribers"
           },
           {
            "id": "n2",
            "parent_id": "n1",
            "type": "wait_for_period",
            "days": 1
           },
           {
            "id": "n3",
            "parent_id": "n2",
            "type": "if_else",
            "filters": [
             [
              {
               "condition": "subscriber_status",
               "operator": "is",
               "status_value": "active"
              }
             ]
            ]
           },
           {
            "id": "n4",
            "parent_id": "n3",
            "branch": "yes",
            "type": "add_tag",
            "tag": "Welcomed-Active"
           },
           {
            "id": "n5",
            "parent_id": "n3",
            "branch": "no",
            "type": "add_tag",
            "tag": "Welcomed-Inactive"
           }
          ]
         }
        },
        "Example-2---Birthday-A-B-test": {
         "value": {
          "name": "Birthday wishes - A/B variant test",
          "timezone": "Asia/Kolkata",
          "auto_publish": true,
          "allow_re_enrollment": true,
          "re_enroll_interval": 1,
          "re_enroll_unit": "weeks",
          "nodes": [
           {
            "id": "n1",
            "type": "trigger",
            "trigger": "date_property",
            "property": "birthday",
            "when": "same_day",
            "time": "09:00",
            "is_recurring": true
           },
           {
            "id": "n2",
            "parent_id": "n1",
            "type": "random_split"
           },
           {
            "id": "n3",
            "parent_id": "n2",
            "branch": "yes",
            "type": "add_tag",
            "tag": "Birthday-Variant-A"
           },
           {
            "id": "n4",
            "parent_id": "n2",
            "branch": "no",
            "type": "add_tag",
            "tag": "Birthday-Variant-B"
           }
          ]
         }
        },
        "Example-3---Re-engage-non-openers": {
         "value": {
          "name": "Re-engage Spring Sale non-openers",
          "timezone": "America/New_York",
          "auto_publish": false,
          "start_time": "2026-06-01 00:00:00",
          "end_time": "2026-07-31 23:59:59",
          "nodes": [
           {
            "id": "n1",
            "type": "trigger",
            "trigger": "campaign_not_opened",
            "campaign": "Spring Sale 2026",
            "wait_for": 3,
            "wait_unit": "days"
           },
           {
            "id": "n2",
            "parent_id": "n1",
            "type": "wait_until_time",
            "mode": "day_of_week",
            "time": "10:00:00",
            "weeks": [
             "mon",
             "tue",
             "wed",
             "thu",
             "fri"
            ]
           },
           {
            "id": "n3",
            "parent_id": "n2",
            "type": "if_else",
            "filters": [
             [
              {
               "condition": "subscriber_status",
               "operator": "is",
               "status_value": "active"
              },
              {
               "condition": "contact_rating",
               "operator": "between",
               "value": {
                "from": 3,
                "to": 5
               }
              }
             ],
             [
              {
               "condition": "contact_tag",
               "operator": "any_time",
               "tag": "VIP"
              }
             ]
            ]
           },
           {
            "id": "n4",
            "parent_id": "n3",
            "branch": "yes",
            "type": "add_to_list",
            "list": "Re-engagement Pool"
           },
           {
            "id": "n5",
            "parent_id": "n3",
            "branch": "no",
            "type": "remove_tag",
            "tag": "Engaged"
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "enum": [
            "draft",
            "active"
           ],
           "description": "draft when auto_publish=false. active when auto_publish=true and all publish gates pass."
          }
         }
        },
        "examples": {
         "Example-1---draft": {
          "value": {
           "id": "wHKw",
           "status": "draft"
          }
         },
         "Example-2---active": {
          "value": {
           "id": "wHKH",
           "status": "active"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request - validation, entity-name resolution, or publish gate failure",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "nodes[2].tag",
             "message": "tag \"VIP\" not found"
            },
            {
             "field": "settings.start_time",
             "message": "must be in the future"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Forbidden - caller's plan does not include advanced automation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Plan does not include advanced automation"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Internal server error"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/inbox-tracking": {
   "post": {
    "summary": "Inbox-tracking",
    "operationId": "inbox-tracking",
    "description": "API to get inbox tracking details. Date period is required (date_from & date_to), campaign_id is optional, domain is optional",
    "tags": [
     "Inbox Tracker"
    ],
    "parameters": [
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "x-examples": {
         "Example 1": {
          "date_from": "2025-02-14",
          "date_to": "2025-02-16",
          "campaign_id": "Hws",
          "domain": "example"
         }
        },
        "required": [
         "date_from",
         "date_to"
        ],
        "properties": {
         "date_from": {
          "type": "string",
          "description": "Date format: \"2010-01-01\""
         },
         "date_to": {
          "type": "string",
          "description": "Date format: \"2010-01-01\""
         },
         "campaign_id": {
          "type": "string"
         },
         "domain": {
          "type": "string",
          "description": "Filter data by domains (Gmail,Yahoo etc)"
         }
        }
       },
       "examples": {
        "Example-1": {
         "value": {
          "date_from": "2025-02-14",
          "date_to": "2025-02-16",
          "campaign_id": "Hws",
          "domain": "example"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "campaigns": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "campaign_id": {
              "type": "string"
             },
             "campaign_name": {
              "type": "string"
             },
             "campaign_subject": {
              "type": "string"
             },
             "inbox_percentage": {
              "type": "integer"
             },
             "missed_percentage": {
              "type": "integer"
             },
             "spam_percentage": {
              "type": "integer"
             }
            }
           }
          },
          "providers": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "inbox_percentage": {
              "type": "number"
             },
             "missed_percentage": {
              "type": "number"
             },
             "name": {
              "type": "string"
             },
             "spam_percentage": {
              "type": "number"
             }
            }
           }
          },
          "summary": {
           "type": "object",
           "properties": {
            "inbox_percentage": {
             "type": "number"
            },
            "missed_percentage": {
             "type": "number"
            },
            "spam_percentage": {
             "type": "number"
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "campaigns": [
            {
             "campaign_id": "wuw",
             "campaign_name": "Copy (1) - Email Disclaimer - 1",
             "campaign_subject": "Email Disclaimer - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "wff",
             "campaign_name": "Default Speed String Fix - 1",
             "campaign_subject": "Default Speed String Fix - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "wyS",
             "campaign_name": "Spintax - 1",
             "campaign_subject": "Spintax - 1 {Hello|Hi}",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "wyu",
             "campaign_name": "Spintax - 2",
             "campaign_subject": "Spintax - 2",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "wyw",
             "campaign_name": "Custom Conditions - 1",
             "campaign_subject": "Custom Conditions - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "wyH",
             "campaign_name": "Pause Rules - 1",
             "campaign_subject": "Pause Rules - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "wyZ",
             "campaign_name": "List master id - 1",
             "campaign_subject": "List master id - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "Haa",
             "campaign_name": "Multiple sender - 1",
             "campaign_subject": "Multiple sender - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "HaK",
             "campaign_name": "Senderid -1",
             "campaign_subject": "Senderid -1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "HaS",
             "campaign_name": "Subscriber portion - 1",
             "campaign_subject": "Subscriber portion - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "Haw",
             "campaign_name": "Multiple segments - 1",
             "campaign_subject": "Multiple segments - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "HSu",
             "campaign_name": "Custom Condition Campaign - 1",
             "campaign_subject": "Custom Condition Campaign - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "HfE",
             "campaign_name": "Exclude List ids -1",
             "campaign_subject": "Exclude List ids -",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "Hff",
             "campaign_name": "Copy (1) - Exclude List ids -1",
             "campaign_subject": "Exclude List ids -",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            },
            {
             "campaign_id": "HwS",
             "campaign_name": "Deletion - 1",
             "campaign_subject": "Deletion - 1",
             "inbox_percentage": 79,
             "missed_percentage": 0,
             "spam_percentage": 21
            },
            {
             "campaign_id": "Hwu",
             "campaign_name": "Quota - 1",
             "campaign_subject": "Quota - 1",
             "inbox_percentage": 0,
             "missed_percentage": 100,
             "spam_percentage": 0
            }
           ],
           "providers": [
            {
             "inbox_percentage": 5.1,
             "missed_percentage": 94.12,
             "name": "gmail",
             "spam_percentage": 0.78
            },
            {
             "inbox_percentage": 2.94,
             "missed_percentage": 94.85,
             "name": "others",
             "spam_percentage": 2.21
            },
            {
             "inbox_percentage": 3.43,
             "missed_percentage": 93.63,
             "name": "outlook",
             "spam_percentage": 2.94
            },
            {
             "inbox_percentage": 4.71,
             "missed_percentage": 94.12,
             "name": "yahoo",
             "spam_percentage": 1.18
            }
           ],
           "summary": {
            "inbox_percentage": 4.65,
            "missed_percentage": 94.12,
            "spam_percentage": 1.24
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "campaigns": [
            {
             "campaign_id": "string",
             "campaign_name": "string",
             "campaign_subject": "string",
             "inbox_percentage": 0,
             "missed_percentage": 0,
             "spam_percentage": 0
            }
           ],
           "providers": [
            {
             "inbox_percentage": 0,
             "missed_percentage": 0,
             "name": "string",
             "spam_percentage": 0
            }
           ],
           "summary": {
            "inbox_percentage": 0,
            "missed_percentage": 0,
            "spam_percentage": 0
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "domain",
             "message": "Domain must be one of: gmail, yahoo, outlook, others"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "domain",
             "message": "Domain must be one of: gmail, yahoo, outlook, others"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         },
         "x-examples": {
          "Example 1": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/segments/{id}": {
   "put": {
    "summary": "Update a Segment",
    "operationId": "update-a-segment",
    "description": "Update an existing segment by id. The full segment definition is replaced - this is NOT a partial update. Send the complete `name`, `match`, `rules` (and optional `lists`) on every call.\n\nOn success, the segment's `active_count` is recomputed asynchronously. `GET /v1/segments/{id}` will return `count_status: pending` until the recount finishes (seconds to minutes), then `ready`.\n\nField vocabulary, operator families, and value shapes match the create endpoint - see POST /v1/segments for the full reference.",
    "tags": [
     "Segments"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Segment ID to update."
     },
     {
      "name": "Content-Type",
      "in": "header",
      "required": true,
      "description": "Request body type",
      "schema": {
       "type": "string",
       "default": "application/json"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "match",
         "rules"
        ],
        "properties": {
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "description": "Segment display name. Must be unique within the account.\n\nMinimum: 1\nMaximum: 100"
         },
         "match": {
          "type": "string",
          "enum": [
           "all",
           "any"
          ],
          "description": "How rules combine.\n\nall: every rule must match (AND)\nany: at least one rule must match (OR)\n\nSupported values: all, any"
         },
         "lists": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 150,
          "description": "Optional. Restrict the segment to contacts in these lists. Provide list names (cid-scoped). Maximum 150 lists. Pass an empty array to clear the list restriction."
         },
         "rules": {
          "type": "array",
          "minItems": 1,
          "description": "Filter rules. At least one rule is required. The full rule set replaces the existing rules - to keep a rule, include it in this array.",
          "items": {
           "type": "object",
           "required": [
            "filter_type"
           ],
           "properties": {
            "filter_type": {
             "type": "string",
             "enum": [
              "contact_details",
              "contact_property",
              "tag",
              "activity"
             ],
             "description": "Type of filter rule.\n\ncontact_details: built-in contact fields (email_status, contact_rating, email_domain, etc.)\ncontact_property: custom field defined in your account\ntag: contact tags (encrypted tag IDs)\nactivity: campaign / automation / engagement events\n\nSupported values: contact_details, contact_property, tag, activity"
            },
            "field": {
             "type": "string",
             "description": "Field name. Required for contact_details and contact_property.\n\nFor contact_details, allowed values: email_status, verification_status, contact_rating, email_domain, mailbox_provider, signup_source\n\nFor contact_property, use the property mapping_name (e.g. custom_1, country, salary). Must match ^[A-Za-z0-9_]+$\n\nNote: verification_status is a write-side alias and collapses to email_status in storage; GET round-trip always returns field=email_status."
            },
            "property_type": {
             "type": "string",
             "enum": [
              "text",
              "number",
              "date"
             ],
             "description": "For contact_property only. Picks the operator family. Defaults from the custom field's type in gyh_custom_fields if omitted."
            },
            "operator": {
             "type": "string",
             "description": "Comparison operator. Allowed values depend on the filter_type / field / property_type.\n\nText operators: equal_to (also accepts is, equals), not_equal_to (also is_not), exact_match, contains, does_not_contain, starts_with, does_not_start_with, ends_with, does_not_end_with, any_of, is_known, is_unknown\n\nNumber operators (per PR #142 operator-canonical fix): equal_to (canonical, also accepts equal_to_number, is_number), not_equal_to (canonical, also accepts not_equal_to_number), less_than, less_than_number (verbatim - kept distinct because of its SQL > 0 guard), greater_than, between, is_known_number, is_unknown_number\n\nDate operators: in_the_last_days (also in_last_days), not_in_the_last_days, date_between, on_a_specific_date, is_after, is_before, date_is_not, date_is_known, date_is_unknown\n\nTag operators: is_tagged, is_not_tagged\n\nemail_status field: equal_to, not_equal_to, any_of\nsignup_source field: was, was_not"
            },
            "value": {
             "description": "Filter value. Type depends on operator.\n\nText/number equality: string or number\nany_of: array of strings\nbetween: { from: number, to: number }\ndate_between: { from: YYYY-MM-DD, to: YYYY-MM-DD }\nin_the_last_days / not_in_the_last_days: integer 1-365\nis_known / is_unknown / is_known_number / is_unknown_number / date_is_known / date_is_unknown / is_empty / is_not_empty: omit value\n\nemail_status enum: valid, unknown, suppressed, unsubscribed, spam, bounced, external_group_mailbox, spam_trap, external_abusers, external_invalid, spam_complaints, frequent_abusers, external_verified, blacklisted, account_level_bounce\n\nsignup_source enum: admin_add, import, api, webform"
            },
            "filter_by": {
             "type": "string",
             "description": "Sub-selector for tag and activity rules.\n\nFor tag filter_type with is_tagged / is_not_tagged: any_of, all_of\n\nFor activity filter_type: any_of_the_last_five, all_of_the_last_five, any_of_last_seven_day, any_of_last_one_month, any_of_last_three_month, between, in_the_last_days, not_in_the_last_days, count, count_between, order_by_count, before, after, on, for, between_time"
            },
            "category": {
             "type": "string",
             "enum": [
              "campaign",
              "automation",
              "webform",
              "list",
              "audience",
              "engagement_status",
              "global_engagers",
              "global_openers",
              "subscriber_opened",
              "subscriber_clicked"
             ],
             "description": "Activity category. Required when filter_type=activity.\n\nSupported values: campaign, automation, webform, list, audience, engagement_status, global_engagers, global_openers, subscriber_opened, subscriber_clicked"
            },
            "activity": {
             "type": "string",
             "description": "Activity event name. Required for some activity categories (campaign, automation, webform, list, audience).\n\nSupported values: opened, not_opened, clicked, not_clicked, sent, not_sent, started, completed, not_started, not_completed, happened, not_happened"
            }
           }
          }
         }
        }
       },
       "examples": {
        "Example-1---Rename-and-tighten-rules": {
         "value": {
          "name": "Active gmail subscribers - high rating",
          "match": "all",
          "lists": [
           "Newsletter Subscribers"
          ],
          "rules": [
           {
            "filter_type": "contact_details",
            "field": "email_status",
            "operator": "equal_to",
            "value": "valid"
           },
           {
            "filter_type": "contact_details",
            "field": "email_domain",
            "operator": "contains",
            "value": "gmail"
           },
           {
            "filter_type": "contact_details",
            "field": "contact_rating",
            "operator": "between",
            "value": {
             "from": 4,
             "to": 5
            }
           }
          ]
         }
        },
        "Example-2---Switch-from-AND-to-OR--broaden-audience-": {
         "value": {
          "name": "Active OR recently engaged",
          "match": "any",
          "rules": [
           {
            "filter_type": "contact_details",
            "field": "email_status",
            "operator": "equal_to",
            "value": "valid"
           },
           {
            "filter_type": "activity",
            "category": "campaign",
            "activity": "opened",
            "filter_by": "in_the_last_days",
            "value": 30
           },
           {
            "filter_type": "activity",
            "category": "campaign",
            "activity": "clicked",
            "filter_by": "in_the_last_days",
            "value": 30
           }
          ]
         }
        },
        "Example-3---Clear-list-restriction-and-switch-to-tag-based": {
         "value": {
          "name": "All VIPs across lists",
          "match": "all",
          "lists": [],
          "rules": [
           {
            "filter_type": "tag",
            "operator": "is_tagged",
            "filter_by": "any_of",
            "value": [
             "enc_t1",
             "enc_t2"
            ]
           },
           {
            "filter_type": "contact_details",
            "field": "email_status",
            "operator": "any_of",
            "value": [
             "valid",
             "external_verified"
            ]
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "message": {
           "type": "string"
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "message": "Segment updated"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request - validation, name resolution, or operator-shape failure",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "rules[0].field",
             "message": "Unknown contact_details field 'foo'"
            },
            {
             "field": "rules[1].value",
             "message": "between requires { from, to }"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Authorization failed"
            }
           ]
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Forbidden - caller's plan does not include segmentation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "",
             "message": "Plan does not include segmentation"
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "field": {
              "type": "string"
             },
             "message": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "examples": {
         "Example-1": {
          "value": {
           "errors": [
            {
             "field": "id",
             "message": "Record not found with the given Id"
            }
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  }
 },
 "tags": [
  {
   "name": "Campaigns"
  },
  {
   "name": "Contacts"
  },
  {
   "name": "Lists"
  },
  {
   "name": "Tags"
  },
  {
   "name": "Segments"
  },
  {
   "name": "Custom Properties"
  },
  {
   "name": "Senders"
  },
  {
   "name": "Templates"
  },
  {
   "name": "Automations"
  },
  {
   "name": "Webhooks"
  },
  {
   "name": "Webforms"
  },
  {
   "name": "Inbox Tracker"
  },
  {
   "name": "Account"
  }
 ]
}