Required Headers JSON/XML

Content-Type: application/json
Accept: application/json
OR
Content-Type: application/xml
Accept: application/xml


Datatype Information

String: Maximum 255 characters
Accept: application/json
OR
Content-Type: application/xml
Accept: application/xml


Required Parameters

auth_token (use an API key as value of this parameter)


Optional Parameters

per: (by default there are 200 records on each page, use this to fetch any number of records between a minimum of 200 and a maximum of 5000 records)


Growth and Attrition Reports API

GET https://api.maropost.com/v2/:account_id/analytics/custom_reports/:id(.:format)
custom_reports#show

(To get report and its data.)
POST https://api.maropost.com/v2/:account_id/analytics/custom_reports(.:format)
custom_reports#create

To generate a Growth and Attrition report, you would make a HTTP POST request using this JSON payload.
{
  "report": {
    "report_type": "growth_attrition",
    "name": "Sample GrowthAttrition Report",
    "from": "2024-03-01",
    "upto": "2024-03-31",
    "list_ids": [
      "1",
      "2",
      "3"
    ],
    "email_file_type": "1",
    "time_format": "1",
    "selected_fields": [
      "dnm_total",
      "dnm_per_list",
      "user_attrition_total",
      "user_attrition_per_list",
      "subscribed_user_growth_total",
      "subscribed_user_growth_per_list",
      "unsubscribed_user_growth_total",
      "unsubscribed_user_growth_per_list"
    ],
    "send_to_email": [
      "jhondoe@gmail.com"
    ],
    "send_to_subject": "Growth Attrition Report",
    "send_to_comments": "PFA Growth and Attrition Report",
    "email_option": "1",
    "schedule_type": "2",
    "run_at_option": "1",
    "runtime": "2024-03-31 23:00:00"
  }
}

Reports API

GET https://api.maropost.com/accounts/:account_id/reports/opens(.:format)
reports#opens

GET https://api.maropost.com/accounts/:account_id/reports/opens(.:format)?fields="email,first_name,city"
reports#fields

(To get opens with mention contact fields)
GET https://api.maropost.com/accounts/:account_id/reports/opens(.:format)?from=2015-09-01&to=2015-12-31
reports#opens_in_a_date_range

(To get opens between a specific date range)
GET https://api.maropost.com/accounts/:account_id/reports/opens(.:format)?unique=true
reports#unique_opens

(To get unique opens)
GET https://api.maropost.com/accounts/:account_id/reports/opens(.:format)?email=api@email.com
reports#contact_opens

(To get opens for a specific contact)
GET https://api.maropost.com/accounts/:account_id/reports/opens(.:format)?uid=abcd
reports#uid

(To get opens for a specific contact via UID)
GET https://api.maropost.com/accounts/:account_id/reports/opens(.:format)?per=300
reports#number_of_opens

(To get desired number of opens per page)
To get a list of open reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<opens type="array">
  <open>
    <account-id type="integer">4</account-id>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141625</contact-id>
    <uid>abcd</uid>
    <browser>Other</browser>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <contact>
      <email>tes1@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </open>
  <open>
    <account-id type="integer">4</account-id>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141782</contact-id>
    <uid>wxyz</uid>
    <browser>Other</browser>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <contact>
      <email>tes1@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </open>
</opens>
To get a list of open reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "campaign_id": 18812,
    "contact_id": 7141625,
    "uid": "abcd",
    "browser": "Other",
    "recorded_at": "2024-04-24T13:57:33.516-04:00",
    "contact": {
      "email": "tes1@yahoo.com"
    },
    "total_pages": 1
  },
  {
    "account_id": 4,
    "campaign_id": 18812,
    "contact_id": 7141782,
    "uid": "wxyz",
    "browser": "Other",
    "recorded_at": "2024-04-24T13:57:33.516-04:00",
    "contact": {
      "email": "tes1@yahoo.com"
    },
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/reports/clicks(.:format)
reports#clicks

GET https://api.maropost.com/accounts/:account_id/reports/clicks(.:format)?fields="email,first_name,city"
reports#fields

(To get clicks with mention contact fields)
GET https://api.maropost.com/accounts/:account_id/reports/clicks(.:format)?from=2015-09-01&to=2015-12-31
reports#clicks_in_date_range

(To get clicks between a specific date range)
GET https://api.maropost.com/accounts/:account_id/reports/clicks(.:format)?unique=true
reports#unique_clicks

(To get unique clicks)
GET https://api.maropost.com/accounts/:account_id/reports/clicks(.:format)?email=api@email.com
reports#contact_clicks

(To get clicks for a specific contact)
GET https://api.maropost.com/accounts/:account_id/reports/clicks(.:format)?uid=abcd
reports#uid

(To get clicks for a specific contact via UID)
GET https://api.maropost.com/accounts/:account_id/reports/clicks(.:format)?per=300
reports#number_of_clicks

(To get desired number of clicks per page)
To get a list of click reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<clicks type="array">
  <click>
    <account-id type="integer">4</account-id>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141625</contact-id>
    <uid>abcd</uid>
    <url>http://altdaily.mikegeary1.hop.clickbank.net/?pid=434</url>
    <browser>Other</browser>
    <content-url-id nil="true"/>
    <ip-address nil="true"/>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <contact>
      <email>tes1@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </click>
  <click>
    <account-id type="integer">4</account-id>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141782</contact-id>
    <uid>wxyz</uid>
    <url>http://altdaily.mikegeary1.hop.clickbank.net/?pid=434</url>
    <browser>Other</browser>
    <content-url-id nil="true"/>
    <ip-address nil="true"/>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <contact>
      <email>tes1@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </click>
</clicks>
To get a list of click reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "campaign_id": 18812,
    "contact_id": 7141625,
    "uid": "abcd",
    "url": "http://altdaily.mikegeary1.hop.clickbank.net/?pid=434",
    "browser": "Other",
    "content_url_id": null,
    "ip_address": null,
    "recorded_at": "2024-04-24T13:57:33.518-04:00",
    "contact": {
      "email": "tes1@yahoo.com"
    },
    "total_pages": 1
  },
  {
    "account_id": 4,
    "campaign_id": 18812,
    "contact_id": 7141782,
    "uid": "wxyz",
    "url": "http://altdaily.mikegeary1.hop.clickbank.net/?pid=434",
    "browser": "Other",
    "content_url_id": null,
    "ip_address": null,
    "recorded_at": "2024-04-24T13:57:33.518-04:00",
    "contact": {
      "email": "tes1@yahoo.com"
    },
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)
reports#bounces

GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?fields="email,first_name,city"
reports#fields

(To get bounces with mention contact fields)
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?from=2015-09-01&to=2015-12-31
reports#bounces_in_date_range

(To get bounces between a specific date range)
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?unique=true
reports#unique_bounces

(To get unique bounces)
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?email=api@email.com
reports#contact_bounces

(To get bounces for a specific contact)
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?uid=abcd
reports#uid

(To get bounces for a specific contact via UID)
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?type=hard
reports#hard_bounces

(To get only Hard bounces)
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?type=soft
reports#soft_bounces

(To get only Soft bounces)
GET https://api.maropost.com/accounts/:account_id/reports/bounces(.:format)?per=300
reports#number_of_bounces

(To get desired number of bounces per page)
To get a list of bounce reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<bounces type="array">
  <bounce>
    <type>Soft</type>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <uid>abcd</uid>
    <error>4.2.1</error>
    <diagnostic>Inbox full.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <contact>
      <email>tes1@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </bounce>
  <bounce>
    <type>Hard</type>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <uid>wxyz</uid>
    <error>4.2.3</error>
    <diagnostic>Inbox is full.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <contact>
      <email>testing@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </bounce>
</bounces>
To get a list of bounce reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "type": "Soft",
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "uid": "abcd",
    "error": "4.2.1",
    "diagnostic": "Inbox full.",
    "recorded_on": "2024-04-24T13:57:33.520-04:00",
    "contact": {
      "email": "tes1@yahoo.com"
    },
    "total_pages": 1
  },
  {
    "type": "Hard",
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "uid": "wxyz",
    "error": "4.2.3",
    "diagnostic": "Inbox is full.",
    "recorded_on": "2024-04-24T13:57:33.520-04:00",
    "contact": {
      "email": "testing@yahoo.com"
    },
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/reports/unsubscribes(.:format)
reports#unsubscribes

GET https://api.maropost.com/accounts/:account_id/reports/unsubscribes(.:format)?fields="email,first_name,city"
reports#fields

(To get unsubscribes with mention contact fields)
GET https://api.maropost.com/accounts/:account_id/reports/unsubscribes(.:format)?from=2015-09-01&to=2015-12-31
reports#unsubscribes_in_date_range

(To get unsubscribes between a specific date range)
GET https://api.maropost.com/accounts/:account_id/reports/unsubscribes(.:format)?unique=true
reports#unique_unsubscribes

(To get unique unsubscribes)
GET https://api.maropost.com/accounts/:account_id/reports/unsubscribes(.:format)?email=api@email.com
reports#contact_unsubscribes

(To get unsubscribes for a specific contact)
GET https://api.maropost.com/accounts/:account_id/reports/unsubscribes(.:format)?uid=abcd
reports#uid

(To get unsubscribes for a specific contact via UID)
GET https://api.maropost.com/accounts/:account_id/reports/unsubscribes(.:format)?per=300
reports#number_of_unsubscribes

(To get desired number of unsubscribes per page)
To get a list of unsubscribe reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<unsubscribes type="array">
  <unsubscribe>
    <account-id type="integer">1</account-id>
    <list-id>16</list-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <uid>abcd</uid>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <contact>
      <email>test01@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </unsubscribe>
  <unsubscribe>
    <account-id type="integer">1</account-id>
    <list-id>16</list-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">20</contact-id>
    <uid>wxyz</uid>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <contact>
      <email>testing@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </unsubscribe>
</unsubscribes>
To get a list of unsubscribe reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "list_id": "16",
    "campaign_id": 40,
    "contact_id": 10,
    "uid": "abcd",
    "recorded_on": "2024-04-24T13:57:33.521-04:00",
    "contact": {
      "email": "test01@yahoo.com"
    },
    "total_pages": 1
  },
  {
    "account_id": 1,
    "list_id": "16",
    "campaign_id": 40,
    "contact_id": 20,
    "uid": "wxyz",
    "recorded_on": "2024-04-24T13:57:33.521-04:00",
    "contact": {
      "email": "testing@yahoo.com"
    },
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/reports/complaints(.:format)
reports#complaints

GET https://api.maropost.com/accounts/:account_id/reports/complaints(.:format)?fields="email,first_name,city"
reports#fields

(To get complaints with mention contact fields)
GET https://api.maropost.com/accounts/:account_id/reports/complaints(.:format)?from=2015-09-01&to=2015-12-31
reports#complaints_in_date_range

(To get complaints between a specific date range)
GET https://api.maropost.com/accounts/:account_id/reports/complaints(.:format)?unique=true
reports#unique_complaints

(To get unique complaints)
GET https://api.maropost.com/accounts/:account_id/reports/complaints(.:format)?email=api@email.com
reports#contact_complaints

(To get complaints for a specific contact)
GET https://api.maropost.com/accounts/:account_id/reports/complaints(.:format)?uid=abcd
reports#uid

(To get complaints for a specific contact via UID)
GET https://api.maropost.com/accounts/:account_id/reports/complaints(.:format)?per=300
reports#number_of_complaints

(To get desired number of complaints per page)
To get a list of complaint reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<complaints type="array">
  <complaint>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <uid>abcd</uid>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <contact>
      <email>test01@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </complaint>
  <complaint>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">20</contact-id>
    <uid>wxyz</uid>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <contact>
      <email>testing@yahoo.com</email>
    </contact>
    <total-pages type="integer">1</total-pages>
  </complaint>
</complaints>
To get a list of complaint reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "uid": "abcd",
    "recorded_on": "2024-04-24T13:57:33.522-04:00",
    "contact": {
      "email": "test01@yahoo.com"
    },
    "total_pages": 1
  },
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 20,
    "uid": "wxyz",
    "recorded_on": "2024-04-24T13:57:33.522-04:00",
    "contact": {
      "email": "testing@yahoo.com"
    },
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/reports(.:format)
reports#index

To get a list of campaign reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<reports type="array">
  <report>
    <status>sent</status>
    <delivered type="integer">2</delivered>
    <name>Another Test 71</name>
    <click type="integer">4</click>
    <open type="integer">10</open>
    <bounce type="integer">1</bounce>
    <sent-at type="dateTime">2024-04-24T13:57:33-04:00</sent-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <sent type="integer">20</sent>
    <send-at type="dateTime">2024-04-24T13:57:33-04:00</send-at>
    <campaign-id type="integer">79</campaign-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  </report>
  <report>
    <status>sent</status>
    <delivered type="integer">2</delivered>
    <name>Test 171</name>
    <click type="integer">6</click>
    <open type="integer">9</open>
    <bounce type="integer">2</bounce>
    <sent-at type="dateTime">2024-04-24T13:57:33-04:00</sent-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <sent type="integer">30</sent>
    <send-at type="dateTime">2024-04-24T13:57:33-04:00</send-at>
    <campaign-id type="integer">74</campaign-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  </report>
</reports>
To get a list of campaign reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "status": "sent",
    "delivered": 2,
    "name": "Another Test 71",
    "click": 4,
    "open": 10,
    "bounce": 1,
    "sent_at": "2024-04-24T13:57:33.524-04:00",
    "updated_at": "2024-04-24T13:57:33.524-04:00",
    "sent": 20,
    "send_at": "2024-04-24T13:57:33.524-04:00",
    "campaign_id": 79,
    "created_at": "2024-04-24T13:57:33.524-04:00"
  },
  {
    "status": "sent",
    "delivered": 2,
    "name": "Test 171",
    "click": 6,
    "open": 9,
    "bounce": 2,
    "sent_at": "2024-04-24T13:57:33.524-04:00",
    "updated_at": "2024-04-24T13:57:33.524-04:00",
    "sent": 30,
    "send_at": "2024-04-24T13:57:33.524-04:00",
    "campaign_id": 74,
    "created_at": "2024-04-24T13:57:33.524-04:00"
  }
]
GET https://api.maropost.com/accounts/:account_id/ab_reports(.:format)
reports#ab_reports

GET https://api.maropost.com/accounts/:account_id/ab_reports(.:format)?name=ab
reports#name

(To get ab_reports with mention name)
GET https://api.maropost.com/accounts/:account_id/ab_reports(.:format)?from=2015-09-01&to=2015-12-31
reports#ab_reports_in_date_range

(To get ab_reports between a specific date range)
GET https://api.maropost.com/accounts/:account_id/ab_reports(.:format)?per=300
reports#number_of_ab_reports

(To get desired number of ab_reports per page)
To get a list of ab reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<reports type="array">
  <report>
    <id type="integer">9865</id>
    <account-id type="integer">1</account-id>
    <list-id nil="true"/>
    <segment-id nil="true"/>
    <content-id type="integer">0</content-id>
    <content-history-id nil="true"/>
    <from-name>ab test name</from-name>
    <from-email>atul@maropost.com</from-email>
    <subject>ab test</subject>
    <name>Hello Ab Campaign</name>
    <send-at>2017-03-20T00:00:00.000-04:00</send-at>
    <sent-at>2017-09-18T04:30:17.000-04:00</sent-at>
    <status>sent</status>
    <reply-to>atul@maropost.com</reply-to>
    <test-campaign type="boolean">false</test-campaign>
    <created-at>2017-03-15T07:06:47.000-04:00</created-at>
    <updated-at>2017-09-18T06:30:20.000-04:00</updated-at>
    <language>en</language>
    <address>The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408</address>
    <contacts-count type="integer">4</contacts-count>
    <recurring nil="true"/>
    <recurring-time nil="true"/>
    <parent-id nil="true"/>
    <version-number nil="true"/>
    <campaign-type type="integer">3</campaign-type>
    <decided-by>Opens</decided-by>
    <winner-group-id nil="true"/>
    <campaign-group-id nil="true"/>
    <winner-campaign-id nil="true"/>
    <suppress-workflow type="boolean">false</suppress-workflow>
    <email-preview-link type="boolean">true</email-preview-link>
    <send-optimization type="boolean">false</send-optimization>
    <workflow-item-id nil="true"/>
    <preheader nil="true"/>
    <one-time type="boolean">false</one-time>
    <crm-name nil="true"/>
    <folder-id nil="true"/>
    <brand-id nil="true"/>
    <crm-campaign-id nil="true"/>
    <total-pages type="integer">1</total-pages>
    <send-total type="integer">0</send-total>
    <received-total type="integer">0</received-total>
    <open-total type="integer">0</open-total>
    <click-total type="integer">0</click-total>
    <unique-bounces type="integer">0</unique-bounces>
    <unique-unsubscribes type="integer">0</unique-unsubscribes>
    <ab-campaigns type="array">
      <ab-campaign>
        <id type="integer">9866</id>
        <name>Group A</name>
        <send-at>2017-03-17T00:00:00.000-04:00</send-at>
        <contacts-count nil="true"/>
        <send-total type="integer">0</send-total>
        <received-total type="integer">0</received-total>
        <open-total type="integer">0</open-total>
        <click-total type="integer">0</click-total>
        <unique-bounces type="integer">0</unique-bounces>
        <unique-unsubscribes type="integer">0</unique-unsubscribes>
      </ab-campaign>
      <ab-campaign>
        <id type="integer">9867</id>
        <name>Group B</name>
        <send-at>2017-03-18T00:00:00.000-04:00</send-at>
        <contacts-count nil="true"/>
        <send-total type="integer">0</send-total>
        <received-total type="integer">0</received-total>
        <open-total type="integer">0</open-total>
        <click-total type="integer">0</click-total>
        <unique-bounces type="integer">0</unique-bounces>
        <unique-unsubscribes type="integer">0</unique-unsubscribes>
      </ab-campaign>
    </ab-campaigns>
  </report>
</reports>
To get a list of ab reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "id": 9865,
    "account_id": 1,
    "list_id": null,
    "segment_id": null,
    "content_id": 0,
    "content_history_id": null,
    "from_name": "ab test name",
    "from_email": "atul@maropost.com",
    "subject": "ab test",
    "name": "Hello Ab Campaign",
    "send_at": "2017-03-20T00:00:00.000-04:00",
    "sent_at": "2017-09-18T04:30:17.000-04:00",
    "status": "sent",
    "reply_to": "atul@maropost.com",
    "test_campaign": false,
    "created_at": "2017-03-15T07:06:47.000-04:00",
    "updated_at": "2017-09-18T06:30:20.000-04:00",
    "language": "en",
    "address": "The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408",
    "contacts_count": 4,
    "recurring": null,
    "recurring_time": null,
    "parent_id": null,
    "version_number": null,
    "campaign_type": 3,
    "decided_by": "Opens",
    "winner_group_id": null,
    "campaign_group_id": null,
    "winner_campaign_id": null,
    "suppress_workflow": false,
    "email_preview_link": true,
    "send_optimization": false,
    "workflow_item_id": null,
    "preheader": null,
    "one_time": false,
    "crm_name": null,
    "folder_id": null,
    "brand_id": null,
    "crm_campaign_id": null,
    "total_pages": 1,
    "send_total": 0,
    "received_total": 0,
    "open_total": 0,
    "click_total": 0,
    "unique_bounces": 0,
    "unique_unsubscribes": 0,
    "ab_campaigns": [
      {
        "id": 9866,
        "name": "Group A",
        "send_at": "2017-03-17T00:00:00.000-04:00",
        "contacts_count": null,
        "send_total": 0,
        "received_total": 0,
        "open_total": 0,
        "click_total": 0,
        "unique_bounces": 0,
        "unique_unsubscribes": 0
      },
      {
        "id": 9867,
        "name": "Group B",
        "send_at": "2017-03-18T00:00:00.000-04:00",
        "contacts_count": null,
        "send_total": 0,
        "received_total": 0,
        "open_total": 0,
        "click_total": 0,
        "unique_bounces": 0,
        "unique_unsubscribes": 0
      }
    ]
  }
]
GET https://api.maropost.com/accounts/:account_id/reports/test_reports(.:format)
reports#test_reports

To get a list of test reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<reports type="array">
  <report>
    <test>Test Campaign888</test>
    <campaign-id type="integer">1</campaign-id>
    <send-at type="dateTime">2024-04-24T13:57:33-04:00</send-at>
    <sent-at type="dateTime">2024-04-24T13:57:33-04:00</sent-at>
    <sent type="integer">21</sent>
    <delivered type="integer">20</delivered>
    <opens type="integer">14</opens>
    <clicks type="integer">6</clicks>
    <bounces type="integer">3</bounces>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
  </report>
  <report>
    <test>Marina Tower Waikiki JANas</test>
    <campaign-id type="integer">2</campaign-id>
    <send-at type="dateTime">2024-04-24T13:57:33-04:00</send-at>
    <sent-at type="dateTime">2024-04-24T13:57:33-04:00</sent-at>
    <sent type="integer">30</sent>
    <delivered type="integer">28</delivered>
    <opens type="integer">10</opens>
    <clicks type="integer">7</clicks>
    <bounces type="integer">1</bounces>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
  </report>
</reports>
To get a list of test reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "test": "Test Campaign888",
    "campaign_id": 1,
    "send_at": "2024-04-24T13:57:33.528-04:00",
    "sent_at": "2024-04-24T13:57:33.528-04:00",
    "sent": 21,
    "delivered": 20,
    "opens": 14,
    "clicks": 6,
    "bounces": 3,
    "created_at": "2024-04-24T13:57:33.528-04:00",
    "updated_at": "2024-04-24T13:57:33.528-04:00",
    "total_pages": 1
  },
  {
    "test": "Marina Tower Waikiki JANas",
    "campaign_id": 2,
    "send_at": "2024-04-24T13:57:33.528-04:00",
    "sent_at": "2024-04-24T13:57:33.528-04:00",
    "sent": 30,
    "delivered": 28,
    "opens": 10,
    "clicks": 7,
    "bounces": 1,
    "created_at": "2024-04-24T13:57:33.528-04:00",
    "updated_at": "2024-04-24T13:57:33.528-04:00",
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/reports/journeys(.:format)
reports#journeys

To get a list of journey reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<reports type="array">
  <report>
    <journey>WelcomeTest</journey>
    <sent type="integer">5</sent>
    <delivered type="integer">5</delivered>
    <open type="integer">20</open>
    <click type="integer">1</click>
    <bounce type="integer">0</bounce>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <campaigns type="array">
      <campaign>
        <campaign>Welcome</campaign>
        <sent type="integer">1</sent>
        <delivered type="integer">1</delivered>
        <open type="integer">7</open>
        <click type="integer">0</click>
        <bounce type="integer">0</bounce>
      </campaign>
      <campaign>
        <campaign>Welcome 2</campaign>
        <sent type="integer">1</sent>
        <delivered type="integer">1</delivered>
        <open type="integer">2</open>
        <click type="integer">0</click>
        <bounce type="integer">0</bounce>
      </campaign>
      <campaign>
        <campaign>Welcome 3</campaign>
        <sent type="integer">1</sent>
        <delivered type="integer">1</delivered>
        <open type="integer">3</open>
        <click type="integer">0</click>
        <bounce type="integer">0</bounce>
      </campaign>
      <campaign>
        <campaign>Welcome 4</campaign>
        <sent type="integer">1</sent>
        <delivered type="integer">1</delivered>
        <open type="integer">6</open>
        <click type="integer">1</click>
        <bounce type="integer">0</bounce>
      </campaign>
      <campaign>
        <campaign>Welcome 5</campaign>
        <sent type="integer">1</sent>
        <delivered type="integer">1</delivered>
        <open type="integer">2</open>
        <click type="integer">0</click>
        <bounce type="integer">0</bounce>
      </campaign>
    </campaigns>
    <total-pages type="integer">1</total-pages>
  </report>
</reports>
To get a list of journey reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "journey": "WelcomeTest",
    "sent": 5,
    "delivered": 5,
    "open": 20,
    "click": 1,
    "bounce": 0,
    "created_at": "2024-04-24T13:57:33.531-04:00",
    "updated_at": "2024-04-24T13:57:33.531-04:00",
    "campaigns": [
      {
        "campaign": "Welcome",
        "sent": 1,
        "delivered": 1,
        "open": 7,
        "click": 0,
        "bounce": 0
      },
      {
        "campaign": "Welcome 2",
        "sent": 1,
        "delivered": 1,
        "open": 2,
        "click": 0,
        "bounce": 0
      },
      {
        "campaign": "Welcome 3",
        "sent": 1,
        "delivered": 1,
        "open": 3,
        "click": 0,
        "bounce": 0
      },
      {
        "campaign": "Welcome 4",
        "sent": 1,
        "delivered": 1,
        "open": 6,
        "click": 1,
        "bounce": 0
      },
      {
        "campaign": "Welcome 5",
        "sent": 1,
        "delivered": 1,
        "open": 2,
        "click": 0,
        "bounce": 0
      }
    ],
    "total_pages": 1
  }
]
POST https://api.maropost.com/accounts/:account_id/reports(.:format)
reports#create

To create a custom report using XML as the input data format, you would make a HTTP POST request:
<report>
  <name>A custom report</name>
  <list-ids type="array">
    <list-id type="integer">23</list-id>
    <list-id type="integer">22</list-id>
  </list-ids>
  <from type="dateTime">2024-04-24T13:57:33-04:00</from>
  <upto type="dateTime">2024-04-24T13:57:33-04:00</upto>
</report>
To create a client using JSON as the input data format, you would make a HTTP POST request:
{
  "report": {
    "name": "A custom report",
    "list_ids": [
      23,
      22
    ],
    "from": "2024-04-24T13:57:33.532-04:00",
    "upto": "2024-04-24T13:57:33.532-04:00"
  }
}
GET https://api.maropost.com/accounts/:account_id/reports/:id(.:format)
reports#show

To get a report in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<report>
  <account-id type="integer">4</account-id>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <data>
    <open-total type="integer">88</open-total>
    <open-uniques type="integer">34</open-uniques>
    <send-total type="integer">94</send-total>
    <click-total type="integer">1</click-total>
    <click-uniques type="integer">1</click-uniques>
    <unsubscribe-total type="integer">24</unsubscribe-total>
    <unsubscribe-uniques type="integer">2</unsubscribe-uniques>
  </data>
  <from>2014-04-01</from>
  <id type="integer">6626</id>
  <name>Test</name>
  <report-type>list</report-type>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <upto>2014-10-21</upto>
</report>
To get a report in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 4,
  "created_at": "2024-04-24T13:57:33.533-04:00",
  "data": {
    "open_total": 88,
    "open_uniques": 34,
    "send_total": 94,
    "click_total": 1,
    "click_uniques": 1,
    "unsubscribe_total": 24,
    "unsubscribe_uniques": 2
  },
  "from": "2014-04-01",
  "id": 6626,
  "name": "Test",
  "report_type": "list",
  "updated_at": "2024-04-24T13:57:33.533-04:00",
  "upto": "2014-10-21"
}
GET https://api.maropost.com/accounts/:account_id/reports/custom_reports/list(.:format)
(To get custom list report)
reports#custom_reports

GET https://api.maropost.com/accounts/:account_id/reports/custom_reports/campaign(.:format)
(To get custom campaign report)
reports#custom_reports

To get a list of custom reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<reports type="array">
  <report>
    <account-id type="integer">4</account-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <data nil="true"/>
    <from>2014-01-01</from>
    <id type="integer">6092</id>
    <name>Custom Report 1</name>
    <report-type>campaign</report-type>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <upto>2014-09-25</upto>
    <lists type="array"/>
    <campaigns type="array">
      <campaign>
        <id type="integer">88870</id>
        <name>Campaign 1</name>
      </campaign>
    </campaigns>
    <total-pages type="integer">1</total-pages>
  </report>
</reports>
To get a list of custom reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "created_at": "2024-04-24T13:57:33.534-04:00",
    "data": null,
    "from": "2014-01-01",
    "id": 6092,
    "name": "Custom Report 1",
    "report_type": "campaign",
    "updated_at": "2024-04-24T13:57:33.534-04:00",
    "upto": "2014-09-25",
    "lists": [

    ],
    "campaigns": [
      {
        "id": 88870,
        "name": "Campaign 1"
      }
    ],
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/ytd_reports(.:format)
reports#ytd_reports

To get a list of ytd reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<reports type="array">
  <report>
    <account-id type="integer">4</account-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <data>
      <open-total type="integer">0</open-total>
      <open-uniques type="integer">0</open-uniques>
      <send-total type="integer">0</send-total>
      <click-total type="integer">0</click-total>
      <click-uniques type="integer">0</click-uniques>
      <unsubscribe-total type="integer">0</unsubscribe-total>
      <unsubscribe-uniques type="integer">0</unsubscribe-uniques>
    </data>
    <from>2013-01-01</from>
    <id type="integer">1870</id>
    <name>Test List</name>
    <report-type>ytd</report-type>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <upto>2014-01-01</upto>
  </report>
</reports>
To get a list of ytd reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "created_at": "2024-04-24T13:57:33.536-04:00",
    "data": {
      "open_total": 0,
      "open_uniques": 0,
      "send_total": 0,
      "click_total": 0,
      "click_uniques": 0,
      "unsubscribe_total": 0,
      "unsubscribe_uniques": 0
    },
    "from": "2013-01-01",
    "id": 1870,
    "name": "Test List",
    "report_type": "ytd",
    "updated_at": "2024-04-24T13:57:33.536-04:00",
    "upto": "2014-01-01"
  }
]
DELETE https://api.maropost.com/accounts/:account_id/reports/:id(.:format) reports#destroy

Contents API

GET https://api.maropost.com/accounts/:account_id/contents(.:format)
contents#index

To get a list of contents in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contents type="array">
  <content>
    <account-id type="integer">4</account-id>
    <content-template-id nil="true"/>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <html-part>For testing only.</html-part>
    <id type="integer">44975</id>
    <name>testing 1</name>
    <text-part></text-part>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
  </content>
  <content>
    <account-id type="integer">4</account-id>
    <content-template-id nil="true"/>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <html-part>For testing again.</html-part>
    <id type="integer">44975</id>
    <name>testing 2</name>
    <text-part></text-part>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
  </content>
</contents>
To get a list of contents in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "content_template_id": null,
    "created_at": "2024-04-24T13:57:33.537-04:00",
    "html_part": "For testing only.",
    "id": 44975,
    "name": "testing 1",
    "text_part": "",
    "updated_at": "2024-04-24T13:57:33.537-04:00",
    "total_pages": 1
  },
  {
    "account_id": 4,
    "content_template_id": null,
    "created_at": "2024-04-24T13:57:33.537-04:00",
    "html_part": "For testing again.",
    "id": 44975,
    "name": "testing 2",
    "text_part": "",
    "updated_at": "2024-04-24T13:57:33.537-04:00",
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/contents(.:format)?page_count=true
contents#index

To get only count of pages for contents in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contents>
  <total-pages type="integer">1</total-pages>
</contents>
To get only count of pages for contents in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "total_pages": 1
}
GET https://api.maropost.com/accounts/:account_id/contents(.:format)?from=2015-09-01&to=2015-12-31
contents#contents_in_a_date_range

To get a list of contents in XML format between a specific date range, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contents type="array">
  <content>
    <account-id type="integer">4</account-id>
    <content-template-id nil="true"/>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <html-part>For testing only.</html-part>
    <id type="integer">44975</id>
    <name>testing 1</name>
    <text-part></text-part>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
  </content>
  <content>
    <account-id type="integer">4</account-id>
    <content-template-id nil="true"/>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <html-part>For testing again.</html-part>
    <id type="integer">44975</id>
    <name>testing 2</name>
    <text-part></text-part>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
  </content>
</contents>
To get a list of contents in JSON format between a specific date range, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "content_template_id": null,
    "created_at": "2024-04-24T13:57:33.538-04:00",
    "html_part": "For testing only.",
    "id": 44975,
    "name": "testing 1",
    "text_part": "",
    "updated_at": "2024-04-24T13:57:33.538-04:00",
    "total_pages": 1
  },
  {
    "account_id": 4,
    "content_template_id": null,
    "created_at": "2024-04-24T13:57:33.538-04:00",
    "html_part": "For testing again.",
    "id": 44975,
    "name": "testing 2",
    "text_part": "",
    "updated_at": "2024-04-24T13:57:33.538-04:00",
    "total_pages": 1
  }
]
POST https://api.maropost.com/accounts/:account_id/contents(.:format)
contents#create

To create a content using XML as the input data format, you would make a HTTP POST request:
<content>
  <name>Name of the content</name>
  <text-part>text part of the content</text-part>
  <html-part>Html body of the content</html-part>
  <full-email>false</full-email>
  <footer-type>default_footer</footer-type>
  <footer-id></footer-id>
</content>
To create a content using JSON as the input data format, you would make a HTTP POST request:
{
  "content": {
    "name": "Name of the content",
    "text_part": "text part of the content",
    "html_part": "Html body of the content",
    "full_email": "false",
    "footer_type": "default_footer",
    "footer_id": ""
  }
}
(REQUIRED FIELD) => name, html_part

(OPTIONAL FIELD) => full_email (Default value: false, set this to true to open the content in the HTML Source Code editor)
"footer_type" field can be set as "default_footer", "custom_footer" or "no_footer". (To attach account's default custom footer to the content, footer_type field has to be left blank)

GET https://api.maropost.com/accounts/:account_id/contents/:id(.:format)
contents#show

To get a content in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contents>
  <account-id type="integer">4</account-id>
  <content-template-id nil="true"/>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <html-part>hello</html-part>
  <id type="integer">41970</id>
  <name>ams</name>
  <text-part></text-part>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
</contents>
To get a content in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 4,
  "content_template_id": null,
  "created_at": "2024-04-24T13:57:33.539-04:00",
  "html_part": "hello",
  "id": 41970,
  "name": "ams",
  "text_part": "",
  "updated_at": "2024-04-24T13:57:33.539-04:00"
}
PUT https://api.maropost.com/accounts/:account_id/contents/:id(.:format)
contents#update

To update a content using XML as the input data format, you would make a HTTP PUT request:
<content>
  <name>Name of the content</name>
  <text-part>text part of the content</text-part>
  <html-part>Html body of the content</html-part>
  <full-email>false</full-email>
  <footer-type>custom_footer</footer-type>
  <footer-id>8</footer-id>
</content>
To update a client using JSON as the input data format, you would make a HTTP PUT request:
{
  "content": {
    "name": "Name of the content",
    "text_part": "text part of the content",
    "html_part": "Html body of the content",
    "full_email": "false",
    "footer_type": "custom_footer",
    "footer_id": "8"
  }
}
GET https://api.maropost.com/accounts/:account_id/contents/all_contents(.:format)
contents#all_contents

To get a list of only content_ids and their names in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contents type="array">
  <content>
    <id type="integer">44975</id>
    <name>testing 1</name>
  </content>
  <content>
    <id type="integer">44975</id>
    <name>testing 2</name>
  </content>
</contents>
To get a list of only content_ids and their names in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "id": 44975,
    "name": "testing 1"
  },
  {
    "id": 44975,
    "name": "testing 2"
  }
]
DELETE /accounts/:account_id/contents/:id(.:format) contents#destroy

Contents Templates API

GET https://api.maropost.com/accounts/:account_id/content_templates(.:format)
content_templates#index

To get a list of content templates in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<content-templates type="array">
  <content-template>
    <id type="integer">1</id>
    <account-id type="integer">4</account-id>
    <name>testing 1</name>
    <html-part>For testing only.</html-part>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <editor-ids type="array">
      <editor-id type="integer">1</editor-id>
      <editor-id type="integer">2</editor-id>
      <editor-id type="integer">3</editor-id>
    </editor-ids>
    <owner-id type="integer">13</owner-id>
    <tag-name nil="true"/>
    <folder-id nil="true"/>
    <editor-type nil="true"/>
    <permissions nil="true"/>
  </content-template>
  <content-template>
    <id type="integer">2</id>
    <account-id type="integer">4</account-id>
    <name>testing 1</name>
    <html-part>For testing only.</html-part>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <editor-ids type="array">
      <editor-id type="integer">1</editor-id>
      <editor-id type="integer">2</editor-id>
      <editor-id type="integer">3</editor-id>
    </editor-ids>
    <owner-id type="integer">13</owner-id>
    <tag-name nil="true"/>
    <folder-id nil="true"/>
    <editor-type nil="true"/>
    <permissions nil="true"/>
  </content-template>
</content-templates>
To get a list of content templates in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "id": 1,
    "account_id": 4,
    "name": "testing 1",
    "html_part": "For testing only.",
    "created_at": "2024-04-24T13:57:33.541-04:00",
    "updated_at": "2024-04-24T13:57:33.541-04:00",
    "editor_ids": [
      1,
      2,
      3
    ],
    "owner_id": 13,
    "tag_name": null,
    "folder_id": null,
    "editor_type": null,
    "permissions": null
  },
  {
    "id": 2,
    "account_id": 4,
    "name": "testing 1",
    "html_part": "For testing only.",
    "created_at": "2024-04-24T13:57:33.541-04:00",
    "updated_at": "2024-04-24T13:57:33.541-04:00",
    "editor_ids": [
      1,
      2,
      3
    ],
    "owner_id": 13,
    "tag_name": null,
    "folder_id": null,
    "editor_type": null,
    "permissions": null
  }
]
POST https://api.maropost.com/accounts/:account_id/content_templates(.:format)
content_templates#create

To create a content using XML as the input data format, you would make a HTTP POST request:
*Note(inclose your html in this format): <html-part> <![CDATA[ <Your HTML> ]]></html-part>
<content-template>
  <name>Name of the content template</name>
  <html-part>Html body of the content</html-part>
</content-template>
To create a content using JSON as the input data format, you would make a HTTP POST request:
{
  "content_template": {
    "name": "Name of the content template",
    "html_part": "Html body of the content"
  }
}

(REQUIRED FIELD) => name

(OPTIONAL FIELD) => html_part, editor_type (Default value: false, set this to true to open the content in the HTML Source Code editor)
"footer_type" field can be set as "default_footer", "custom_footer" or "no_footer". (To attach account's default custom footer to the content, footer_type field has to be left blank)

GET https://api.maropost.com/accounts/:account_id/content_templates/:id(.:format)
content_templates#show

To get a content template in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<content-template>
  <id type="integer">1</id>
  <account-id type="integer">4</account-id>
  <name>testing 1</name>
  <html-part>For testing only.</html-part>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <editor-ids type="array">
    <editor-id type="integer">1</editor-id>
    <editor-id type="integer">2</editor-id>
    <editor-id type="integer">3</editor-id>
  </editor-ids>
  <owner-id type="integer">13</owner-id>
  <tag-name nil="true"/>
  <folder-id nil="true"/>
  <editor-type nil="true"/>
  <permissions nil="true"/>
</content-template>
To get a content template in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "id": 1,
  "account_id": 4,
  "name": "testing 1",
  "html_part": "For testing only.",
  "created_at": "2024-04-24T13:57:33.542-04:00",
  "updated_at": "2024-04-24T13:57:33.542-04:00",
  "editor_ids": [
    1,
    2,
    3
  ],
  "owner_id": 13,
  "tag_name": null,
  "folder_id": null,
  "editor_type": null,
  "permissions": null
}
PUT https://api.maropost.com/accounts/:account_id/content_templates/:id(.:format)
content_templates#update

To update a content template using XML as the input data format, you would make a HTTP PUT request:
*Note(inclose your html in this format): <html-part> <![CDATA[ <Your HTML> ]]></html-part>
<content-template>
  <name>Name of the content template</name>
  <html-part>Html body of the content</html-part>
</content-template>
To update a content template using JSON as the input data format, you would make a HTTP PUT request:
{
  "content_template": {
    "name": "Name of the content template",
    "html_part": "Html body of the content"
  }
}
DELETE /accounts/:account_id/content_templates/:id(.:format) content_templates#destroy

Campaigns API

GET https://api.maropost.com/v2/:account_id/campaigns(.:format)?name=abc&include_ab_child=yes&page=2&per_page=20
campaigns#campaign_list

To get a list of delivered reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-lists>
  <data type="array">
    <datum>
      <id type="integer">1</id>
      <name>ab_test_campaign bb - Copy12 - Group A</name>
      <account-id type="integer">2</account-id>
      <content-id type="integer">1</content-id>
      <content-history-id nil="true"/>
      <from-email>someone@email.com</from-email>
      <subject>first </subject>
      <reply-to>someone@email.com</reply-to>
      <from-name>someone</from-name>
      <send-at>2020-10-07T07:00:00.000-04:00</send-at>
      <status>draft</status>
      <test-campaign type="boolean">false</test-campaign>
      <language>en</language>
      <address>Test address</address>
      <recurring nil="true"/>
      <recurring-time nil="true"/>
      <parent-id nil="true"/>
      <campaign-type type="integer">3</campaign-type>
      <campaign-group-id type="integer">168</campaign-group-id>
      <suppress-workflow type="boolean">false</suppress-workflow>
      <email-preview-link type="boolean">false</email-preview-link>
      <send-optimization type="boolean">false</send-optimization>
      <created-at>2020-10-07T05:27:46.000-04:00</created-at>
      <updated-at>2020-10-07T05:27:46.000-04:00</updated-at>
      <default-send-at>2020-10-07T07:00:00.000-04:00</default-send-at>
    </datum>
    <datum>
      <id type="integer">2</id>
      <name>ab_test_campaign bb - Copy12 - Group B</name>
      <account-id type="integer">2</account-id>
      <content-id type="integer">5</content-id>
      <content-history-id nil="true"/>
      <from-email>someone@email.com</from-email>
      <subject>testing group b</subject>
      <reply-to>someone@email.com</reply-to>
      <from-name>someone</from-name>
      <send-at>2020-10-07T07:00:00.000-04:00</send-at>
      <status>draft</status>
      <test-campaign type="boolean">false</test-campaign>
      <language>en</language>
      <address>Test address</address>
      <recurring nil="true"/>
      <recurring-time nil="true"/>
      <parent-id type="integer">1</parent-id>
      <campaign-type type="integer">3</campaign-type>
      <campaign-group-id type="integer">169</campaign-group-id>
      <suppress-workflow type="boolean">false</suppress-workflow>
      <email-preview-link type="boolean">false</email-preview-link>
      <send-optimization type="boolean">false</send-optimization>
      <created-at>2020-10-07T05:27:46.000-04:00</created-at>
      <updated-at>2020-10-07T05:27:46.000-04:00</updated-at>
      <default-send-at>2020-10-07T07:00:00.000-04:00</default-send-at>
    </datum>
  </data>
  <meta>
    <count type="integer">2</count>
    <page type="integer">1</page>
    <per-page type="integer">10</per-page>
  </meta>
</campaign-lists>
To get a list of delivered report in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "data": [
    {
      "id": 1,
      "name": "ab_test_campaign bb - Copy12 - Group A",
      "account_id": 2,
      "content_id": 1,
      "content_history_id": null,
      "from_email": "someone@email.com",
      "subject": "first ",
      "reply_to": "someone@email.com",
      "from_name": "someone",
      "send_at": "2020-10-07T07:00:00.000-04:00",
      "status": "draft",
      "test_campaign": false,
      "language": "en",
      "address": "Test address",
      "recurring": null,
      "recurring_time": null,
      "parent_id": null,
      "campaign_type": 3,
      "campaign_group_id": 168,
      "suppress_workflow": false,
      "email_preview_link": false,
      "send_optimization": false,
      "created_at": "2020-10-07T05:27:46.000-04:00",
      "updated_at": "2020-10-07T05:27:46.000-04:00",
      "default_send_at": "2020-10-07T07:00:00.000-04:00"
    },
    {
      "id": 2,
      "name": "ab_test_campaign bb - Copy12 - Group B",
      "account_id": 2,
      "content_id": 5,
      "content_history_id": null,
      "from_email": "someone@email.com",
      "subject": "testing group b",
      "reply_to": "someone@email.com",
      "from_name": "someone",
      "send_at": "2020-10-07T07:00:00.000-04:00",
      "status": "draft",
      "test_campaign": false,
      "language": "en",
      "address": "Test address",
      "recurring": null,
      "recurring_time": null,
      "parent_id": 1,
      "campaign_type": 3,
      "campaign_group_id": 169,
      "suppress_workflow": false,
      "email_preview_link": false,
      "send_optimization": false,
      "created_at": "2020-10-07T05:27:46.000-04:00",
      "updated_at": "2020-10-07T05:27:46.000-04:00",
      "default_send_at": "2020-10-07T07:00:00.000-04:00"
    }
  ],
  "meta": {
    "count": 2,
    "page": 1,
    "per_page": 10
  }
}
* Campaigns:

* to get child campaigns we need to pass 'include_ab_child=yes', this will include recurring and ab child campaigns
* we can search campaign by its name by passing campaign name into the name parameter for example 'name=abc'
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/delivered_report(.:format)
campaigns#delivered_report

To get a list of delivered reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-sends type="array">
  <campaign-send>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">9249</campaign-id>
    <contact-id type="integer">123775</contact-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <email>someone@yahoo.com</email>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </campaign-send>
  <campaign-send>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">9249</campaign-id>
    <contact-id type="integer">122102</contact-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <email>someone@gmail.com</email>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </campaign-send>
</campaign-sends>
To get a list of delivered report in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "campaign_id": 9249,
    "contact_id": 123775,
    "created_at": "2024-04-24T13:57:33.546-04:00",
    "email": "someone@yahoo.com",
    "updated_at": "2024-04-24T13:57:33.546-04:00",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "account_id": 1,
    "campaign_id": 9249,
    "contact_id": 122102,
    "created_at": "2024-04-24T13:57:33.546-04:00",
    "email": "someone@gmail.com",
    "updated_at": "2024-04-24T13:57:33.546-04:00",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/open_report(.:format)
campaigns#open_report

GET https://api.maropost.com/accounts/:account_id/campaigns/:id/open_report(.:format)?unique=true
(To get unique open report)
campaigns#open_report

To get a list of open reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-opens type="array">
  <campaign-open>
    <account-id type="integer">4</account-id>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141625</contact-id>
    <email>tes1@yahoo.com</email>
    <browser>Other</browser>
    <open-count type="integer">1</open-count>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </campaign-open>
  <campaign-open>
    <account-id type="integer">4</account-id>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141782</contact-id>
    <email>tes1@yahoo.com</email>
    <browser>Other</browser>
    <open-count type="integer">1</open-count>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </campaign-open>
</campaign-opens>
To get a list of open reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "campaign_id": 18812,
    "contact_id": 7141625,
    "email": "tes1@yahoo.com",
    "browser": "Other",
    "open_count": 1,
    "recorded_at": "2024-04-24T13:57:33.548-04:00",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "account_id": 4,
    "campaign_id": 18812,
    "contact_id": 7141782,
    "email": "tes1@yahoo.com",
    "browser": "Other",
    "open_count": 1,
    "recorded_at": "2024-04-24T13:57:33.548-04:00",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/click_report(.:format)
campaigns#click_report

GET https://api.maropost.com/accounts/:account_id/campaigns/:id/click_report(.:format)?unique=true
(To get unique click report)
campaigns#click_report

To get a list of click reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-clicks type="array">
  <campaign-click>
    <account-id type="integer">4</account-id>
    <browser>Other</browser>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141625</contact-id>
    <email>hugo.vallee@gmail.com</email>
    <content-url-id nil="true"/>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <id type="integer">3888606</id>
    <ip-address nil="true"/>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <url>http://altdaily.mikegeary1.hop.clickbank.net/?pid=434</url>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </campaign-click>
  <campaign-click>
    <account-id type="integer">4</account-id>
    <browser>Other</browser>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141782</contact-id>
    <email>hugo.vallee@gmail.com</email>
    <content-url-id nil="true"/>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <id type="integer">3888582</id>
    <ip-address nil="true"/>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <url>http://altdaily.mikegeary1.hop.clickbank.net/?pid=434</url>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </campaign-click>
</campaign-clicks>
To get a list of click reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "browser": "Other",
    "campaign_id": 18812,
    "contact_id": 7141625,
    "email": "hugo.vallee@gmail.com",
    "content_url_id": null,
    "created_at": "2024-04-24T13:57:33.549-04:00",
    "id": 3888606,
    "ip_address": null,
    "recorded_at": "2024-04-24T13:57:33.549-04:00",
    "updated_at": "2024-04-24T13:57:33.549-04:00",
    "url": "http://altdaily.mikegeary1.hop.clickbank.net/?pid=434",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "account_id": 4,
    "browser": "Other",
    "campaign_id": 18812,
    "contact_id": 7141782,
    "email": "hugo.vallee@gmail.com",
    "content_url_id": null,
    "created_at": "2024-04-24T13:57:33.549-04:00",
    "id": 3888582,
    "ip_address": null,
    "recorded_at": "2024-04-24T13:57:33.549-04:00",
    "updated_at": "2024-04-24T13:57:33.549-04:00",
    "url": "http://altdaily.mikegeary1.hop.clickbank.net/?pid=434",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/link_report(.:format)
campaigns#link_report

GET https://api.maropost.com/accounts/:account_id/campaigns/:id/link_report(.:format)?unique=true
(To get campaign unique clicks)
campaigns#link_report

To get a list of campaign clicks in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-clicks type="array">
  <campaign-click>
    <count-all type="integer">3</count-all>
    <url>http://altdaily.mikegeary1.hop.clickbank.net/?pid=434</url>
    <total-pages type="integer">1</total-pages>
  </campaign-click>
  <campaign-click>
    <count-all type="integer">1</count-all>
    <url>http://www.cruisecontroldiet.com/lp/5foodsaltd.php?tid=altd110413l1</url>
    <total-pages type="integer">1</total-pages>
  </campaign-click>
</campaign-clicks>
To get a list of campaign clicks in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "count_all": 3,
    "url": "http://altdaily.mikegeary1.hop.clickbank.net/?pid=434",
    "total_pages": 1
  },
  {
    "count_all": 1,
    "url": "http://www.cruisecontroldiet.com/lp/5foodsaltd.php?tid=altd110413l1",
    "total_pages": 1
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/bounce_report(.:format)
campaigns#bounce_report

To get a list of bounce reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-bounces type="array">
  <campaign-bounce>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <email>testemail@gmail.com</email>
    <error>5.0.5</error>
    <diagnostic>Your message was not delivered for SPAM policy reasons.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </campaign-bounce>
  <campaign-bounce>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">100</contact-id>
    <email>user@email.com</email>
    <error>5.1.1</error>
    <diagnostic>Your message was not delivered for SPAM policy reasons.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </campaign-bounce>
</campaign-bounces>
To get a list of bounce reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "email": "testemail@gmail.com",
    "error": "5.0.5",
    "diagnostic": "Your message was not delivered for SPAM policy reasons.",
    "recorded_on": "2024-04-24T13:57:33.552-04:00",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 100,
    "email": "user@email.com",
    "error": "5.1.1",
    "diagnostic": "Your message was not delivered for SPAM policy reasons.",
    "recorded_on": "2024-04-24T13:57:33.552-04:00",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/soft_bounce_report(.:format)
campaigns#soft_bounce_report

To get a list of soft bounce reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-bounces type="array">
  <campaign-bounce>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <email>testemail@gmail.com</email>
    <error>4.2.1</error>
    <diagnostic>Inbox full.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </campaign-bounce>
  <campaign-bounce>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <email>testing@gmail.com</email>
    <error>4.2.3</error>
    <diagnostic>Inbox is full.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </campaign-bounce>
</campaign-bounces>
To get a list of soft bounce reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "email": "testemail@gmail.com",
    "error": "4.2.1",
    "diagnostic": "Inbox full.",
    "recorded_on": "2024-04-24T13:57:33.553-04:00",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "email": "testing@gmail.com",
    "error": "4.2.3",
    "diagnostic": "Inbox is full.",
    "recorded_on": "2024-04-24T13:57:33.553-04:00",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/hard_bounce_report(.:format)
campaigns#hard_bounce_report

To get a list of hard bounce reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign-bounces type="array">
  <campaign-bounce>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <email>testemail@gmail.com</email>
    <error>5.1.5</error>
    <diagnostic>Blocked for abuse.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </campaign-bounce>
  <campaign-bounce>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <email>test@gmail.com</email>
    <error>5.2.2</error>
    <diagnostic>Blocked for abuse.</diagnostic>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </campaign-bounce>
</campaign-bounces>
To get a list of hard bounce reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "email": "testemail@gmail.com",
    "error": "5.1.5",
    "diagnostic": "Blocked for abuse.",
    "recorded_on": "2024-04-24T13:57:33.554-04:00",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "email": "test@gmail.com",
    "error": "5.2.2",
    "diagnostic": "Blocked for abuse.",
    "recorded_on": "2024-04-24T13:57:33.554-04:00",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/unsubscribe_report(.:format)
campaigns#unsubscribe_report

To get a list of unsubscribe reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<unsubscribes type="array">
  <unsubscribe>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">10</contact-id>
    <email>testemail@gmail.com</email>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </unsubscribe>
  <unsubscribe>
    <account-id type="integer">1</account-id>
    <campaign-id type="integer">40</campaign-id>
    <contact-id type="integer">20</contact-id>
    <email>test@gmail.com</email>
    <recorded-on type="dateTime">2024-04-24T13:57:33-04:00</recorded-on>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </unsubscribe>
</unsubscribes>
To get a list of unsubscribe reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 10,
    "email": "testemail@gmail.com",
    "recorded_on": "2024-04-24T13:57:33.556-04:00",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "account_id": 1,
    "campaign_id": 40,
    "contact_id": 20,
    "email": "test@gmail.com",
    "recorded_on": "2024-04-24T13:57:33.556-04:00",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id/complaint_report(.:format)
campaigns#complaint_report

To get a list of complaint reports in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<complaints type="array">
  <complaint>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <esp>hotmail</esp>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <campaign-id type="integer">1</campaign-id>
    <contact-id type="integer">2</contact-id>
    <account-id type="integer">25</account-id>
    <id type="integer">3</id>
    <email>lisabu75@hotmail.com</email>
    <total-pages type="integer">1</total-pages>
    <uid>abcd</uid>
  </complaint>
  <complaint>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <esp>hotmail</esp>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <campaign-id type="integer">4</campaign-id>
    <contact-id type="integer">5</contact-id>
    <account-id type="integer">6</account-id>
    <id type="integer">7</id>
    <email>pryer21@hotmail.com</email>
    <total-pages type="integer">1</total-pages>
    <uid>wxyz</uid>
  </complaint>
</complaints>
To get a list of complaint reports in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "created_at": "2024-04-24T13:57:33.558-04:00",
    "esp": "hotmail",
    "updated_at": "2024-04-24T13:57:33.558-04:00",
    "campaign_id": 1,
    "contact_id": 2,
    "account_id": 25,
    "id": 3,
    "email": "lisabu75@hotmail.com",
    "total_pages": 1,
    "uid": "abcd"
  },
  {
    "created_at": "2024-04-24T13:57:33.558-04:00",
    "esp": "hotmail",
    "updated_at": "2024-04-24T13:57:33.558-04:00",
    "campaign_id": 4,
    "contact_id": 5,
    "account_id": 6,
    "id": 7,
    "email": "pryer21@hotmail.com",
    "total_pages": 1,
    "uid": "wxyz"
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns(.:format)
campaigns#index

To get a list of campaigns in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaigns type="array">
  <campaign>
    <account-id type="integer">4</account-id>
    <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
    <campaign-group-id nil="true"/>
    <campaign-type type="integer">1</campaign-type>
    <contacts-count type="integer">15</contacts-count>
    <content-history-id nil="true"/>
    <content-id type="integer">43060</content-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <decided-by nil="true"/>
    <email-preview-link type="boolean">true</email-preview-link>
    <from-email>test@maropost.com</from-email>
    <from-name>rohit test</from-name>
    <id type="integer">100880</id>
    <language>en</language>
    <list-id nil="true"/>
    <name>test campaign</name>
    <parent-id nil="true"/>
    <recurring nil="true"/>
    <recurring-time nil="true"/>
    <reply-to>test@maropost.com</reply-to>
    <segment-id nil="true"/>
    <send-at nil="true"/>
    <send-optimization type="boolean">false</send-optimization>
    <sent-at nil="true"/>
    <status>draft</status>
    <subject>spam</subject>
    <suppress-workflow type="boolean">false</suppress-workflow>
    <test-campaign type="boolean">false</test-campaign>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <version-number nil="true"/>
    <winner-campaign-id nil="true"/>
  </campaign>
  <campaign>
    <account-id type="integer">4</account-id>
    <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
    <campaign-group-id nil="true"/>
    <campaign-type type="integer">1</campaign-type>
    <contacts-count type="integer">2</contacts-count>
    <content-history-id nil="true"/>
    <content-id type="integer">42325</content-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <decided-by nil="true"/>
    <email-preview-link type="boolean">true</email-preview-link>
    <from-email>test@maropost.com</from-email>
    <from-name>hi</from-name>
    <id type="integer">100913</id>
    <language>es</language>
    <list-id nil="true"/>
    <name>RV2</name>
    <parent-id nil="true"/>
    <recurring nil="true"/>
    <recurring-time nil="true"/>
    <reply-to>test@maropost.com</reply-to>
    <segment-id nil="true"/>
    <send-at nil="true"/>
    <send-optimization type="boolean">false</send-optimization>
    <sent-at nil="true"/>
    <status>workflow</status>
    <subject>hi</subject>
    <suppress-workflow type="boolean">false</suppress-workflow>
    <test-campaign type="boolean">false</test-campaign>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <version-number nil="true"/>
    <winner-campaign-id nil="true"/>
  </campaign>
</campaigns>
To get a list of campaigns in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
    "campaign_group_id": null,
    "campaign_type": 1,
    "contacts_count": 15,
    "content_history_id": null,
    "content_id": 43060,
    "created_at": "2024-04-24T13:57:33.561-04:00",
    "decided_by": null,
    "email_preview_link": true,
    "from_email": "test@maropost.com",
    "from_name": "rohit test",
    "id": 100880,
    "language": "en",
    "list_id": null,
    "name": "test campaign",
    "parent_id": null,
    "recurring": null,
    "recurring_time": null,
    "reply_to": "test@maropost.com",
    "segment_id": null,
    "send_at": null,
    "send_optimization": false,
    "sent_at": null,
    "status": "draft",
    "subject": "spam",
    "suppress_workflow": false,
    "test_campaign": false,
    "updated_at": "2024-04-24T13:57:33.561-04:00",
    "version_number": null,
    "winner_campaign_id": null
  },
  {
    "account_id": 4,
    "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
    "campaign_group_id": null,
    "campaign_type": 1,
    "contacts_count": 2,
    "content_history_id": null,
    "content_id": 42325,
    "created_at": "2024-04-24T13:57:33.561-04:00",
    "decided_by": null,
    "email_preview_link": true,
    "from_email": "test@maropost.com",
    "from_name": "hi",
    "id": 100913,
    "language": "es",
    "list_id": null,
    "name": "RV2",
    "parent_id": null,
    "recurring": null,
    "recurring_time": null,
    "reply_to": "test@maropost.com",
    "segment_id": null,
    "send_at": null,
    "send_optimization": false,
    "sent_at": null,
    "status": "workflow",
    "subject": "hi",
    "suppress_workflow": false,
    "test_campaign": false,
    "updated_at": "2024-04-24T13:57:33.561-04:00",
    "version_number": null,
    "winner_campaign_id": null
  }
]
GET https://api.maropost.com/accounts/:account_id/campaigns/:id(.:format)
campaigns#show

To get a campaign in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaign>
  <account-id type="integer">4</account-id>
  <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
  <campaign-group-id nil="true"/>
  <campaign-type type="integer">1</campaign-type>
  <contacts-count type="integer">15</contacts-count>
  <content-history-id type="integer">74293</content-history-id>
  <content-id type="integer">43060</content-id>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <decided-by nil="true"/>
  <email-preview-link type="boolean">true</email-preview-link>
  <from-email>Demo@maropost.com</from-email>
  <from-name>Demo</from-name>
  <id type="integer">100905</id>
  <language>en</language>
  <list-id nil="true"/>
  <name>test campaign</name>
  <parent-id type="integer">100880</parent-id>
  <recurring nil="true"/>
  <recurring-time nil="true"/>
  <reply-to>Demo@maropost.com</reply-to>
  <segment-id nil="true"/>
  <send-at type="dateTime">2024-04-24T13:57:33-04:00</send-at>
  <send-optimization type="boolean">false</send-optimization>
  <sent-at type="dateTime">2024-04-24T13:57:33-04:00</sent-at>
  <status>sent</status>
  <subject>forward, complain and unsub</subject>
  <suppress-workflow type="boolean">false</suppress-workflow>
  <test-campaign type="boolean">true</test-campaign>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <version-number type="integer">2</version-number>
  <winner-campaign-id nil="true"/>
  <sent type="integer">17</sent>
  <delivered type="integer">15</delivered>
  <opened type="integer">5</opened>
  <unique-opens type="integer">5</unique-opens>
  <clicked type="integer">0</clicked>
  <unique-clicks type="integer">0</unique-clicks>
  <bounced type="integer">2</bounced>
  <soft-bounced type="integer">0</soft-bounced>
  <hard-bounced type="integer">2</hard-bounced>
  <unsubscribed type="integer">1</unsubscribed>
  <complaint type="integer">2</complaint>
  <forward type="integer">2</forward>
  <lists type="array">
    <list>
      <id type="integer">8449</id>
      <name>shavi-test-00</name>
      <subscribers type="integer">1</subscribers>
    </list>
    <list>
      <id type="integer">8441</id>
      <name>101 Test List</name>
      <subscribers type="integer">18</subscribers>
    </list>
  </lists>
  <segments type="array"/>
</campaign>
To get a campaign in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 4,
  "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
  "campaign_group_id": null,
  "campaign_type": 1,
  "contacts_count": 15,
  "content_history_id": 74293,
  "content_id": 43060,
  "created_at": "2024-04-24T13:57:33.564-04:00",
  "decided_by": null,
  "email_preview_link": true,
  "from_email": "Demo@maropost.com",
  "from_name": "Demo",
  "id": 100905,
  "language": "en",
  "list_id": null,
  "name": "test campaign",
  "parent_id": 100880,
  "recurring": null,
  "recurring_time": null,
  "reply_to": "Demo@maropost.com",
  "segment_id": null,
  "send_at": "2024-04-24T13:57:33.564-04:00",
  "send_optimization": false,
  "sent_at": "2024-04-24T13:57:33.564-04:00",
  "status": "sent",
  "subject": "forward, complain and unsub",
  "suppress_workflow": false,
  "test_campaign": true,
  "updated_at": "2024-04-24T13:57:33.564-04:00",
  "version_number": 2,
  "winner_campaign_id": null,
  "sent": 17,
  "delivered": 15,
  "opened": 5,
  "unique_opens": 5,
  "clicked": 0,
  "unique_clicks": 0,
  "bounced": 2,
  "soft_bounced": 0,
  "hard_bounced": 2,
  "unsubscribed": 1,
  "complaint": 2,
  "forward": 2,
  "lists": [
    {
      "id": 8449,
      "name": "shavi-test-00",
      "subscribers": 1
    },
    {
      "id": 8441,
      "name": "101 Test List",
      "subscribers": 18
    }
  ],
  "segments": [

  ]
}
Post https://api.maropost.com/accounts/:account_id/campaigns/build(.:format)
campaigns#build

To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <suppressed-list-ids type="array">
    <suppressed-list-id>5</suppressed-list-id>
    <suppressed-list-id>70</suppressed-list-id>
  </suppressed-list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <relational-table-ids type="array">
    <relational-table-id>201</relational-table-id>
    <relational-table-id>153</relational-table-id>
  </relational-table-ids>
  <suppressed-segment-ids type="array">
    <suppressed-segment-id>5</suppressed-segment-id>
    <suppressed-segment-id>70</suppressed-segment-id>
  </suppressed-segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>draft</status>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "suppressed_list_ids": [
      "5",
      "70"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "relational_table_ids": [
      "201",
      "153"
    ],
    "suppressed_segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "draft"
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <relational-table-ids type="array">
    <relational-table-id>201</relational-table-id>
    <relational-table-id>153</relational-table-id>
  </relational-table-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>test</status>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "relational_table_ids": [
      "201",
      "153"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "test"
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <relational-table-ids type="array">
    <relational-table-id>201</relational-table-id>
    <relational-table-id>153</relational-table-id>
  </relational-table-ids>
  <suppressed-list-ids type="array">
    <suppressed-list-id>5</suppressed-list-id>
    <suppressed-list-id>70</suppressed-list-id>
  </suppressed-list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <suppressed-segment-ids type="array">
    <suppressed-segment-id>5</suppressed-segment-id>
    <suppressed-segment-id>70</suppressed-segment-id>
  </suppressed-segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>schedule</status>
  <send-at>2015-7-04 6:30:00</send-at>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "relational_table_ids": [
      "201",
      "153"
    ],
    "suppressed_list_ids": [
      "5",
      "70"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "suppressed_segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "schedule",
    "send_at": "2015-7-04 6:30:00"
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <suppressed-list-ids type="array">
    <suppressed-list-id>5</suppressed-list-id>
    <suppressed-list-id>70</suppressed-list-id>
  </suppressed-list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <suppressed-segment-ids type="array">
    <suppressed-segment-id>5</suppressed-segment-id>
    <suppressed-segment-id>70</suppressed-segment-id>
  </suppressed-segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>schedule</status>
  <send-at>2015-7-04 6:30:00</send-at>
  <send-type>best_time</send-type>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "suppressed_list_ids": [
      "5",
      "70"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "suppressed_segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "schedule",
    "send_at": "2015-7-04 6:30:00",
    "send_type": "best_time"
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <suppressed-list-ids type="array">
    <suppressed-list-id>5</suppressed-list-id>
    <suppressed-list-id>70</suppressed-list-id>
  </suppressed-list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <suppressed-segment-ids type="array">
    <suppressed-segment-id>5</suppressed-segment-id>
    <suppressed-segment-id>70</suppressed-segment-id>
  </suppressed-segment-ids>
  <status>schedule</status>
  <send-at>2015-7-04 6:30:00</send-at>
  <send-type>one_time</send-type>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "suppressed_list_ids": [
      "5",
      "70"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "suppressed_segment_ids": [
      "5",
      "70"
    ],
    "status": "schedule",
    "send_at": "2015-7-04 6:30:00",
    "send_type": "one_time",
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>recurring</status>
  <recurring>
    <schedule>daily</schedule>
  </recurring>
  <recurring-time>
    <hour>06</hour>
    <minute>30</minute>
  </recurring-time>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "recurring",
    "recurring": {
      "schedule": "daily"
    },
    "recurring_time": {
      "hour": "06",
      "minute": "30"
    }
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>recurring</status>
  <recurring>
    <schedule>weekly</schedule>
    <weekday>0</weekday>
  </recurring>
  <recurring-time>
    <hour>06</hour>
    <minute>30</minute>
  </recurring-time>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "recurring",
    "recurring": {
      "schedule": "weekly",
      "weekday": "0"
    },
    "recurring_time": {
      "hour": "06",
      "minute": "30"
    }
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>recurring</status>
  <recurring>
    <schedule>monthly</schedule>
    <day>6</day>
  </recurring>
  <recurring-time>
    <hour>06</hour>
    <minute>30</minute>
  </recurring-time>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "recurring",
    "recurring": {
      "schedule": "monthly",
      "day": "6"
    },
    "recurring_time": {
      "hour": "06",
      "minute": "30"
    }
  }
}
To schedule a campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <list-ids type="array">
    <list-id>15</list-id>
    <list-id>24</list-id>
  </list-ids>
  <segment-ids type="array">
    <segment-id>5</segment-id>
    <segment-id>70</segment-id>
  </segment-ids>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
  <status>recurring</status>
  <recurring>
    <schedule>yearly</schedule>
    <day>6</day>
    <month>4</month>
  </recurring>
  <recurring-time>
    <hour>06</hour>
    <minute>30</minute>
  </recurring-time>
</campaign>
To schedule a campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "list_ids": [
      "15",
      "24"
    ],
    "segment_ids": [
      "5",
      "70"
    ],
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ],
    "status": "recurring",
    "recurring": {
      "schedule": "yearly",
      "day": "6",
      "month": "4"
    },
    "recurring_time": {
      "hour": "06",
      "minute": "30"
    }
  }
}

AB Campaigns API

Post https://api.maropost.com/accounts/:account_id/campaigns/ab_test(.:format)
campaigns#build

To save an ab_test campaign as draft in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>kap </name>
  <from-email>kapilchand@maropost.com</from-email>
  <reply-to>kapilchand@maropost.com</reply-to>
  <brand-id>2</brand-id>
  <suppressed-list-ids type="array">
    <suppressed-list-id>66</suppressed-list-id>
    <suppressed-list-id>63</suppressed-list-id>
  </suppressed-list-ids>
  <suppressed-segment-ids type="array">
    <suppressed-segment-id>34</suppressed-segment-id>
    <suppressed-segment-id>81</suppressed-segment-id>
  </suppressed-segment-ids>
  <suppressed-journey-ids type="array">
    <suppressed-journey-id>21</suppressed-journey-id>
    <suppressed-journey-id>24</suppressed-journey-id>
  </suppressed-journey-ids>
  <address>The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408</address>
  <language>en</language>
  <email-preview-link>0</email-preview-link>
  <decided-by>TopChoice</decided-by>
  <campaign-groups-attributes type="array">
    <campaign-groups-attribute>
      <name>Group A</name>
      <content-id>92</content-id>
      <subject>a</subject>
      <preheader>232</preheader>
      <from-name>k</from-name>
      <percentage>2</percentage>
      <send-at>2018-02-07 6:30:00</send-at>
    </campaign-groups-attribute>
    <campaign-groups-attribute>
      <name>Group B</name>
      <content-id>92</content-id>
      <subject>b</subject>
      <preheader>232</preheader>
      <from-name>gg</from-name>
      <percentage>2</percentage>
      <send-at>2018-02-07 6:30:00</send-at>
    </campaign-groups-attribute>
  </campaign-groups-attributes>
  <send-at>2018-02-08 6:30:00</send-at>
  <lists type="array">
    <list>15</list>
    <list>24</list>
  </lists>
  <ctags type="array">
    <ctag>5</ctag>
    <ctag>70</ctag>
  </ctags>
  <segments type="array">
    <segment>5</segment>
    <segment>7</segment>
  </segments>
  <commit>Save as Draft</commit>
</campaign>
To save an ab_test campaign as draft in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "kap ",
    "from_email": "kapilchand@maropost.com",
    "reply_to": "kapilchand@maropost.com",
    "brand_id": "2",
    "suppressed_list_ids": [
      "66",
      "63"
    ],
    "suppressed_segment_ids": [
      "34",
      "81"
    ],
    "suppressed_journey_ids": [
      "21",
      "24"
    ],
    "address": "The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408",
    "language": "en",
    "email_preview_link": "0",
    "decided_by": "TopChoice",
    "campaign_groups_attributes": [
      {
        "name": "Group A",
        "content_id": "92",
        "subject": "a",
        "preheader": "232",
        "from_name": "k",
        "percentage": "2",
        "send_at": "2018-02-07 6:30:00"
      },
      {
        "name": "Group B",
        "content_id": "92",
        "subject": "b",
        "preheader": "232",
        "from_name": "gg",
        "percentage": "2",
        "send_at": "2018-02-07 6:30:00"
      }
    ],
    "send_at": "2018-02-08 6:30:00",
    "lists": [
      "15",
      "24"
    ],
    "ctags": [
      "5",
      "70"
    ],
    "segments": [
      "5",
      "7"
    ],
    "commit": "Save as Draft"
  }
}

* Allowed values for decided_by: ('TopChoice' for Top Choices) or ('Opens' for Highest Open Rate) or ('Clicks' for Highest Click Rate) or ('Manual' for Manual Selection) or ('click_to_open' for Highest Click-to-Open Rate) or ('conversions' for Highest Conversion Rate)
* Allowed values for commit: 'Save as Draft' or 'Send Test' or 'Schedule'
* Allowed value for language can be either of these: ['en' for English, 'es' for Spanish, 'de' for German, 'it' for Italian, 'fr' for French, 'pt' for Portuguese, 'pl' for Polish, 'da' for Danish, 'zh' for Chinese, 'nl' for Dutch, 'sv' for Swedish, 'no' for Norwegian]
* send_at should be in "yyyy-mm-dd %H:%M:%S" where %H - Hour of the day, 24-hour clock (00..23), %M - Minute of the hour (00..59), %S - Second of the minute (00..60)
To schedule an ab_test campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>kap</name>
  <from-email>abc@maropost.com</from-email>
  <reply-to>abc@maropost.com</reply-to>
  <brand-id>2</brand-id>
  <suppressed-list-ids type="array">
    <suppressed-list-id>66</suppressed-list-id>
    <suppressed-list-id>63</suppressed-list-id>
  </suppressed-list-ids>
  <suppressed-segment-ids type="array">
    <suppressed-segment-id>34</suppressed-segment-id>
    <suppressed-segment-id>81</suppressed-segment-id>
  </suppressed-segment-ids>
  <suppressed-journey-ids type="array">
    <suppressed-journey-id>21</suppressed-journey-id>
    <suppressed-journey-id>24</suppressed-journey-id>
  </suppressed-journey-ids>
  <address>The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408</address>
  <language>en</language>
  <email-preview-link>0</email-preview-link>
  <decided-by>TopChoice</decided-by>
  <campaign-groups-attributes type="array">
    <campaign-groups-attribute>
      <name>Group A</name>
      <content-id>92</content-id>
      <subject>a</subject>
      <preheader>232</preheader>
      <from-name>k</from-name>
      <percentage>2</percentage>
      <send-at>2018-02-07 6:30:00</send-at>
    </campaign-groups-attribute>
    <campaign-groups-attribute>
      <name>Group B</name>
      <content-id>92</content-id>
      <subject>b</subject>
      <preheader>232</preheader>
      <from-name>gg</from-name>
      <percentage>2</percentage>
      <send-at>2018-02-07 6:30:00</send-at>
    </campaign-groups-attribute>
  </campaign-groups-attributes>
  <send-at>2018-02-08 6:30:00</send-at>
  <test-lists type="array">
    <test-list>15</test-list>
    <test-list>24</test-list>
  </test-lists>
  <test-emails type="array">
    <test-email>test@maropost.com,test2@maropost.com</test-email>
  </test-emails>
  <ctags type="array">
    <ctag>5</ctag>
    <ctag>70</ctag>
  </ctags>
  <commit>Send Test</commit>
</campaign>
To schedule an ab_test campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "kap",
    "from_email": "abc@maropost.com",
    "reply_to": "abc@maropost.com",
    "brand_id": "2",
    "suppressed_list_ids": [
      "66",
      "63"
    ],
    "suppressed_segment_ids": [
      "34",
      "81"
    ],
    "suppressed_journey_ids": [
      "21",
      "24"
    ],
    "address": "The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408",
    "language": "en",
    "email_preview_link": "0",
    "decided_by": "TopChoice",
    "campaign_groups_attributes": [
      {
        "name": "Group A",
        "content_id": "92",
        "subject": "a",
        "preheader": "232",
        "from_name": "k",
        "percentage": "2",
        "send_at": "2018-02-07 6:30:00"
      },
      {
        "name": "Group B",
        "content_id": "92",
        "subject": "b",
        "preheader": "232",
        "from_name": "gg",
        "percentage": "2",
        "send_at": "2018-02-07 6:30:00"
      }
    ],
    "send_at": "2018-02-08 6:30:00",
    "test_lists": [
      "15",
      "24"
    ],
    "test_emails": [
      "test@maropost.com,test2@maropost.com"
    ],
    "ctags": [
      "5",
      "70"
    ],
    "commit": "Send Test"
  }
}

* Allowed values for decided_by: ('TopChoice' for Top Choices) or ('Opens' for Highest Open Rate) or ('Clicks' for Highest Click Rate) or ('Manual' for Manual Selection) or ('click_to_open' for Highest Click-to-Open Rate) or ('conversions' for Highest Conversion Rate)
* Allowed values for commit: 'Save as Draft' or 'Send Test' or 'Schedule'
* Allowed value for language can be either of these: ['en' for English, 'es' for Spanish, 'de' for German, 'it' for Italian, 'fr' for French, 'pt' for Portuguese, 'pl' for Polish, 'da' for Danish, 'zh' for Chinese, 'nl' for Dutch, 'sv' for Swedish, 'no' for Norwegian]
* send_at should be in "yyyy-mm-dd %H:%M:%S" where %H - Hour of the day, 24-hour clock (00..23), %M - Minute of the hour (00..59), %S - Second of the minute (00..60)
To schedule an ab_test campaign in XML format, you would make a HTTP Post request using the xml extension
<campaign>
  <name>kap </name>
  <from-email>kapilchand@maropost.com</from-email>
  <reply-to>kapilchand@maropost.com</reply-to>
  <brand-id>2</brand-id>
  <suppressed-list-ids type="array">
    <suppressed-list-id>66</suppressed-list-id>
    <suppressed-list-id>63</suppressed-list-id>
  </suppressed-list-ids>
  <suppressed-segment-ids type="array">
    <suppressed-segment-id>34</suppressed-segment-id>
    <suppressed-segment-id>81</suppressed-segment-id>
  </suppressed-segment-ids>
  <suppressed-journey-ids type="array">
    <suppressed-journey-id>21</suppressed-journey-id>
    <suppressed-journey-id>24</suppressed-journey-id>
  </suppressed-journey-ids>
  <address>The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408</address>
  <language>en</language>
  <email-preview-link>0</email-preview-link>
  <decided-by>TopChoice</decided-by>
  <campaign-groups-attributes type="array">
    <campaign-groups-attribute>
      <name>Group A</name>
      <content-id>92</content-id>
      <subject>a</subject>
      <preheader>232</preheader>
      <from-name>k</from-name>
      <percentage>2</percentage>
      <send-at>2018-02-07 6:30:00</send-at>
    </campaign-groups-attribute>
    <campaign-groups-attribute>
      <name>Group B</name>
      <content-id>92</content-id>
      <subject>b</subject>
      <preheader>232</preheader>
      <from-name>gg</from-name>
      <percentage>2</percentage>
      <send-at>2018-02-07 6:30:00</send-at>
    </campaign-groups-attribute>
  </campaign-groups-attributes>
  <send-at>2018-02-08 6:30:00</send-at>
  <lists type="array">
    <list>15</list>
    <list>24</list>
  </lists>
  <ctags type="array">
    <ctag>5</ctag>
    <ctag>70</ctag>
  </ctags>
  <segments type="array">
    <segment>5</segment>
    <segment>7</segment>
  </segments>
  <commit>Schedule</commit>
</campaign>
To schedule an ab_test campaign in Json format, you would make a HTTP Post request using the json extension
{
  "campaign": {
    "name": "kap ",
    "from_email": "kapilchand@maropost.com",
    "reply_to": "kapilchand@maropost.com",
    "brand_id": "2",
    "suppressed_list_ids": [
      "66",
      "63"
    ],
    "suppressed_segment_ids": [
      "34",
      "81"
    ],
    "suppressed_journey_ids": [
      "21",
      "24"
    ],
    "address": "The Alternative Daily | 860 US Highway 1 | Suite 210 | North Palm Beach | FL | 33408",
    "language": "en",
    "email_preview_link": "0",
    "decided_by": "TopChoice",
    "campaign_groups_attributes": [
      {
        "name": "Group A",
        "content_id": "92",
        "subject": "a",
        "preheader": "232",
        "from_name": "k",
        "percentage": "2",
        "send_at": "2018-02-07 6:30:00"
      },
      {
        "name": "Group B",
        "content_id": "92",
        "subject": "b",
        "preheader": "232",
        "from_name": "gg",
        "percentage": "2",
        "send_at": "2018-02-07 6:30:00"
      }
    ],
    "send_at": "2018-02-08 6:30:00",
    "lists": [
      "15",
      "24"
    ],
    "ctags": [
      "5",
      "70"
    ],
    "segments": [
      "5",
      "7"
    ],
    "commit": "Schedule"
  }
}

* Allowed values for decided_by: ('TopChoice' for Top Choices) or ('Opens' for Highest Open Rate) or ('Clicks' for Highest Click Rate) or ('Manual' for Manual Selection) or ('click_to_open' for Highest Click-to-Open Rate) or ('conversions' for Highest Conversion Rate)
* Allowed values for commit: 'Save as Draft' or 'Send Test' or 'Schedule'
* Allowed value for language can be either of these: ['en' for English, 'es' for Spanish, 'de' for German, 'it' for Italian, 'fr' for French, 'pt' for Portuguese, 'pl' for Polish, 'da' for Danish, 'zh' for Chinese, 'nl' for Dutch, 'sv' for Swedish, 'no' for Norwegian]
* send_at should be in "yyyy-mm-dd %H:%M:%S" where %H - Hour of the day, 24-hour clock (00..23), %M - Minute of the hour (00..59), %S - Second of the minute (00..60)
DELETE https://api.maropost.com/accounts/:account_id/campaigns/:id(.:format) campaigns#destroy

Contacts API

GET https://api.maropost.com/accounts/:account_id/contacts/email(.:format)?contact[email]=api@email.com
contacts#search

To search a contact with email and get all the details of the contact in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contact>
  <id type="integer">42817337</id>
  <account-id type="integer">4</account-id>
  <email>api@email.com</email>
  <first-name>api</first-name>
  <last-name>email</last-name>
  <phone>1234567890</phone>
  <fax>1234567890</fax>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <custom-field-1 type="boolean">false</custom-field-1>
  <custom-field-2 type="dateTime">2024-04-24T13:57:33-04:00</custom-field-2>
  <custom-field-3>abc123</custom-field-3>
  <uid>abcd</uid>
  <list-subscriptions type="array">
    <list-subscription>
      <list-id type="integer">17</list-id>
      <name>test list 1</name>
      <status>Subscribed</status>
    </list-subscription>
    <list-subscription>
      <list-id type="integer">18</list-id>
      <name>test list 2</name>
      <status>Subscribed</status>
    </list-subscription>
  </list-subscriptions>
  <journeys type="array">
    <journey>
      <id type="integer">65</id>
      <name>Test Workflow</name>
      <journey-contact-status>Finished</journey-contact-status>
      <journey-status>Enabled</journey-status>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </journey>
    <journey>
      <id type="integer">65</id>
      <name>Test Workflow</name>
      <journey-contact-status>Active</journey-contact-status>
      <journey-status>Enabled</journey-status>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </journey>
  </journeys>
</contact>
To search a contact with email and get all the details of the contact in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "id": 42817337,
  "account_id": 4,
  "email": "api@email.com",
  "first_name": "api",
  "last_name": "email",
  "phone": "1234567890",
  "fax": "1234567890",
  "created_at": "2024-04-24T13:57:33.583-04:00",
  "updated_at": "2024-04-24T13:57:33.583-04:00",
  "custom_field_1": false,
  "custom_field_2": "2024-04-24T13:57:33.583-04:00",
  "custom_field_3": "abc123",
  "uid": "abcd",
  "list_subscriptions": [
    {
      "list_id": 17,
      "name": "test list 1",
      "status": "Subscribed"
    },
    {
      "list_id": 18,
      "name": "test list 2",
      "status": "Subscribed"
    }
  ],
  "journeys": [
    {
      "id": 65,
      "name": "Test Workflow",
      "journey_contact_status": "Finished",
      "journey_status": "Enabled",
      "created_at": "2024-04-24T13:57:33.583-04:00",
      "updated_at": "2024-04-24T13:57:33.583-04:00"
    },
    {
      "id": 65,
      "name": "Test Workflow",
      "journey_contact_status": "Active",
      "journey_status": "Enabled",
      "created_at": "2024-04-24T13:57:33.583-04:00",
      "updated_at": "2024-04-24T13:57:33.583-04:00"
    }
  ]
}
GET https://api.maropost.com/accounts/:account_id/contacts/email(.:format)?uid=abcdwxyz
contacts#search

To search a contact with uid and get all the details of the contact in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contact>
  <id type="integer">42817337</id>
  <account-id type="integer">4</account-id>
  <email>api@email.com</email>
  <first-name>api</first-name>
  <last-name>email</last-name>
  <phone>1234567890</phone>
  <fax>1234567890</fax>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <custom-field-1 type="boolean">false</custom-field-1>
  <custom-field-2 type="dateTime">2024-04-24T13:57:33-04:00</custom-field-2>
  <custom-field-3>abc123</custom-field-3>
  <uid>abcd</uid>
  <list-subscriptions type="array">
    <list-subscription>
      <list-id type="integer">17</list-id>
      <name>test list 1</name>
      <status>Subscribed</status>
    </list-subscription>
    <list-subscription>
      <list-id type="integer">18</list-id>
      <name>test list 2</name>
      <status>Subscribed</status>
    </list-subscription>
  </list-subscriptions>
  <journeys type="array">
    <journey>
      <id type="integer">65</id>
      <name>Test Workflow</name>
      <journey-contact-status>Finished</journey-contact-status>
      <journey-status>Enabled</journey-status>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </journey>
    <journey>
      <id type="integer">65</id>
      <name>Test Workflow</name>
      <journey-contact-status>Active</journey-contact-status>
      <journey-status>Enabled</journey-status>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </journey>
  </journeys>
</contact>
To search a contact with uid and get all the details of the contact in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "id": 42817337,
  "account_id": 4,
  "email": "api@email.com",
  "first_name": "api",
  "last_name": "email",
  "phone": "1234567890",
  "fax": "1234567890",
  "created_at": "2024-04-24T13:57:33.584-04:00",
  "updated_at": "2024-04-24T13:57:33.584-04:00",
  "custom_field_1": false,
  "custom_field_2": "2024-04-24T13:57:33.584-04:00",
  "custom_field_3": "abc123",
  "uid": "abcd",
  "list_subscriptions": [
    {
      "list_id": 17,
      "name": "test list 1",
      "status": "Subscribed"
    },
    {
      "list_id": 18,
      "name": "test list 2",
      "status": "Subscribed"
    }
  ],
  "journeys": [
    {
      "id": 65,
      "name": "Test Workflow",
      "journey_contact_status": "Finished",
      "journey_status": "Enabled",
      "created_at": "2024-04-24T13:57:33.584-04:00",
      "updated_at": "2024-04-24T13:57:33.584-04:00"
    },
    {
      "id": 65,
      "name": "Test Workflow",
      "journey_contact_status": "Active",
      "journey_status": "Enabled",
      "created_at": "2024-04-24T13:57:33.584-04:00",
      "updated_at": "2024-04-24T13:57:33.584-04:00"
    }
  ]
}
GET https://api.maropost.com/accounts/:account_id/lists/:list_id/contacts(.:format)
contacts#index

To get a list of contacts in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contact type="array">
  <contact>
    <id type="integer">42817337</id>
    <account-id type="integer">4</account-id>
    <email>api@email.com</email>
    <first-name>api</first-name>
    <last-name>email</last-name>
    <phone>1234567890</phone>
    <fax>1234567890</fax>
    <uid>abcd</uid>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <custom-field-1 type="boolean">false</custom-field-1>
    <custom-field-2 type="dateTime">2024-04-24T13:57:33-04:00</custom-field-2>
    <custom-field-3>abc123</custom-field-3>
    <subscription>
      <status>Subscribed</status>
      <subscribed-at type="dateTime">2024-04-24T13:57:33-04:00</subscribed-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </subscription>
  </contact>
  <contact>
    <id type="integer">53308117</id>
    <account-id type="integer">4</account-id>
    <email>api_2@email.com</email>
    <first-name>api</first-name>
    <last-name>email</last-name>
    <phone>1234567890</phone>
    <fax>1234567890</fax>
    <uid>wxyz</uid>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <custom-field-1 type="boolean">true</custom-field-1>
    <custom-field-2 type="dateTime">2024-04-24T13:57:33-04:00</custom-field-2>
    <custom-field-3>abc123</custom-field-3>
    <subscription>
      <status>Subscribed</status>
      <subscribed-at type="dateTime">2024-04-24T13:57:33-04:00</subscribed-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </subscription>
  </contact>
</contact>
To get a list of contacts in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "id": 42817337,
    "account_id": 4,
    "email": "api@email.com",
    "first_name": "api",
    "last_name": "email",
    "phone": "1234567890",
    "fax": "1234567890",
    "uid": "abcd",
    "created_at": "2024-04-24T13:57:33.586-04:00",
    "updated_at": "2024-04-24T13:57:33.586-04:00",
    "custom_field_1": false,
    "custom_field_2": "2024-04-24T13:57:33.586-04:00",
    "custom_field_3": "abc123",
    "subscription": {
      "status": "Subscribed",
      "subscribed_at": "2024-04-24T13:57:33.586-04:00",
      "updated_at": "2024-04-24T13:57:33.586-04:00"
    }
  },
  {
    "id": 53308117,
    "account_id": 4,
    "email": "api_2@email.com",
    "first_name": "api",
    "last_name": "email",
    "phone": "1234567890",
    "fax": "1234567890",
    "uid": "wxyz",
    "created_at": "2024-04-24T13:57:33.586-04:00",
    "updated_at": "2024-04-24T13:57:33.586-04:00",
    "custom_field_1": true,
    "custom_field_2": "2024-04-24T13:57:33.586-04:00",
    "custom_field_3": "abc123",
    "subscription": {
      "status": "Subscribed",
      "subscribed_at": "2024-04-24T13:57:33.586-04:00",
      "updated_at": "2024-04-24T13:57:33.586-04:00"
    }
  }
]
* Sort contacts:


* When 'sort_field=contacts' parameter is passed
1) contacts gets sorted by contacts fields passed in param 'method'
2) Along with 'sort_field', API needs 2 more params 'sort_by' and 'method'
3) 'sort_by' has value as 'desc' or 'asc' i.e. 'sort_by=desc'
4) 'method' has value of field name by which we want to sort contacts i.e. 'method=updated_at'

* When 'sort_field=contacts' parameter is not passed:
1) contacts gets sorted by subscription
2) 'sort_by' has value as 'desc' or 'asc' i.e. 'sort_by=desc'
3) 'method' has value of field name by which we want to sort contacts i.e. 'method=updated_at'
POST https://api.maropost.com/accounts/:account_id/contacts(.:format)

(Create a contact without using List id)
contacts#create

To create a new contact using XML as the input data format, you would make a HTTP POST request:
<contact>
  <first-name>api</first-name>
  <email>api_2@email.com</email>
  <phone>1234567890</phone>
  <fax>1234567890</fax>
  <last-name>email</last-name>
  <uid>abcd</uid>
  <custom-field>
    <custom-field-1 type="boolean">true</custom-field-1>
    <custom-field-2 nil="true"/>
    <custom-field-3>abc123</custom-field-3>
  </custom-field>
  <add-tags type="array">
    <add-tag>tag_name</add-tag>
    <add-tag>tag_name</add-tag>
  </add-tags>
  <remove-tags type="array">
    <remove-tag>tag_name</remove-tag>
    <remove-tag>tag_name</remove-tag>
  </remove-tags>
  <remove-from-dnm type="boolean">false</remove-from-dnm>
  <options>
    <subscribe-list-ids>21,23,44</subscribe-list-ids>
    <unsubscribe-list-ids>23,44,55</unsubscribe-list-ids>
    <unsubscribe-workflow-ids>3443,43434</unsubscribe-workflow-ids>
    <unsubscribe-campaign>9261</unsubscribe-campaign>
  </options>
</contact>
(REQUIRED FIELD) => email

To create a new contact using JSON as the input data format, you would make a HTTP POST request:
{
  "contact": {
    "first_name": "api",
    "email": "api_2@email.com",
    "phone": "1234567890",
    "fax": "1234567890",
    "last_name": "email",
    "uid": "abcd",
    "custom_field": {
      "custom_field_1": true,
      "custom_field_2": null,
      "custom_field_3": "abc123"
    },
    "add_tags": [
      "tag_name",
      "tag_name"
    ],
    "remove_tags": [
      "tag_name",
      "tag_name"
    ],
    "remove_from_dnm": false,
    "options": {
      "subscribe_list_ids": "21,23,44",
      "unsubscribe_list_ids": "23,44,55",
      "unsubscribe_workflow_ids": "3443,43434",
      "unsubscribe_campaign": "9261"
    }
  }
}
(REQUIRED FIELD) => email

POST https://api.maropost.com/accounts/:account_id/lists/:list_id/contacts(.:format)
contacts#create

To create a new contact using XML as the input data format, you would make a HTTP POST request:
<contact>
  <first-name>api</first-name>
  <email>api_2@email.com</email>
  <phone>1234567890</phone>
  <fax>1234567890</fax>
  <last-name>email</last-name>
  <uid>abcd</uid>
  <custom-field>
    <custom-field-1 type="boolean">true</custom-field-1>
    <custom-field-2 nil="true"/>
    <custom-field-3>abc123</custom-field-3>
  </custom-field>
  <add-tags type="array">
    <add-tag>tag_name</add-tag>
    <add-tag>tag_name</add-tag>
  </add-tags>
  <remove-tags type="array">
    <remove-tag>tag_name</remove-tag>
    <remove-tag>tag_name</remove-tag>
  </remove-tags>
  <subscribe type="boolean">true</subscribe>
  <remove-from-dnm type="boolean">true</remove-from-dnm>
</contact>
To create a new contact using JSON as the input data format, you would make a HTTP POST request:
{
  "contact": {
    "first_name": "api",
    "email": "api_2@email.com",
    "phone": "1234567890",
    "fax": "1234567890",
    "last_name": "email",
    "uid": "abcd",
    "custom_field": {
      "custom_field_1": true,
      "custom_field_2": null,
      "custom_field_3": "abc123"
    },
    "add_tags": [
      "tag_name",
      "tag_name"
    ],
    "remove_tags": [
      "tag_name",
      "tag_name"
    ],
    "subscribe": true,
    "remove_from_dnm": true
  }
}
(REQUIRED FIELD) => email

(remove_from_dnm => Set this true to subcribe contact to the list, and remove it from DNM)


* When 'subscribe' parameter is passed:
1) if the contact is not present in the list, the subscription will be created as per the subscribe parameter.
2) if the contact is already present in the list, the subscription of the contact will be changed as per the parameter.

* When 'subscribe' parameter is not passed:
1) if the contact is not present in the list, it will be created as subscribed.
2) if the contact is already present in the list, the subscription of the contact will not be changed for the list.
GET https://api.maropost.com/accounts/:account_id/lists/:list_id/contacts/:id(.:format)
contacts#show

To get a contact in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contact>
  <id type="integer">47841638</id>
  <account-id type="integer">4</account-id>
  <email>bhatti123@gmail.com</email>
  <first-name>GauravjeetSingh</first-name>
  <last-name>bhatti</last-name>
  <phone nil="true"/>
  <fax nil="true"/>
  <uid>abcd</uid>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <custom-field-1 nil="true"/>
  <custom-field-2 nil="true"/>
  <custom-field-3 nil="true"/>
  <subscribed type="boolean">true</subscribed>
  <subscribed-at type="dateTime">2024-04-24T13:57:33-04:00</subscribed-at>
  <status>Subscribed</status>
  <orders type="array">
    <order>
      <order-id type="integer">145633</order-id>
      <order-date type="dateTime">2024-04-24T13:57:33-04:00</order-date>
      <grand-total type="integer">300</grand-total>
      <original-order-id type="integer">123123</original-order-id>
      <products-purchased type="integer">23</products-purchased>
    </order>
  </orders>
  <list-subscriptions type="array">
    <list-subscription>
      <list-id type="integer">17</list-id>
      <name>test list 1</name>
      <status>Subscribed</status>
    </list-subscription>
    <list-subscription>
      <list-id type="integer">18</list-id>
      <name>test list 2</name>
      <status>Subscribed</status>
    </list-subscription>
  </list-subscriptions>
  <journeys type="array">
    <journey>
      <id type="integer">65</id>
      <name>Test Workflow</name>
      <journey-contact-status>Finished</journey-contact-status>
      <journey-status>Enabled</journey-status>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </journey>
    <journey>
      <id type="integer">65</id>
      <name>Test Workflow</name>
      <journey-contact-status>Active</journey-contact-status>
      <journey-status>Enabled</journey-status>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </journey>
  </journeys>
</contact>
To get a contact in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "id": 47841638,
  "account_id": 4,
  "email": "bhatti123@gmail.com",
  "first_name": "GauravjeetSingh",
  "last_name": "bhatti",
  "phone": null,
  "fax": null,
  "uid": "abcd",
  "created_at": "2024-04-24T13:57:33.590-04:00",
  "updated_at": "2024-04-24T13:57:33.590-04:00",
  "custom_field_1": null,
  "custom_field_2": null,
  "custom_field_3": null,
  "subscribed": true,
  "subscribed_at": "2024-04-24T13:57:33.590-04:00",
  "status": "Subscribed",
  "orders": [
    {
      "order_id": 145633,
      "order_date": "2024-04-24T13:57:33.590-04:00",
      "grand_total": 300,
      "original_order_id": 123123,
      "products_purchased": 23
    }
  ],
  "list_subscriptions": [
    {
      "list_id": 17,
      "name": "test list 1",
      "status": "Subscribed"
    },
    {
      "list_id": 18,
      "name": "test list 2",
      "status": "Subscribed"
    }
  ],
  "journeys": [
    {
      "id": 65,
      "name": "Test Workflow",
      "journey_contact_status": "Finished",
      "journey_status": "Enabled",
      "created_at": "2024-04-24T13:57:33.590-04:00",
      "updated_at": "2024-04-24T13:57:33.590-04:00"
    },
    {
      "id": 65,
      "name": "Test Workflow",
      "journey_contact_status": "Active",
      "journey_status": "Enabled",
      "created_at": "2024-04-24T13:57:33.590-04:00",
      "updated_at": "2024-04-24T13:57:33.590-04:00"
    }
  ]
}
PUT https://api.maropost.com/accounts/:account_id/lists/:list_id/contacts/:id(.:format)
contacts#update

To update a contact using XML as the input data format, you would make a HTTP PUT request:
<contact>
  <first-name>api</first-name>
  <email>api_2@email.com</email>
  <phone>1234567890</phone>
  <fax>1234567890</fax>
  <last-name>email</last-name>
  <uid>abcd</uid>
  <custom-field>
    <custom-field-1 type="boolean">true</custom-field-1>
    <custom-field-2 nil="true"/>
    <custom-field-3>abc123</custom-field-3>
  </custom-field>
  <add-tags type="array">
    <add-tag>tag_name</add-tag>
    <add-tag>tag_name</add-tag>
  </add-tags>
  <remove-tags type="array">
    <remove-tag>tag_name</remove-tag>
    <remove-tag>tag_name</remove-tag>
  </remove-tags>
  <subscribe type="boolean">true</subscribe>
  <remove-from-dnm type="boolean">true</remove-from-dnm>
</contact>
(remove_from_dnm => Set this true to subcribe contact to the list, and remove it from DNM)


To update a contact using JSON as the input data format, you would make a HTTP PUT request:
{
  "contact": {
    "first_name": "api",
    "email": "api_2@email.com",
    "phone": "1234567890",
    "fax": "1234567890",
    "last_name": "email",
    "uid": "abcd",
    "custom_field": {
      "custom_field_1": true,
      "custom_field_2": null,
      "custom_field_3": "abc123"
    },
    "add_tags": [
      "tag_name",
      "tag_name"
    ],
    "remove_tags": [
      "tag_name",
      "tag_name"
    ],
    "subscribe": true,
    "remove_from_dnm": true
  }
}
(remove_from_dnm => Set this true to subcribe contact to the list, and remove it from DNM)

PUT https://api.maropost.com/accounts/:account_id/contacts/:id(.:format)

(Update the contact information without using list id)
contacts#update

To update a contact using XML as the input data format, you would make a HTTP PUT request:
<contact>
  <first-name>api</first-name>
  <email>api_2@email.com</email>
  <phone>1234567890</phone>
  <fax>1234567890</fax>
  <last-name>email</last-name>
  <uid>abcd</uid>
  <custom-field>
    <custom-field-1 type="boolean">true</custom-field-1>
    <custom-field-2 nil="true"/>
    <custom-field-3>abc123</custom-field-3>
  </custom-field>
  <add-tags type="array">
    <add-tag>tag_name</add-tag>
    <add-tag>tag_name</add-tag>
  </add-tags>
  <remove-tags type="array">
    <remove-tag>tag_name</remove-tag>
    <remove-tag>tag_name</remove-tag>
  </remove-tags>
</contact>
To update a contact using JSON as the input data format, you would make a HTTP PUT request:
{
  "contact": {
    "first_name": "api",
    "email": "api_2@email.com",
    "phone": "1234567890",
    "fax": "1234567890",
    "last_name": "email",
    "uid": "abcd",
    "custom_field": {
      "custom_field_1": true,
      "custom_field_2": null,
      "custom_field_3": "abc123"
    },
    "add_tags": [
      "tag_name",
      "tag_name"
    ],
    "remove_tags": [
      "tag_name",
      "tag_name"
    ]
  }
}
GET https://api.maropost.com/accounts/:account_id/contacts/:contact_id/open_report(.:format)
contacts#opens_report

To get a list of opens for a contact in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contact-opens type="array">
  <contact-open>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141625</contact-id>
    <browser>Other</browser>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <uid>abcd</uid>
    <ip-address nil="true"/>
  </contact-open>
  <contact-open>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141782</contact-id>
    <browser>Other</browser>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <uid>wxyz</uid>
    <ip-address nil="true"/>
  </contact-open>
</contact-opens>
To get a list of opens for a contact in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "campaign_id": 18812,
    "contact_id": 7141625,
    "browser": "Other",
    "recorded_at": "2024-04-24T13:57:33.593-04:00",
    "uid": "abcd",
    "ip_address": null
  },
  {
    "campaign_id": 18812,
    "contact_id": 7141782,
    "browser": "Other",
    "recorded_at": "2024-04-24T13:57:33.593-04:00",
    "uid": "wxyz",
    "ip_address": null
  }
]
GET https://api.maropost.com/accounts/:account_id/contacts/:contact_id/click_report(.:format)
contacts#clicks_report

To get a list of clicks for a contact in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<contact-clicks type="array">
  <contact-click>
    <account-id type="integer">4</account-id>
    <browser>Other</browser>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141625</contact-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <uid>abcd</uid>
    <ip-address nil="true"/>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <url>http://altdaily.mikegeary1.hop.clickbank.net/?pid=434</url>
  </contact-click>
  <contact-click>
    <account-id type="integer">4</account-id>
    <browser>Other</browser>
    <campaign-id type="integer">18812</campaign-id>
    <contact-id type="integer">7141782</contact-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <uid>wxyz</uid>
    <ip-address nil="true"/>
    <recorded-at type="dateTime">2024-04-24T13:57:33-04:00</recorded-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <url>http://altdaily.mikegeary1.hop.clickbank.net/?pid=434</url>
  </contact-click>
</contact-clicks>
To get a list of clicks for a contact in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "browser": "Other",
    "campaign_id": 18812,
    "contact_id": 7141625,
    "created_at": "2024-04-24T13:57:33.594-04:00",
    "uid": "abcd",
    "ip_address": null,
    "recorded_at": "2024-04-24T13:57:33.594-04:00",
    "updated_at": "2024-04-24T13:57:33.594-04:00",
    "url": "http://altdaily.mikegeary1.hop.clickbank.net/?pid=434"
  },
  {
    "account_id": 4,
    "browser": "Other",
    "campaign_id": 18812,
    "contact_id": 7141782,
    "created_at": "2024-04-24T13:57:33.594-04:00",
    "uid": "wxyz",
    "ip_address": null,
    "recorded_at": "2024-04-24T13:57:33.594-04:00",
    "updated_at": "2024-04-24T13:57:33.594-04:00",
    "url": "http://altdaily.mikegeary1.hop.clickbank.net/?pid=434"
  }
]
DELETE https://api.maropost.com/accounts/:account_id/lists/:list_id/contacts/:id(.:format)
contacts#destroy

DELETE https://api.maropost.com/accounts/:account_id/lists/:list_id/contacts/uid(.:format)?uid=abcd
contacts#destroy

DELETE https://api.maropost.com/accounts/:account_id/contacts/:id(.:format)?list_ids=:list1_id,:list2_id,:list3_id
(Delete a contact from multiple lists with ids :list1_id, :list2_id and :list3_id)
contacts#destroy

DELETE https://api.maropost.com/accounts/:account_id/contacts/uid(.:format)?list_ids=:list1_id,:list2_id,:list3_id&uid=abcd
(Delete a contact from multiple lists with ids :list1_id, :list2_id and :list3_id)
contacts#destroy

DELETE https://api.maropost.com/accounts/:account_id/contacts/delete_all(.:format)?contact[email]=test@email.com
(Delete a contact from all lists)
contacts#destroy

DELETE https://api.maropost.com/accounts/:account_id/contacts/delete_all(.:format)?uid=abcd
(Delete a contact from all lists)
contacts#destroy

PUT https://api.maropost.com/accounts/:account_id/contacts/unsubscribe_all(.:format)?contact[email]=test@email.com
(Unsubscribe a contact from all lists)
contacts#update

PUT https://api.maropost.com/accounts/:account_id/contacts/unsubscribe_all(.:format)?contact[uid]=abcd
(Unsubscribe a contact from all lists)
contacts#update

PUT https://api.maropost.com/accounts/:account_id/contacts/pseudonymize(.:format)?email=test@email.com
(Pseudonymize a contact using email)
contacts#update

POST https://api.maropost.com/accounts/:account_id/contacts(.:format)?list_ids=:list1_id,:list2_id,:list3_id
(Subscribe a contact in multiple lists)
contacts#create

Content Images API

POST https://api.maropost.com/accounts/:account_id/content_images/upload(.:format)
content_images#upload

To upload a image using XML as the input data format, you would make a HTTP POST request:
<content-image>
  <image-url>http://example.com/path/to/image.jpg</image-url>
  <folder-id type="integer">20</folder-id>
</content-image>
To upload a image using using JSON as the input data format, you would make a HTTP POST request:
{
  "content_image": {
    "image_url": "http://example.com/path/to/image.jpg",
    "folder_id": 20
  }
}
* image_url must be valid URL!
* folder_id is an optional attribute.

Tags API

GET https://api.maropost.com/accounts/:account_id/tags(.:format)
tags#index

To get a tags in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<tags type="array">
  <tag>
    <id type="integer">30</id>
    <name>male</name>
    <account-id type="integer">1</account-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </tag>
</tags>
To get a tags in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "id": 30,
    "name": "male",
    "account_id": 1,
    "created_at": "2024-04-24T13:57:33.595-04:00",
    "updated_at": "2024-04-24T13:57:33.595-04:00"
  }
]
GET https://api.maropost.com/accounts/:account_id/tags/:id(.:format)
tags#show

GET https://api.maropost.com/accounts/:account_id/tags(.:format)?name=tag_name
tags#search

To get a tags in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<tags type="array">
  <tag>
    <id type="integer">30</id>
    <name>male</name>
    <account-id type="integer">1</account-id>
    <contacts type="integer">20</contacts>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </tag>
</tags>
To get a tags in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "id": 30,
    "name": "male",
    "account_id": 1,
    "contacts": 20,
    "created_at": "2024-04-24T13:57:33.595-04:00",
    "updated_at": "2024-04-24T13:57:33.595-04:00"
  }
]
POST https://api.maropost.com/accounts/:account_id/tags(.:format)
tags#create

To create tag using XML as the input data format, you would make a HTTP POST request:
<tag>
  <name>male</name>
</tag>
To create tag using using JSON as the input data format, you would make a HTTP POST request:
{
  "tag": {
    "name": "male"
  }
}
PUT https://api.maropost.com/accounts/:account_id/add_remove_tags(.:format)
tags#add_remove_tags

To add/remove tags using XML as the input data format, you would make a HTTP POST request:
<tags>
  <email>test@gmail.com</email>
  <add-tags type="array">
    <add-tag>tag_name</add-tag>
    <add-tag>tag_name</add-tag>
  </add-tags>
  <remove-tags type="array">
    <remove-tag>tag_name</remove-tag>
    <remove-tag>tag_name</remove-tag>
  </remove-tags>
</tags>
To add/remove tags using using JSON as the input data format, you would make a HTTP POST request:
{
  "tags": {
    "email": "test@gmail.com",
    "add_tags": [
      "tag_name",
      "tag_name"
    ],
    "remove_tags": [
      "tag_name",
      "tag_name"
    ]
  }
}
DELETE https://api.maropost.com/accounts/:account_id/tags/:id(.:format)
tags#destroy

Custom Fields API

GET https://api.maropost.com/accounts/:account_id/custom_fields(.:format)
custom_fields#index

To get a list of custom fields in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<custom-fields type="array">
  <custom-field>
    <account-id type="integer">4</account-id>
    <add-to-profile-page type="boolean">true</add-to-profile-page>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <default-value>1</default-value>
    <field-type>boolean</field-type>
    <id type="integer">2355</id>
    <name>custom_field_1</name>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </custom-field>
  <custom-field>
    <account-id type="integer">4</account-id>
    <add-to-profile-page type="boolean">true</add-to-profile-page>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <default-value>2014-10-26</default-value>
    <field-type>datetime</field-type>
    <id type="integer">2356</id>
    <name>custom_field_2</name>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </custom-field>
</custom-fields>
To get a list of custom fields in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "add_to_profile_page": true,
    "created_at": "2024-04-24T13:57:33.597-04:00",
    "default_value": "1",
    "field_type": "boolean",
    "id": 2355,
    "name": "custom_field_1",
    "updated_at": "2024-04-24T13:57:33.597-04:00"
  },
  {
    "account_id": 4,
    "add_to_profile_page": true,
    "created_at": "2024-04-24T13:57:33.597-04:00",
    "default_value": "2014-10-26",
    "field_type": "datetime",
    "id": 2356,
    "name": "custom_field_2",
    "updated_at": "2024-04-24T13:57:33.597-04:00"
  }
]
POST https://api.maropost.com/accounts/:account_id/custom_fields(.:format)
custom_fields#create

To create a new custom field using XML as the input data format, you would make a HTTP POST request:
<custom-field>
  <default-value>0</default-value>
  <field-type>boolean</field-type>
  <name>custom_field_1</name>
  <add-to-profile-page type="boolean">false</add-to-profile-page>
</custom-field>
(REQUIRED FIELD) => name, field-type

To create a new custom field using JSON as the input data format, you would make a HTTP POST request:
{
  "custom_field": {
    "default_value": "0",
    "field_type": "boolean",
    "name": "custom_field_1",
    "add_to_profile_page": false
  }
}
(REQUIRED FIELD) => name, field_type

GET https://api.maropost.com/accounts/:account_id/custom_fields/:id(.:format)
custom_fields#show

To get a custom field in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<custom-field>
  <account-id type="integer">4</account-id>
  <add-to-profile-page type="boolean">true</add-to-profile-page>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <default-value>1</default-value>
  <field-type>boolean</field-type>
  <id type="integer">2355</id>
  <name>custom_field_1</name>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
</custom-field>
To get a custom field in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 4,
  "add_to_profile_page": true,
  "created_at": "2024-04-24T13:57:33.598-04:00",
  "default_value": "1",
  "field_type": "boolean",
  "id": 2355,
  "name": "custom_field_1",
  "updated_at": "2024-04-24T13:57:33.598-04:00"
}
PUT https://api.maropost.com/accounts/:account_id/custom_fields/:id(.:format)
custom_fields#update

To update a custom field using XML as the input data format, you would make a HTTP PUT request:
<custom-field>
  <default-value>2012-04-13</default-value>
  <field-type>datetime</field-type>
  <name>birth_date</name>
</custom-field>
To update a custom field using XML as the input data format, you would make a HTTP PUT request:
{
  "custom_field": {
    "default_value": "2012-04-13",
    "field_type": "datetime",
    "name": "birth_date"
  }
}
DELETE https://api.maropost.com/accounts/:account_id/custom_fields/:id(.:format)
custom_fields#destroy

Lists API

GET https://api.maropost.com/accounts/:account_id/lists(.:format)
lists#index

GET https://api.maropost.com/accounts/:account_id/lists(.:format)?no_counts=true
lists#index_no_counts

(To get description of lists other than counts, for faster results)
To get a list of lists in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<lists type="array">
  <list>
    <account-id type="integer">4</account-id>
    <add-to-unsubscribe-page type="boolean">false</add-to-unsubscribe-page>
    <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
    <contacts-count type="integer">0</contacts-count>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <from-email>Demo@email.com</from-email>
    <from-name>Demo</from-name>
    <hard-bounces type="integer">0</hard-bounces>
    <id type="integer">8440</id>
    <language>en</language>
    <name>100 Test List</name>
    <post-url nil="true"/>
    <refreshed-at type="dateTime">2024-04-24T13:57:33-04:00</refreshed-at>
    <reply-to-email>Demo@email.com</reply-to-email>
    <soft-bounces type="integer">0</soft-bounces>
    <subscribers type="integer">2</subscribers>
    <unsubscribes type="integer">0</unsubscribes>
    <complaints-count type="integer">0</complaints-count>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-contacts-count type="integer">293</total-contacts-count>
    <total-pages type="integer">272</total-pages>
  </list>
  <list>
    <account-id type="integer">4</account-id>
    <add-to-unsubscribe-page type="boolean">false</add-to-unsubscribe-page>
    <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
    <contacts-count type="integer">0</contacts-count>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <from-email>Demo@maropost.com</from-email>
    <from-name>Demo</from-name>
    <hard-bounces type="integer">0</hard-bounces>
    <id type="integer">8441</id>
    <language>en</language>
    <name>101 Test List</name>
    <post-url nil="true"/>
    <refreshed-at type="dateTime">2024-04-24T13:57:33-04:00</refreshed-at>
    <reply-to-email>Demo@maropost.com</reply-to-email>
    <soft-bounces type="integer">0</soft-bounces>
    <subscribers type="integer">2</subscribers>
    <unsubscribes type="integer">0</unsubscribes>
    <complaints-count type="integer">0</complaints-count>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <total-contacts-count type="integer">2931</total-contacts-count>
    <total-pages type="integer">272</total-pages>
  </list>
</lists>
To get a list of lists in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "add_to_unsubscribe_page": false,
    "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
    "contacts_count": 0,
    "created_at": "2024-04-24T13:57:33.600-04:00",
    "from_email": "Demo@email.com",
    "from_name": "Demo",
    "hard_bounces": 0,
    "id": 8440,
    "language": "en",
    "name": "100 Test List",
    "post_url": null,
    "refreshed_at": "2024-04-24T13:57:33.600-04:00",
    "reply_to_email": "Demo@email.com",
    "soft_bounces": 0,
    "subscribers": 2,
    "unsubscribes": 0,
    "complaints_count": 0,
    "updated_at": "2024-04-24T13:57:33.600-04:00",
    "total_contacts_count": 293,
    "total_pages": 272
  },
  {
    "account_id": 4,
    "add_to_unsubscribe_page": false,
    "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
    "contacts_count": 0,
    "created_at": "2024-04-24T13:57:33.600-04:00",
    "from_email": "Demo@maropost.com",
    "from_name": "Demo",
    "hard_bounces": 0,
    "id": 8441,
    "language": "en",
    "name": "101 Test List",
    "post_url": null,
    "refreshed_at": "2024-04-24T13:57:33.600-04:00",
    "reply_to_email": "Demo@maropost.com",
    "soft_bounces": 0,
    "subscribers": 2,
    "unsubscribes": 0,
    "complaints_count": 0,
    "updated_at": "2024-04-24T13:57:33.600-04:00",
    "total_contacts_count": 2931,
    "total_pages": 272
  }
]
POST https://api.maropost.com/accounts/:account_id/lists(.:format)
lists#create

To create a new list using XML as the input data format, you would make a HTTP POST request:
<list>
  <reply-to-email>demo@email.com</reply-to-email>
  <address>my address</address>
  <from-email>demo@email.com</from-email>
  <language>en</language>
  <from-name>Demo user</from-name>
  <name>Demo List</name>
  <add-to-unsubscribe-page type="boolean">false</add-to-unsubscribe-page>
  <post-url nil="true"/>
  <display-name>John Paul</display-name>
  <description>This is your good name.</description>
</list>
(REQUIRED FIELD) => name, address, language

To create a new list using JSON as the input data format, you would make a HTTP POST request:
{
  "list": {
    "reply_to_email": "demo@email.com",
    "address": "my address",
    "from_email": "demo@email.com",
    "language": "en",
    "from_name": "Demo user",
    "name": "Demo List",
    "add_to_unsubscribe_page": false,
    "post_url": null,
    "display_name": "John Paul",
    "description": "This is your good name."
  }
}
(REQUIRED FIELD) => name, address, language

GET https://api.maropost.com/accounts/:account_id/lists/:id(.:format)
lists#show

To get a list in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<list>
  <account-id type="integer">4</account-id>
  <add-to-unsubscribe-page type="boolean">false</add-to-unsubscribe-page>
  <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
  <contacts-count type="integer">0</contacts-count>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <from-email>Demo@email.com</from-email>
  <from-name>Demo</from-name>
  <hard-bounces type="integer">0</hard-bounces>
  <id type="integer">8440</id>
  <language>en</language>
  <name>100 Test List</name>
  <post-url nil="true"/>
  <refreshed-at type="dateTime">2024-04-24T13:57:33-04:00</refreshed-at>
  <reply-to-email>Demo@email.com</reply-to-email>
  <soft-bounces type="integer">0</soft-bounces>
  <subscribers type="integer">2</subscribers>
  <unsubscribes type="integer">0</unsubscribes>
  <complaints-count type="integer">0</complaints-count>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <total-contacts-count type="integer">293</total-contacts-count>
  <total-pages type="integer">272</total-pages>
</list>
To get a list JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 4,
  "add_to_unsubscribe_page": false,
  "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
  "contacts_count": 0,
  "created_at": "2024-04-24T13:57:33.602-04:00",
  "from_email": "Demo@email.com",
  "from_name": "Demo",
  "hard_bounces": 0,
  "id": 8440,
  "language": "en",
  "name": "100 Test List",
  "post_url": null,
  "refreshed_at": "2024-04-24T13:57:33.602-04:00",
  "reply_to_email": "Demo@email.com",
  "soft_bounces": 0,
  "subscribers": 2,
  "unsubscribes": 0,
  "complaints_count": 0,
  "updated_at": "2024-04-24T13:57:33.602-04:00",
  "total_contacts_count": 293,
  "total_pages": 272
}
GET https://api.maropost.com/accounts/:account_id/lists/:id/refresh_count(.:format)
lists#refresh_count

(To refresh the count of a list.)
PUT https://api.maropost.com/accounts/:account_id/lists/:id(.:format)
lists#update

To update a list using XML as the input data format, you would make a HTTP PUT request:
<list>
  <reply-to-email>demo@email.com</reply-to-email>
  <address>my address</address>
  <from-email>demo@email.com</from-email>
  <language>en</language>
  <from-name>Demo user</from-name>
  <name>Demo List</name>
  <add-to-unsubscribe-page type="boolean">false</add-to-unsubscribe-page>
  <post-url nil="true"/>
  <display-name>John Paul</display-name>
  <description>This is your good name.</description>
</list>
To update a list using JSON as the input data format, you would make a HTTP PUT request:
{
  "list": {
    "reply_to_email": "demo@email.com",
    "address": "my address",
    "from_email": "demo@email.com",
    "language": "en",
    "from_name": "Demo user",
    "name": "Demo List",
    "add_to_unsubscribe_page": false,
    "post_url": null,
    "display_name": "John Paul",
    "description": "This is your good name."
  }
}
PUT https://api.maropost.com/accounts/:account_id/lists/:id/ftp_import(.:format)
lists#ftp_import

To ftp import a list using XML as the input data format, you would make a HTTP PUT request:
NOTE: If the payload is missing “subscribed” from the "mappings" then all contacts are subscribed by default. Valid values for subscribed status in the import file include “S” for subscribed, “U” for unsubscribed.
<list>
  <ftp-file>customer.csv</ftp-file>
  <delimiter>Comma</delimiter>
  <mappings>
    <email>email</email>
    <first-name>firstname</first-name>
    <phone>phonenumber</phone>
    <city>city</city>
    <sex>gender</sex>
    <subscribed>status</subscribed>
  </mappings>
  <import-options>
    <import-new-contacts>yes</import-new-contacts>
    <update-contacts>yes</update-contacts>
    <disable-workflows>no</disable-workflows>
  </import-options>
</list>
To ftp import a list using JSON as the input data format, you would make a HTTP PUT request:
NOTE: If the payload is missing “subscribed” from the "mappings" then all contacts are subscribed by default. Valid values for subscribed status in the import file include “S” for subscribed, “U” for unsubscribed.
{
  "list": {
    "ftp_file": "customer.csv",
    "delimiter": "Comma",
    "mappings": {
      "email": "email",
      "first_name": "firstname",
      "phone": "phonenumber",
      "city": "city",
      "sex": "gender",
      "subscribed": "status"
    },
    "import_options": {
      "import_new_contacts": "yes",
      "update_contacts": "yes",
      "disable_workflows": "no"
    }
  }
}
DELETE https://api.maropost.com/accounts/:account_id/lists/:id(.:format)
lists#destroy

Secure Lists API

GET https://api.maropost.com/accounts/:account_id/secure_lists(.:format)
secure_lists#index

To get a list of secure lists in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<secure-lists type="array">
  <secure-list>
    <account-id type="integer">4</account-id>
    <name>Test Secure List</name>
    <contacts-count type="integer">8686</contacts-count>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <refreshed-at type="dateTime">2024-04-24T13:57:33-04:00</refreshed-at>
  </secure-list>
  <secure-list>
    <account-id type="integer">4</account-id>
    <name>Fist Secure List</name>
    <contacts-count type="integer">7934</contacts-count>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <refreshed-at type="dateTime">2024-04-24T13:57:33-04:00</refreshed-at>
  </secure-list>
</secure-lists>
To get a list of secure lists in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "name": "Test Secure List",
    "contacts_count": 8686,
    "created_at": "2024-04-24T13:57:33.604-04:00",
    "updated_at": "2024-04-24T13:57:33.604-04:00",
    "refreshed_at": "2024-04-24T13:57:33.604-04:00"
  },
  {
    "account_id": 4,
    "name": "Fist Secure List",
    "contacts_count": 7934,
    "created_at": "2024-04-24T13:57:33.604-04:00",
    "updated_at": "2024-04-24T13:57:33.604-04:00",
    "refreshed_at": "2024-04-24T13:57:33.604-04:00"
  }
]
GET https://api.maropost.com/accounts/:account_id/secure_lists/:id(.:format)
secure_lists#show

To get a secure list in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<secure-lists>
  <account-id type="integer">4</account-id>
  <name>Test Secure List</name>
  <contacts-count type="integer">8686</contacts-count>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <refreshed-at type="dateTime">2024-04-24T13:57:33-04:00</refreshed-at>
</secure-lists>
To get a secure list in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 4,
  "name": "Test Secure List",
  "contacts_count": 8686,
  "created_at": "2024-04-24T13:57:33.605-04:00",
  "updated_at": "2024-04-24T13:57:33.605-04:00",
  "refreshed_at": "2024-04-24T13:57:33.605-04:00"
}
POST https://api.maropost.com/accounts/:account_id/secure_lists(.:format)
secure_lists#create

To create a new secure list using XML as the input data format, you would make a HTTP POST request:
<secure-list>
  <name>My Secure List</name>
</secure-list>
To create a new secure list using JSON as the input data format, you would make a HTTP POST request:
{
  "secure_list": {
    "name": "My Secure List"
  }
}
To get a list of secure lists in JSON format, you would make a HTTP POST request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "id": 1,
  "account_id": 3,
  "name": "My Secure List",
  "contacts_count": null,
  "refreshed_at": "2020-08-20T05:07:33.000-04:00",
  "created_at": "2020-08-20T05:07:33.000-04:00",
  "updated_at": "2020-08-20T05:13:05.000-04:00"
}
PUT https://api.maropost.com/accounts/:account_id/secure_lists/:id(.:format)
secure_lists#update

To update a secure list using XML as the input data format, you would make a HTTP PUT request:
<secure-list>
  <name>My Secure List</name>
</secure-list>
To update a secure list using JSON as the input data format, you would make a HTTP PUT request:
{
  "secure_list": {
    "name": "My Secure List"
  }
}
To get a list of secure lists in JSON format, you would make a HTTP PUT request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "id": 1,
  "account_id": 3,
  "name": "My Seecure List",
  "contacts_count": null,
  "refreshed_at": "2020-08-20T05:07:33.000-04:00",
  "created_at": "2020-08-20T05:07:33.000-04:00",
  "updated_at": "2020-08-20T05:13:05.000-04:00"
}
DELETE https://api.maropost.com/accounts/:account_id/secure_lists/:id(.:format)
secure_lists#destroy

POST https://api.maropost.com/accounts/:account_id/secure_lists/:id/import(.:format)
secure_lists#import

To import encrypted emails from a file on FTP to a secure list using XML as the input data format, you would make a HTTP POST request:

* To import from a file with header you are required to pass parameter with column name only
* To import from a file without header you are required to pass parameter with column number(ordered from left to right) only
<secure-list>
  <ftp-file>md5list.csv</ftp-file>
  <ftp-delimiter>Comma</ftp-delimiter>
  <column-name>secure_email</column-name>
  <column-number>2</column-number>
</secure-list>
To import encrypted emails froma file on FTP to a secure list using JSON as the input data format, you would make a HTTP POST request:
{
  "secure_list": {
    "ftp_file": "md5list.csv",
    "ftp_delimiter": "Comma",
    "column_name": "secure_email",
    "column_number": "2"
  }
}

Do Not Mail List API

GET https://api.maropost.com/accounts/:account_id/general_unsubscribes(.:format)
general_unsubscribes#index

For App cluster only. All other clusters use /general_unsubscribes/list(.:format)
To get a general_unsubscribes in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<general-unsubscribes type="array">
  <general-unsubscribe>
    <account-id type="integer">1</account-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <email>demo@email.com</email>
    <id type="integer">30</id>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <uid>abcd</uid>
  </general-unsubscribe>
</general-unsubscribes>
To get a general_unsubscribes in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "created_at": "2024-04-24T13:57:33.607-04:00",
    "email": "demo@email.com",
    "id": 30,
    "updated_at": "2024-04-24T13:57:33.607-04:00",
    "uid": "abcd"
  }
]
POST https://api.maropost.com/accounts/:account_id/general_unsubscribes(.:format)
general_unsubscribes#create

To add new email address to DNM list using XML as the input data format, you would make a HTTP POST request:
<general-unsubscribe>
  <email>demo@email.com</email>
</general-unsubscribe>
(REQUIRED FIELD) => email

To add new email address to DNM list using JSON as the input data format, you would make a HTTP POST request:
{
  "general_unsubscribe": {
    "email": "demo@email.com"
  }
}
(REQUIRED FIELD) => email

POST https://api.maropost.com/accounts/:account_id/general_unsubscribes(.:format)
general_unsubscribes#create

To add new email address using UID to DNM list using XML as the input data format, you would make a HTTP POST request:
<general-unsubscribe>
  <uid>abcd</uid>
</general-unsubscribe>
(REQUIRED FIELD) => uid

To add new email address using UID to DNM list using JSON as the input data format, you would make a HTTP POST request:
{
  "general_unsubscribe": {
    "uid": "abcd"
  }
}
(REQUIRED FIELD) => uid

GET https://api.maropost.com/accounts/:account_id/general_unsubscribes/email(.:format)?contact[email]=shaun@gmail.com
general_unsubscribes#search

To search a contact in general_unsubscribes by email address in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<general-unsubscribe>
  <account-id type="integer">1</account-id>
  <email>shaun@gmail.com</email>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
</general-unsubscribe>

To search a contact in general_unsubscribes by email address in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 1,
  "email": "shaun@gmail.com",
  "created_at": "2024-04-24T13:57:33.607-04:00"
}

GET https://api.maropost.com/accounts/:account_id/general_unsubscribes/email(.:format)?uid=abcd
general_unsubscribes#search

To search a contact in general_unsubscribes by uid in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<general-unsubscribe>
  <account-id type="integer">1</account-id>
  <email>shaun@gmail.com</email>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
</general-unsubscribe>

To search a contact in general_unsubscribes by uid in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 1,
  "email": "shaun@gmail.com",
  "created_at": "2024-04-24T13:57:33.608-04:00"
}

DELETE https://api.maropost.com/accounts/:account_id/general_unsubscribes/delete(.:format)?email=test@gmail.com
general_unsubscribes#delete

(Delete a contact from Do Not Mail list using email address)
DELETE https://api.maropost.com/accounts/:account_id/general_unsubscribes/delete(.:format)?uid=abcd
general_unsubscribes#delete

(Delete a contact from Do Not Mail list using UID)

BRANDS Do Not Mail List API

GET https://api.maropost.com/accounts/:account_id/brand_unsubscribes(.:format)
brand_unsubscribes#index

To get a list of all contacts in Brand's DNM list in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<brand-unsubscribes type="array">
  <brand-unsubscribe>
    <email>demo@email.com</email>
    <brand-id type="integer">1</brand-id>
    <account-id type="integer">1</account-id>
    <id type="integer">30</id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <uid>abcd</uid>
  </brand-unsubscribe>
</brand-unsubscribes>
To get a list of all contacts in Brand's DNM list in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "email": "demo@email.com",
    "brand_id": 1,
    "account_id": 1,
    "id": 30,
    "created_at": "2024-04-24T13:57:33.608-04:00",
    "uid": "abcd"
  }
]
POST https://api.maropost.com/accounts/:account_id/brand_unsubscribes(.:format)
brand_unsubscribes#create

To add new email address to Brands DNM list using XML as the input data format, you would make a HTTP POST request:
<brand-unsubscribe>
  <email>demo@email.com</email>
  <brand-name>brand_1</brand-name>
</brand-unsubscribe>
(You can also use brand-id instead of brand-name, but either of two is required to add an email to Brand's DNM list.)


To add new email address to Brands DNM list using JSON as the input data format, you would make a HTTP POST request:
{
  "brand_unsubscribe": {
    "email": "demo@email.com",
    "brand_name": "brand_1"
  }
}
(You can also use brand_id instead of brand_name, but either of two is required to add an email to Brand's DNM list.)

POST https://api.maropost.com/accounts/:account_id/brand_unsubscribes(.:format)
brand_unsubscribes#create

To add new email address using UID to Brands DNM list using XML as the input data format, you would make a HTTP POST request:
<brand-unsubscribe>
  <uid>abcd</uid>
  <brand-name>brand_1</brand-name>
</brand-unsubscribe>
(You can also use brand-id instead of brand-name, but either of two is required to add an email to Brand's DNM list.)


To add new email address using UID to Brands DNM list using JSON as the input data format, you would make a HTTP POST request:
{
  "brand_unsubscribe": {
    "uid": "abcd",
    "brand_name": "brand_1"
  }
}
(You can also use brand_id instead of brand_name, but either of two is required to add an email to Brand's DNM list.)

GET https://api.maropost.com/accounts/:account_id/brand_unsubscribes/email(.:format)?email=demo@email.com
brand_unsubscribes#search

To search a contact in Brands DNM list by email address in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<brand-unsubscribes type="array">
  <brand-unsubscribe>
    <email>demo@email.com</email>
    <brand-id type="integer">1</brand-id>
    <account-id type="integer">1</account-id>
    <id type="integer">30</id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <uid>abcd</uid>
  </brand-unsubscribe>
  <brand-unsubscribe>
    <email>demo@email.com</email>
    <brand-id type="integer">2</brand-id>
    <account-id type="integer">1</account-id>
    <id type="integer">31</id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <uid>wxyz</uid>
  </brand-unsubscribe>
</brand-unsubscribes>

To search a contact in Brands DNM list by email address in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "email": "demo@email.com",
    "brand_id": 1,
    "account_id": 1,
    "id": 30,
    "created_at": "2024-04-24T13:57:33.610-04:00",
    "uid": "abcd"
  },
  {
    "email": "demo@email.com",
    "brand_id": 2,
    "account_id": 1,
    "id": 31,
    "created_at": "2024-04-24T13:57:33.610-04:00",
    "uid": "wxyz"
  }
]

GET https://api.maropost.com/accounts/:account_id/brand_unsubscribes/email(.:format)?uid=abcd
brand_unsubscribes#search

To search a contact in Brands DNM list by uid in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<brand-unsubscribes type="array">
  <brand-unsubscribe>
    <email>demo@email.com</email>
    <brand-id type="integer">1</brand-id>
    <account-id type="integer">1</account-id>
    <id type="integer">30</id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <uid>abcd</uid>
  </brand-unsubscribe>
  <brand-unsubscribe>
    <email>demo@email.com</email>
    <brand-id type="integer">2</brand-id>
    <account-id type="integer">1</account-id>
    <id type="integer">31</id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <uid>wxyz</uid>
  </brand-unsubscribe>
</brand-unsubscribes>

To search a contact in Brands DNM list by uid in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "email": "demo@email.com",
    "brand_id": 1,
    "account_id": 1,
    "id": 30,
    "created_at": "2024-04-24T13:57:33.611-04:00",
    "uid": "abcd"
  },
  {
    "email": "demo@email.com",
    "brand_id": 2,
    "account_id": 1,
    "id": 31,
    "created_at": "2024-04-24T13:57:33.611-04:00",
    "uid": "wxyz"
  }
]

GET https://api.maropost.com/accounts/:account_id/brand_unsubscribes/email(.:format)?email=demo@email.com&brand=brand_name
brand_unsubscribes#search

(To search a contact in Brands Do Not Mail List for a specific Brand using email address and Brand's name.)
GET https://api.maropost.com/accounts/:account_id/brand_unsubscribes/email(.:format)?uid=abcd&brand=brand_name
brand_unsubscribes#search

(To search a contact in Brands Do Not Mail List for a specific Brand using uid and Brand's name.)
DELETE https://api.maropost.com/accounts/:account_id/brand_unsubscribes/delete(.:format)?email=test@gmail.com
brand_unsubscribes#delete

(Delete a contact from Brands Do Not Mail List for all Brands using email address)
DELETE https://api.maropost.com/accounts/:account_id/brand_unsubscribes/delete(.:format)?uid=abcd
brand_unsubscribes#delete

(Delete a contact from Brands Do Not Mail List for all Brands using UID)
DELETE https://api.maropost.com/accounts/:account_id/brand_unsubscribes/delete(.:format)?email=test@gmail.com&brand=brand_name
brand_unsubscribes#delete

(Delete a contact from Brands Do Not Mail List for a specific Brand using email address)
DELETE https://api.maropost.com/accounts/:account_id/brand_unsubscribes/delete(.:format)?uid=abcd&brand=brand_name
brand_unsubscribes#delete

(Delete a contact from Brands Do Not Mail List for a specific Brand using UID)

Journeys API

GET https://api.maropost.com/accounts/:account_id/journeys/:journey_id/journey_contacts(.:format)
journey_contacts#index

To get a list of journey contacts in XML format, you would make a HTTP GET request.
<journey-contacts type="array">
  <journey-contact>
    <account-id type="integer">1</account-id>
    <journey-id type="integer">5</journey-id>
    <contact-id type="integer">293166</contact-id>
    <email>abc@maropost.com</email>
    <uid>abcd</uid>
    <status>active</status>
    <trigger-id type="integer">4</trigger-id>
    <journey-item-id type="integer">1</journey-item-id>
    <journey-end-id type="integer">2</journey-end-id>
    <total-pages type="integer">1</total-pages>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </journey-contact>
</journey-contacts>
To get a list of journey contacts in JSON format, you would make a HTTP GET request.
[
  {
    "account_id": 1,
    "journey_id": 5,
    "contact_id": 293166,
    "email": "abc@maropost.com",
    "uid": "abcd",
    "status": "active",
    "trigger_id": 4,
    "journey_item_id": 1,
    "journey_end_id": 2,
    "total_pages": 1,
    "created_at": "2024-04-24T13:57:33.612-04:00",
    "updated_at": "2024-04-24T13:57:33.612-04:00"
  }
]
PUT https://api.maropost.com/accounts/:account_id/journeys/stop_all_journeys(.:format)?contact_id=10099
(Stop all journeys for a contact with contact_id)
journeys#stop_all_journeys

PUT https://api.maropost.com/accounts/:account_id/journeys/stop_all_journeys(.:format)?email=test@email.com
(Stop all journeys for a contact with email)
journeys#stop_all_journeys

PUT https://api.maropost.com/accounts/:account_id/journeys/stop_all_journeys(.:format)?uid=abcd
(Stop all journeys for a contact with UID)
journeys#stop_all_journeys

PUT https://api.maropost.com/accounts/:account_id/journeys/:journey_id/stop/:contact_id(.:format)
(Pause a journey for a contact)
journeys#stop

PUT https://api.maropost.com/accounts/:account_id/journeys/:journey_id/stop/uid(.:format)?uid=abcd
(Pause a journey for a contact by UID)
journeys#stop

PUT https://api.maropost.com/accounts/:account_id/journeys/:journey_id/start/:contact_id(.:format)
(To restart a journey for a paused contact)
(To add a new contact in journey)
(To retrigger the journey for a contact who has finished its journey once) *Make sure the "Retrigger Journey" option is enabled
journeys#start

PUT https://api.maropost.com/accounts/:account_id/journeys/:journey_id/start/uid(.:format)?uid=abcd
(To restart a journey for a paused contact by UID)
(To add a new contact in journey by UID)
(To retrigger the journey for a contact who has finished its journey once) *Make sure the "Retrigger Journey" option is enabled
journeys#start

PUT https://api.maropost.com/accounts/:account_id/journeys/:journeys_id/reset/:contact_id(.:format)
(To reset a journey for a active/paused contact)
(Resetting a contact to the beginning of the journeys will result in sending of the same journey campaigns as originally sent!)
journeys#reset

PUT https://api.maropost.com/accounts/:account_id/journeys/:journeys_id/reset/uid(.:format)?uid=abcd
(To reset a journey for a active/paused contact by UID)
(Resetting a contact to the beginning of the journeys will result in sending of the same journey campaigns as originally sent!)
journeys#reset

GET https://api.maropost.com/accounts/:account_id/journeys(.:format)
journeys#index

To get a list of journeys in XML format, you would make a HTTP GET request.
<journeys type="array">
  <journey>
    <id type="integer">1</id>
    <account-id type="integer">1</account-id>
    <name>Journey Test</name>
    <active type="boolean">true</active>
    <retrigger type="boolean">false</retrigger>
    <folder-id type="integer">1</folder-id>
    <total-pages type="integer">1</total-pages>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </journey>
  <journey>
    <id type="integer">2</id>
    <account-id type="integer">1</account-id>
    <name>Journey Test 2</name>
    <active type="boolean">true</active>
    <retrigger type="boolean">false</retrigger>
    <folder-id type="integer">1</folder-id>
    <total-pages type="integer">1</total-pages>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </journey>
</journeys>
To get a list of journeys in JSON format, you would make a HTTP GET request.
[
  {
    "id": 1,
    "account_id": 1,
    "name": "Journey Test",
    "active": true,
    "retrigger": false,
    "folder_id": 1,
    "total_pages": 1,
    "created_at": "2024-04-24T13:57:33.613-04:00",
    "updated_at": "2024-04-24T13:57:33.613-04:00"
  },
  {
    "id": 2,
    "account_id": 1,
    "name": "Journey Test 2",
    "active": true,
    "retrigger": false,
    "folder_id": 1,
    "total_pages": 1,
    "created_at": "2024-04-24T13:57:33.613-04:00",
    "updated_at": "2024-04-24T13:57:33.613-04:00"
  }
]
GET https://api.maropost.com/accounts/:account_id/journeys/:journey_id/journey_campaigns(.:format)
journeys#journey_campaigns

To get a list of all campaigns of a specific journey in XML format, you would make a HTTP GET request.
<campaigns type="array">
  <campaign>
    <id type="integer">1</id>
    <account-id type="integer">1</account-id>
    <content-id type="integer">445</content-id>
    <from-name>Test</from-name>
    <from-email>test@gmail.com</from-email>
    <subject>this is test</subject>
    <name>test</name>
    <reply-to>test@gmail.com</reply-to>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <language>en</language>
    <address>Canada</address>
    <campaign-type type="integer">4</campaign-type>
    <campaign-group-id nil="true"/>
    <email-preview-link type="boolean">true</email-preview-link>
    <preheader>xyz</preheader>
    <total-pages type="integer">1</total-pages>
    <campaign-tags type="array">
      <campaign-tag>new test2</campaign-tag>
      <campaign-tag>new test3</campaign-tag>
    </campaign-tags>
  </campaign>
</campaigns>
To get a list of all campaign's of a specific journey in JSON format, you would make a HTTP GET request.
[
  {
    "id": 1,
    "account_id": 1,
    "content-id": 445,
    "from-name": "Test",
    "from-email": "test@gmail.com",
    "subject": "this is test",
    "name": "test",
    "reply-to": "test@gmail.com",
    "created_at": "2024-04-24T13:57:33.614-04:00",
    "updated_at": "2024-04-24T13:57:33.614-04:00",
    "language": "en",
    "address": "Canada",
    "campaign-type": 4,
    "campaign-group-id": null,
    "email-preview-link": true,
    "preheader": "xyz",
    "total-pages": 1,
    "campaign-tags": [
      "new test2",
      "new test3"
    ]
  }
]
GET https://api.maropost.com/accounts/:account_id/journeys/all_journey_campaigns(.:format)
journeys#all_journey_campaigns

To get a list of all journeys campaigns in XML format, you would make a HTTP GET request.
<campaigns type="array">
  <campaign>
    <id type="integer">1</id>
    <account-id type="integer">1</account-id>
    <content-id type="integer">445</content-id>
    <from-name>Test</from-name>
    <from-email>test@gmail.com</from-email>
    <subject>this is test</subject>
    <name>test</name>
    <reply-to>test@gmail.com</reply-to>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <language>en</language>
    <address>Canada</address>
    <campaign-type type="integer">4</campaign-type>
    <campaign-group-id nil="true"/>
    <email-preview-link type="boolean">true</email-preview-link>
    <preheader>xyz</preheader>
    <total-pages type="integer">1</total-pages>
    <campaign-tags type="array">
      <campaign-tag>new test2</campaign-tag>
      <campaign-tag>new test3</campaign-tag>
    </campaign-tags>
  </campaign>
  <campaign>
    <id type="integer">2</id>
    <account-id type="integer">2</account-id>
    <content-id type="integer">446</content-id>
    <from-name>Test1</from-name>
    <from-email>test1@gmail.com</from-email>
    <subject>this is test1</subject>
    <name>test1</name>
    <reply-to>test1@gmail.com</reply-to>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <language>en</language>
    <address>Canada</address>
    <campaign-type type="integer">4</campaign-type>
    <campaign-group-id nil="true"/>
    <email-preview-link type="boolean">true</email-preview-link>
    <preheader>xyz</preheader>
    <total-pages type="integer">1</total-pages>
    <campaign-tags type="array">
      <campaign-tag>new test2</campaign-tag>
      <campaign-tag>new test3</campaign-tag>
    </campaign-tags>
  </campaign>
</campaigns>
To get a list of all journeys campaigns in JSON format, you would make a HTTP GET request.
[
  {
    "id": 1,
    "account_id": 1,
    "content-id": 445,
    "from-name": "Test",
    "from-email": "test@gmail.com",
    "subject": "this is test",
    "name": "test",
    "reply-to": "test@gmail.com",
    "created_at": "2024-04-24T13:57:33.617-04:00",
    "updated_at": "2024-04-24T13:57:33.617-04:00",
    "language": "en",
    "address": "Canada",
    "campaign-type": 4,
    "campaign-group-id": null,
    "email-preview-link": true,
    "preheader": "xyz",
    "total-pages": 1,
    "campaign-tags": [
      "new test2",
      "new test3"
    ]
  },
  {
    "id": 2,
    "account_id": 2,
    "content-id": 446,
    "from-name": "Test1",
    "from-email": "test1@gmail.com",
    "subject": "this is test1",
    "name": "test1",
    "reply-to": "test1@gmail.com",
    "created_at": "2024-04-24T13:57:33.617-04:00",
    "updated_at": "2024-04-24T13:57:33.617-04:00",
    "language": "en",
    "address": "Canada",
    "campaign-type": 4,
    "campaign-group-id": null,
    "email-preview-link": true,
    "preheader": "xyz",
    "total-pages": 1,
    "campaign-tags": [
      "new test2",
      "new test3"
    ]
  }
]
PUT https://api.maropost.com/accounts/:account_id/journeys/:journey_id/reset_contact_status(.:format)?email=api@email.com
(To reset contact's status to Finished from Unsubscribed for this specific Journey)
(Resetting a contact's status to Finished from Unsubscribed will allow him to retrigger the same journey.Also, it won't change contact's status if he is already marked as SPAM or HARD BOUNCED.)
journeys#reset_contact_status

Product/Revenue API

GET https://api.maropost.com/accounts/:account_id/orders/:id(.:format)
orders#show

(This call will match the value entered with the original_order_id field of the orders.)
GET https://api.maropost.com/accounts/:account_id/orders/find(.:format)?where[id]=id

(This call will match the value entered with the internal ID field of the orders.)
To get a order in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<order type="array">
  <order>
    <account-id type="integer">1</account-id>
    <contact-id type="integer">5416596</contact-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <grand-total type="float">4100.0</grand-total>
    <id type="integer">33</id>
    <order-date type="dateTime">2024-04-24T13:57:33-04:00</order-date>
    <order-status>Processed</order-status>
    <original-order-id>21</original-order-id>
    <campaign-id>98223</campaign-id>
    <coupon-code>DISCOUNT-50</coupon-code>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <source-name>test</source-name>
    <source-type>test_type</source-type>
    <order-items type="array">
      <order-item>
        <contact-id type="integer">5416596</contact-id>
        <price type="float">1100.0</price>
        <quantity type="integer">3</quantity>
        <total type="float">3300.0</total>
        <item-id type="integer">35</item-id>
      </order-item>
      <order-item>
        <contact-id type="integer">5416596</contact-id>
        <price type="float">800.0</price>
        <quantity type="integer">1</quantity>
        <total type="float">800.0</total>
        <item-id type="integer">36</item-id>
      </order-item>
    </order-items>
    <products type="array">
      <product>
        <description>Product1 </description>
        <item-id>35</item-id>
        <adcode>Xyrsty</adcode>
        <category>xyz</category>
        <name>test</name>
        <image-url>https://product_image/example.com</image-url>
        <store-url>https://product_page/example.com</store-url>
        <status type="boolean">true</status>
        <availability type="integer">100</availability>
        <brand>john</brand>
        <published type="boolean">true</published>
      </product>
      <product>
        <description>Product2</description>
        <item-id>36</item-id>
        <adcode>Xyrsty</adcode>
        <category>abc</category>
        <name>test1</name>
        <image-url>https://product2_image/example.com</image-url>
        <store-url>https://product2_page/example.com</store-url>
        <status type="boolean">true</status>
        <availability type="integer">100</availability>
        <brand>john</brand>
        <published type="boolean">true</published>
      </product>
    </products>
  </order>
  <order>
    <account-id type="integer">1</account-id>
    <contact-id type="integer">5416597</contact-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <grand-total type="float">4200.0</grand-total>
    <id type="integer">34</id>
    <order-date type="dateTime">2024-04-24T13:57:33-04:00</order-date>
    <order-status>Processed</order-status>
    <original-order-id>22</original-order-id>
    <campaign-id>98224</campaign-id>
    <coupon-code>DISCOUNT-60</coupon-code>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <source-name>test</source-name>
    <source-type>test_type</source-type>
    <order-items type="array">
      <order-item>
        <contact-id type="integer">5416597</contact-id>
        <price type="float">1200.0</price>
        <quantity type="integer">3</quantity>
        <total type="float">3600.0</total>
        <item-id type="integer">36</item-id>
      </order-item>
      <order-item>
        <contact-id type="integer">5416597</contact-id>
        <price type="float">900.0</price>
        <quantity type="integer">1</quantity>
        <total type="float">900.0</total>
        <item-id type="integer">37</item-id>
      </order-item>
    </order-items>
    <products type="array">
      <product>
        <description>Product1 </description>
        <item-id>36</item-id>
        <adcode>Xyrstz</adcode>
        <category>xyz</category>
        <name>test</name>
        <image-url>https://product3_image/example.com</image-url>
        <store-url>https://product3_page/example.com</store-url>
        <status type="boolean">true</status>
        <availability type="integer">100</availability>
        <brand>john</brand>
        <published type="boolean">true</published>
      </product>
      <product>
        <description>Product2</description>
        <item-id>36</item-id>
        <adcode>Xyrsty</adcode>
        <category>abc</category>
        <name>test1</name>
        <image-url>https://product4_image/example.com</image-url>
        <store-url>https://product4_page/example.com</store-url>
        <status type="boolean">true</status>
        <availability type="integer">100</availability>
        <brand>john</brand>
        <published type="boolean">true</published>
      </product>
    </products>
  </order>
</order>
To get a order JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "contact_id": 5416596,
    "created_at": "2024-04-24T13:57:33.623-04:00",
    "grand_total": 4100.0,
    "id": 33,
    "order_date": "2024-04-24T13:57:33.623-04:00",
    "order_status": "Processed",
    "original_order_id": "21",
    "campaign_id": "98223",
    "coupon_code": "DISCOUNT-50",
    "updated_at": "2024-04-24T13:57:33.623-04:00",
    "source_name": "test",
    "source_type": "test_type",
    "order_items": [
      {
        "contact_id": 5416596,
        "price": 1100.0,
        "quantity": 3,
        "total": 3300.0,
        "item_id": 35
      },
      {
        "contact_id": 5416596,
        "price": 800.0,
        "quantity": 1,
        "total": 800.0,
        "item_id": 36
      }
    ],
    "products": [
      {
        "description": "Product1 ",
        "item_id": "35",
        "adcode": "Xyrsty",
        "category": "xyz",
        "name": "test",
        "image_url": "https://product_image/example.com",
        "store_url": "https://product_page/example.com",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      },
      {
        "description": "Product2",
        "item_id": "36",
        "adcode": "Xyrsty",
        "category": "abc",
        "name": "test1",
        "image_url": "https://product2_image/example.com",
        "store_url": "https://product2_page/example.com",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      }
    ]
  },
  {
    "account_id": 1,
    "contact_id": 5416597,
    "created_at": "2024-04-24T13:57:33.623-04:00",
    "grand_total": 4200.0,
    "id": 34,
    "order_date": "2024-04-24T13:57:33.623-04:00",
    "order_status": "Processed",
    "original_order_id": "22",
    "campaign_id": "98224",
    "coupon_code": "DISCOUNT-60",
    "updated_at": "2024-04-24T13:57:33.623-04:00",
    "source_name": "test",
    "source_type": "test_type",
    "order_items": [
      {
        "contact_id": 5416597,
        "price": 1200.0,
        "quantity": 3,
        "total": 3600.0,
        "item_id": 36
      },
      {
        "contact_id": 5416597,
        "price": 900.0,
        "quantity": 1,
        "total": 900.0,
        "item_id": 37
      }
    ],
    "products": [
      {
        "description": "Product1 ",
        "item_id": "36",
        "adcode": "Xyrstz",
        "category": "xyz",
        "name": "test",
        "image_url": "https://product3_image/example.com",
        "store_url": "https://product3_page/example.com",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      },
      {
        "description": "Product2",
        "item_id": "36",
        "adcode": "Xyrsty",
        "category": "abc",
        "name": "test1",
        "image_url": "https://product4_image/example.com",
        "store_url": "https://product4_page/example.com",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      }
    ]
  }
]
POST https://api.maropost.com/accounts/:account_id/orders(.:format)
orders#create


POST https://api.maropost.com/accounts/:account_id/orders(.:format)?unique=true

(Create an order with unique original_order_id for a contact, "it wont allow you to create multiple orders with same original_order_id for a single conatct")
To create a new order using XML as the input data format, you would make a HTTP POST request:
<order>
  <contact>
    <email>test@yahoo.com</email>
    <first-name>test</first-name>
    <last-name>test1</last-name>
  </contact>
  <custom-field>
    <country>test</country>
    <gender>male</gender>
  </custom-field>
  <add-tags type="array">
    <add-tag>tag_name</add-tag>
    <add-tag>tag_name</add-tag>
  </add-tags>
  <remove-tags type="array">
    <remove-tag>tag_name</remove-tag>
    <remove-tag>tag_name</remove-tag>
  </remove-tags>
  <uid>abcd</uid>
  <list-ids>12,13</list-ids>
  <order-date>2017-10-13T18:05:24-04:00</order-date>
  <order-status>Processed</order-status>
  <original-order-id>21</original-order-id>
  <grand-total>4100.00</grand-total>
  <campaign-id type="integer">98223</campaign-id>
  <coupon-code>DISCOUNT-50</coupon-code>
  <source-name>test</source-name>
  <source-type>test_type</source-type>
  <order-items type="array">
    <order-item>
      <item-id>SMP-1</item-id>
      <price>1100.00</price>
      <quantity>3</quantity>
      <name>Product1</name>
      <image-url>https://product1_image/example.com</image-url>
      <store-url>https://product1_page/example.com</store-url>
      <description>Product1 Description</description>
      <adcode>Xyrsty</adcode>
      <category>xyz</category>
      <status type="boolean">true</status>
      <availability type="integer">100</availability>
      <brand>john</brand>
      <published type="boolean">true</published>
    </order-item>
    <order-item>
      <item-id>GP-209-BK</item-id>
      <price>800.00</price>
      <quantity>1</quantity>
      <name>Product2</name>
      <image-url>https://product2_image/example.com</image-url>
      <store-url>https://product2_page/example.com</store-url>
      <description>Product2 Description</description>
      <adcode>xYrstuv</adcode>
      <category>abc</category>
      <status type="boolean">true</status>
      <availability type="integer">100</availability>
      <brand>john</brand>
      <published type="boolean">true</published>
    </order-item>
  </order-items>
</order>
(REQUIRED FIELD) => email, order-date, order-status, original-order-id, order-items, source_name, source_type

To create a new order using JSON as the input data format, you would make a HTTP POST request:
{
  "order": {
    "contact": {
      "email": "test@yahoo.com",
      "first_name": "test",
      "last_name": "test1"
    },
    "custom_field": {
      "country": "test",
      "gender": "male"
    },
    "add_tags": [
      "tag_name",
      "tag_name"
    ],
    "remove_tags": [
      "tag_name",
      "tag_name"
    ],
    "uid": "abcd",
    "list_ids": "12,13",
    "order_date": "2017-10-13T18:05:24-04:00",
    "order_status": "Processed",
    "original_order_id": "21",
    "grand_total": "4100.00",
    "campaign_id": 98223,
    "coupon_code": "DISCOUNT-50",
    "source_name": "test",
    "source_type": "test_type",
    "order_items": [
      {
        "item_id": "SMP-1",
        "price": "1100.00",
        "quantity": "3",
        "name": "Product1",
        "image_url": "https://product1_image/example.com",
        "store_url": "https://product1_page/example.com",
        "description": "Product1 Description",
        "adcode": "Xyrsty",
        "category": "xyz",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      },
      {
        "item_id": "GP-209-BK",
        "price": "800.00",
        "quantity": "1",
        "name": "Product2",
        "image_url": "https://product2_image/example.com",
        "store_url": "https://product2_page/example.com",
        "description": "Product2 Description",
        "adcode": "xYrstuv",
        "category": "abc",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      }
    ]
  }
}
(REQUIRED FIELD) => email, order_date, order_status, original_order_id, order_items, source_name, source_type (Default value: "api")

PUT https://api.maropost.com/accounts/:account_id/orders/:original_order_id(.:format)
(Update an existing eCommerce order using unique original_order_id if the details are changed due to a partial return or some other update.)
orders#update


PUT https://api.maropost.com/accounts/:account_id/orders/find(.:format)?where[id]=order_id
(Update an existing eCommerce order using maropost order_id if the details are changed due to a partial return or some other update.)

To update a order using XML as the input data format, you would make a HTTP PUT request:
<order>
  <order-date>2017-10-13T18:05:24-04:00</order-date>
  <order-status>Processed</order-status>
  <campaign-id nil="true"/>
  <coupon-code nil="true"/>
  <order-items type="array">
    <order-item>
      <item-id>7</item-id>
      <price>100.00</price>
      <quantity>3</quantity>
      <description>Ebook</description>
      <adcode>Xyrsty</adcode>
      <category>xyz</category>
      <name>test</name>
      <image-url>https://product_image/example.com</image-url>
      <store-url>https://product_page/example.com</store-url>
      <status type="boolean">true</status>
      <availability type="integer">100</availability>
      <brand>john</brand>
      <published type="boolean">true</published>
    </order-item>
    <order-item>
      <item-id>9</item-id>
      <price>800.00</price>
      <quantity>1</quantity>
      <description>iphone</description>
      <adcode>Xyrsty</adcode>
      <category>xyz</category>
      <name>test1</name>
      <image-url>https://product2_image/example.com</image-url>
      <store-url>https://product2_page/example.com</store-url>
      <status type="boolean">true</status>
      <availability type="integer">100</availability>
      <brand>john</brand>
      <published type="boolean">true</published>
    </order-item>
  </order-items>
</order>
To update a order using JSON as the input data format, you would make a HTTP PUT request:
{
  "order": {
    "order_date": "2017-10-13T18:05:24-04:00",
    "order_status": "Processed",
    "campaign_id": null,
    "coupon_code": null,
    "order_items": [
      {
        "item_id": "7",
        "price": "100.00",
        "quantity": "3",
        "description": "Ebook",
        "adcode": "Xyrsty",
        "category": "xyz",
        "name": "test",
        "image_url": "https://product_image/example.com",
        "store_url": "https://product_page/example.com",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      },
      {
        "item_id": "9",
        "price": "800.00",
        "quantity": "1",
        "description": "iphone",
        "adcode": "Xyrsty",
        "category": "xyz",
        "name": "test1",
        "image_url": "https://product2_image/example.com",
        "store_url": "https://product2_page/example.com",
        "status": true,
        "availability": 100,
        "brand": "john",
        "published": true
      }
    ]
  }
}
DELETE https://api.maropost.com/accounts/:account_id/orders/:original_order_id(.:format)
(Delete complete eCommerce order if the order is cancelled or returned using unique original order id.)
orders#destroy


DELETE https://api.maropost.com/accounts/:account_id/orders/find(.:format)?where[id]=order_id
(Delete complete eCommerce order if the order is cancelled or returned using maropost order id.)

DELETE https://api.maropost.com/accounts/:account_id/orders/:original_order_id(.:format)?product_ids=:product1_id,:product2_id,:product3_id
Delete a single or multiple products from a complete eCommerce order if the product(s) is cancelled or returned using unique original_order_id.
orders#destroy


DELETE https://api.maropost.com/accounts/:account_id/orders/find(.:format)?product_ids=:product1_id,:product2_id,:product3_id&where[id]=order_id
Delete a single or multiple products from a complete eCommerce order if the product(s) is cancelled or returned using maropost order_id.

GET https://api.maropost.com/accounts/:account_id/products(.:format)
products#index

To get a list of products in XML format, you would make a HTTP GET request.
<products type="array">
  <product>
    <account-id type="integer">1</account-id>
    <cart-id>1</cart-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <crm-id nil="true"/>
    <description>Apple Macbook pro 2015 13inch</description>
    <id type="integer">1</id>
    <item-id>Apple Macbook Pro</item-id>
    <adcode>Xyrsty</adcode>
    <category>xyz</category>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <name>Apple Macbook pro</name>
    <price type="integer">700</price>
    <image-url>https://{domain}/image.jpg</image-url>
    <store-url>https://{domain}/product/{id}</store-url>
    <status type="boolean">true</status>
    <availability>100</availability>
    <brand>john</brand>
    <published type="boolean">true</published>
    <categories type="array">
      <category>
        <id type="integer">8</id>
        <name>[Sample] Sub Category</name>
        <ancestry>4</ancestry>
        <source-type>commerce</source-type>
        <source-name>abc.xyz.com.au</source-name>
      </category>
    </categories>
  </product>
  <product>
    <account-id type="integer">1</account-id>
    <cart-id nil="true"/>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <crm-id type="integer">1</crm-id>
    <description>Apple Macbook pro 2012 15inch</description>
    <id type="integer">2</id>
    <item-id>Apple Macbook</item-id>
    <adcode>Xyrsty</adcode>
    <category>xyz</category>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <name>Apple Macbook pro</name>
    <price type="integer">700</price>
    <image-url>https://{domain}/image.jpg</image-url>
    <store-url>https://{domain}/product/{id}</store-url>
    <status type="boolean">true</status>
    <availability>100</availability>
    <brand>john</brand>
    <published type="boolean">true</published>
    <categories type="array">
      <category>
        <id type="integer">4</id>
        <name>tommy</name>
        <ancestry nil="true"/>
        <source-type>commerce</source-type>
        <source-name>abc.xyz.com.au</source-name>
      </category>
    </categories>
  </product>
</products>
To get a list of products in JSON format, you would make a HTTP GET request.
[
  {
    "account_id": 1,
    "cart_id": "1",
    "created_at": "2024-04-24T13:57:33.631-04:00",
    "crm_id": null,
    "description": "Apple Macbook pro 2015 13inch",
    "id": 1,
    "item_id": "Apple Macbook Pro",
    "adcode": "Xyrsty",
    "category": "xyz",
    "updated_at": "2024-04-24T13:57:33.631-04:00",
    "name": "Apple Macbook pro",
    "price": 700,
    "image_url": "https://{domain}/image.jpg",
    "store_url": "https://{domain}/product/{id}",
    "status": true,
    "availability": "100",
    "brand": "john",
    "published": true,
    "categories": [
      {
        "id": 8,
        "name": "[Sample] Sub Category",
        "ancestry": "4",
        "source_type": "commerce",
        "source_name": "abc.xyz.com.au"
      }
    ]
  },
  {
    "account_id": 1,
    "cart_id": null,
    "created_at": "2024-04-24T13:57:33.631-04:00",
    "crm_id": 1,
    "description": "Apple Macbook pro 2012 15inch",
    "id": 2,
    "item_id": "Apple Macbook",
    "adcode": "Xyrsty",
    "category": "xyz",
    "updated_at": "2024-04-24T13:57:33.631-04:00",
    "name": "Apple Macbook pro",
    "price": 700,
    "image_url": "https://{domain}/image.jpg",
    "store_url": "https://{domain}/product/{id}",
    "status": true,
    "availability": "100",
    "brand": "john",
    "published": true,
    "categories": [
      {
        "id": 4,
        "name": "tommy",
        "ancestry": null,
        "source_type": "commerce",
        "source_name": "abc.xyz.com.au"
      }
    ]
  }
]
GET https://api.maropost.com/accounts/:account_id/products/:item_id(.:format)
products#show

To get a product in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<product>
  <account-id type="integer">1</account-id>
  <cart-id>1</cart-id>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <crm-id nil="true"/>
  <description>Apple Macbook pro 2015 13inch</description>
  <id type="integer">1</id>
  <item-id>AppleMacbookPro</item-id>
  <category>xyz</category>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <adcode>abc</adcode>
  <name>Apple Macbook pro</name>
  <price type="integer">700</price>
  <image-url>https://{domain}/image.jpg</image-url>
  <store-url>https://{domain}/product/{id}</store-url>
  <status type="boolean">true</status>
  <availability>100</availability>
  <brand>john</brand>
  <published type="boolean">true</published>
  <categories type="array">
    <category>
      <id type="integer">4</id>
      <name>tommy</name>
      <ancestry nil="true"/>
      <source-type>commerce</source-type>
      <source-name>abc.xyz.com.au</source-name>
    </category>
  </categories>
</product>
To get a product JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 1,
  "cart_id": "1",
  "created_at": "2024-04-24T13:57:33.632-04:00",
  "crm_id": null,
  "description": "Apple Macbook pro 2015 13inch",
  "id": 1,
  "item_id": "AppleMacbookPro",
  "category": "xyz",
  "updated_at": "2024-04-24T13:57:33.632-04:00",
  "adcode": "abc",
  "name": "Apple Macbook pro",
  "price": 700,
  "image_url": "https://{domain}/image.jpg",
  "store_url": "https://{domain}/product/{id}",
  "status": true,
  "availability": "100",
  "brand": "john",
  "published": true,
  "categories": [
    {
      "id": 4,
      "name": "tommy",
      "ancestry": null,
      "source_type": "commerce",
      "source_name": "abc.xyz.com.au"
    }
  ]
}
POST https://api.maropost.com/accounts/:account_id/products(.:format)
products#create

To create a new product using XML as the input data format, you would make a HTTP POST request:
<product>
  <cart-id>1</cart-id>
  <crm-id nil="true"/>
  <description>Apple Macbook pro 2015 13inch</description>
  <item-id>Apple Macbook Pro</item-id>
  <adcode>Xyrsty</adcode>
  <category>xyz</category>
  <name>Apple Macbook pro</name>
  <price type="integer">700</price>
  <image-url>https://{domain}/image.jpg</image-url>
  <store-url>https://{domain}/product/{id}</store-url>
  <status type="boolean">true</status>
  <availability>100</availability>
  <brand>john</brand>
  <published type="boolean">true</published>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
</product>
(REQUIRED FIELD) => item-id

To create a new product using JSON as the input data format, you would make a HTTP POST request:
{
  "product": {
    "cart_id": "1",
    "crm_id": null,
    "description": "Apple Macbook pro 2015 13inch",
    "item_id": "Apple Macbook Pro",
    "adcode": "Xyrsty",
    "category": "xyz",
    "name": "Apple Macbook pro",
    "price": 700,
    "image_url": "https://{domain}/image.jpg",
    "store_url": "https://{domain}/product/{id}",
    "status": true,
    "availability": "100",
    "brand": "john",
    "published": true,
    "created_at": "2024-04-24T13:57:33.633-04:00"
  }
}
(REQUIRED FIELD) => item_id

PUT https://api.maropost.com/accounts/:account_id/products/:product_id(.:format)
(Update a details of a product using product id.)
products#update

To update a product using XML as the input data format, you would make a HTTP PUT request:
<product>
  <cart-id>1</cart-id>
  <crm-id nil="true"/>
  <description>Apple Macbook pro 2015 13inch</description>
  <item-id>Apple Macbook Pro</item-id>
  <adcode>Xyrsty</adcode>
  <category>xyz</category>
  <name>Apple Macbook pro</name>
  <price type="integer">700</price>
  <image-url>https://{domain}/image.jpg</image-url>
  <store-url>https://{domain}/product/{id}</store-url>
  <status type="boolean">true</status>
  <availability>100</availability>
  <brand>john</brand>
  <published type="boolean">true</published>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
</product>
To update a product using JSON as the input data format, you would make a HTTP PUT request:
{
  "product": {
    "cart_id": "1",
    "crm_id": null,
    "description": "Apple Macbook pro 2015 13inch",
    "item_id": "Apple Macbook Pro",
    "adcode": "Xyrsty",
    "category": "xyz",
    "name": "Apple Macbook pro",
    "price": 700,
    "image_url": "https://{domain}/image.jpg",
    "store_url": "https://{domain}/product/{id}",
    "status": true,
    "availability": "100",
    "brand": "john",
    "published": true,
    "updated_at": "2024-04-24T13:57:33.634-04:00"
  }
}
DELETE https://api.maropost.com/accounts/:account_id/products/:product_id(.:format)
(Delete a product with all order items that belong to it using product id.)
products#destroy

Table API's

GET https://api.maropost.com/accounts/:account_id/relational_tables(.:format)
relational_tables#index

To get a list of relational_tables in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<relational-tables type="array">
  <relational-table>
    <account-id type="integer">1</account-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <id type="integer">2</id>
    <name>contacts</name>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <relational-columns type="array">
      <relational-column>
        <account-id type="integer">1</account-id>
        <allow-null type="boolean">true</allow-null>
        <auto-increment nil="true"/>
        <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
        <data-type>integer</data-type>
        <default-value></default-value>
        <field-length nil="true"/>
        <id type="integer">14</id>
        <name>id</name>
        <key>none</key>
        <primary-key type="boolean">true</primary-key>
        <relational-table-id type="integer">2</relational-table-id>
        <sendable type="boolean">false</sendable>
        <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
      </relational-column>
      <relational-column>
        <account-id type="integer">1</account-id>
        <allow-null type="boolean">true</allow-null>
        <auto-increment nil="true"/>
        <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
        <data-type>string</data-type>
        <default-value></default-value>
        <field-length nil="true"/>
        <id type="integer">15</id>
        <key>none</key>
        <name>email</name>
        <primary-key type="boolean">false</primary-key>
        <relational-table-id type="integer">2</relational-table-id>
        <sendable type="boolean">true</sendable>
        <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
      </relational-column>
      <relational-column>
        <account-id type="integer">1</account-id>
        <allow-null type="boolean">true</allow-null>
        <auto-increment nil="true"/>
        <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
        <data-type>string</data-type>
        <default-value></default-value>
        <field-length nil="true"/>
        <id type="integer">16</id>
        <key>none</key>
        <name>first_name</name>
        <primary-key type="boolean">false</primary-key>
        <relational-table-id type="integer">2</relational-table-id>
        <sendable type="boolean">false</sendable>
        <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
      </relational-column>
    </relational-columns>
  </relational-table>
  <relational-table>
    <account-id type="integer">1</account-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <id type="integer">3</id>
    <name>employee</name>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <relational-columns type="array">
      <relational-column>
        <account-id type="integer">1</account-id>
        <allow-null type="boolean">true</allow-null>
        <auto-increment nil="true"/>
        <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
        <data-type>integer</data-type>
        <default-value></default-value>
        <field-length nil="true"/>
        <id type="integer">18</id>
        <key>none</key>
        <name>id</name>
        <primary-key type="boolean">true</primary-key>
        <relational-table-id type="integer">3</relational-table-id>
        <sendable type="boolean">false</sendable>
        <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
      </relational-column>
      <relational-column>
        <account-id type="integer">1</account-id>
        <allow-null type="boolean">true</allow-null>
        <auto-increment nil="true"/>
        <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
        <data-type>string</data-type>
        <default-value></default-value>
        <field-length nil="true"/>
        <id type="integer">19</id>
        <key>none</key>
        <name>email</name>
        <primary-key type="boolean">false</primary-key>
        <relational-table-id type="integer">3</relational-table-id>
        <sendable type="boolean">true</sendable>
        <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
      </relational-column>
    </relational-columns>
  </relational-table>
</relational-tables>
To get a list of relational_tables in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 1,
    "created_at": "2024-04-24T13:57:33.637-04:00",
    "id": 2,
    "name": "contacts",
    "updated_at": "2024-04-24T13:57:33.637-04:00",
    "relational_columns": [
      {
        "account_id": 1,
        "allow_null": true,
        "auto_increment": null,
        "created_at": "2024-04-24T13:57:33.637-04:00",
        "data_type": "integer",
        "default_value": "",
        "field_length": null,
        "id": 14,
        "name": "id",
        "key": "none",
        "primary_key": true,
        "relational_table_id": 2,
        "sendable": false,
        "updated_at": "2024-04-24T13:57:33.637-04:00"
      },
      {
        "account_id": 1,
        "allow_null": true,
        "auto_increment": null,
        "created_at": "2024-04-24T13:57:33.637-04:00",
        "data_type": "string",
        "default_value": "",
        "field_length": null,
        "id": 15,
        "key": "none",
        "name": "email",
        "primary_key": false,
        "relational_table_id": 2,
        "sendable": true,
        "updated_at": "2024-04-24T13:57:33.637-04:00"
      },
      {
        "account_id": 1,
        "allow_null": true,
        "auto_increment": null,
        "created_at": "2024-04-24T13:57:33.637-04:00",
        "data_type": "string",
        "default_value": "",
        "field_length": null,
        "id": 16,
        "key": "none",
        "name": "first_name",
        "primary_key": false,
        "relational_table_id": 2,
        "sendable": false,
        "updated_at": "2024-04-24T13:57:33.637-04:00"
      }
    ]
  },
  {
    "account_id": 1,
    "created_at": "2024-04-24T13:57:33.637-04:00",
    "id": 3,
    "name": "employee",
    "updated_at": "2024-04-24T13:57:33.637-04:00",
    "relational_columns": [
      {
        "account_id": 1,
        "allow_null": true,
        "auto_increment": null,
        "created_at": "2024-04-24T13:57:33.637-04:00",
        "data_type": "integer",
        "default_value": "",
        "field_length": null,
        "id": 18,
        "key": "none",
        "name": "id",
        "primary_key": true,
        "relational_table_id": 3,
        "sendable": false,
        "updated_at": "2024-04-24T13:57:33.637-04:00"
      },
      {
        "account_id": 1,
        "allow_null": true,
        "auto_increment": null,
        "created_at": "2024-04-24T13:57:33.637-04:00",
        "data_type": "string",
        "default_value": "",
        "field_length": null,
        "id": 19,
        "key": "none",
        "name": "email",
        "primary_key": false,
        "relational_table_id": 3,
        "sendable": true,
        "updated_at": "2024-04-24T13:57:33.637-04:00"
      }
    ]
  }
]
POST https://api.maropost.com/accounts/:account_id/relational_tables(.:format)
relational_tables#create

To create a table using XML as the input data format, you would make a HTTP POST request:
<relational-table>
  <name> test </name>
  <relational-columns-attributes type="array">
    <relational-columns-attribute>
      <name>id</name>
      <key>none</key>
      <data-type>integer</data-type>
      <primary-key type="boolean">true</primary-key>
      <field-length type="integer">12</field-length>
      <auto-increment type="boolean">true</auto-increment>
      <allow-null type="boolean">true</allow-null>
    </relational-columns-attribute>
    <relational-columns-attribute>
      <name>email</name>
      <key>unique</key>
      <data-type>email</data-type>
      <field-length type="integer">110</field-length>
      <auto-increment type="boolean">false</auto-increment>
      <allow-null type="boolean">true</allow-null>
      <sendable type="boolean">true</sendable>
    </relational-columns-attribute>
  </relational-columns-attributes>
</relational-table>
To create a table using JSON as the input data format, you would make a HTTP POST request:
{
  "relational_table": {
    "name": " test ",
    "relational_columns_attributes": [
      {
        "name": "id",
        "key": "none",
        "data_type": "integer",
        "primary_key": true,
        "field_length": 12,
        "auto_increment": true,
        "allow_null": true
      },
      {
        "name": "email",
        "key": "unique",
        "data_type": "email",
        "field_length": 110,
        "auto_increment": false,
        "allow_null": true,
        "sendable": true
      }
    ]
  }
}
GET https://api.maropost.com/accounts/:account_id/relational_tables/:id(.:format)
relational_tables#show

To get a table in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<relational-table>
  <account-id type="integer">1</account-id>
  <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
  <id type="integer">2</id>
  <name>contacts</name>
  <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  <relational-columns type="array">
    <relational-column>
      <account-id type="integer">1</account-id>
      <allow-null type="boolean">true</allow-null>
      <auto-increment nil="true"/>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <data-type>integer</data-type>
      <default-value></default-value>
      <field-length nil="true"/>
      <id type="integer">14</id>
      <key>none</key>
      <name>id</name>
      <primary-key type="boolean">true</primary-key>
      <relational-table-id type="integer">2</relational-table-id>
      <sendable type="boolean">false</sendable>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </relational-column>
    <relational-column>
      <account-id type="integer">1</account-id>
      <allow-null type="boolean">true</allow-null>
      <auto-increment nil="true"/>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <data-type>string</data-type>
      <default-value></default-value>
      <field-length nil="true"/>
      <id type="integer">15</id>
      <key>none</key>
      <name>email</name>
      <primary-key type="boolean">false</primary-key>
      <relational-table-id type="integer">2</relational-table-id>
      <sendable type="boolean">true</sendable>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </relational-column>
    <relational-column>
      <account-id type="integer">1</account-id>
      <allow-null type="boolean">true</allow-null>
      <auto-increment nil="true"/>
      <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
      <data-type>string</data-type>
      <default-value></default-value>
      <field-length nil="true"/>
      <id type="integer">16</id>
      <key>none</key>
      <name>first_name</name>
      <primary-key type="boolean">false</primary-key>
      <relational-table-id type="integer">2</relational-table-id>
      <sendable type="boolean">false</sendable>
      <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    </relational-column>
  </relational-columns>
</relational-table>
To get a table in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
{
  "account_id": 1,
  "created_at": "2024-04-24T13:57:33.640-04:00",
  "id": 2,
  "name": "contacts",
  "updated_at": "2024-04-24T13:57:33.640-04:00",
  "relational_columns": [
    {
      "account_id": 1,
      "allow_null": true,
      "auto_increment": null,
      "created_at": "2024-04-24T13:57:33.640-04:00",
      "data_type": "integer",
      "default_value": "",
      "field_length": null,
      "id": 14,
      "key": "none",
      "name": "id",
      "primary_key": true,
      "relational_table_id": 2,
      "sendable": false,
      "updated_at": "2024-04-24T13:57:33.640-04:00"
    },
    {
      "account_id": 1,
      "allow_null": true,
      "auto_increment": null,
      "created_at": "2024-04-24T13:57:33.640-04:00",
      "data_type": "string",
      "default_value": "",
      "field_length": null,
      "id": 15,
      "key": "none",
      "name": "email",
      "primary_key": false,
      "relational_table_id": 2,
      "sendable": true,
      "updated_at": "2024-04-24T13:57:33.640-04:00"
    },
    {
      "account_id": 1,
      "allow_null": true,
      "auto_increment": null,
      "created_at": "2024-04-24T13:57:33.640-04:00",
      "data_type": "string",
      "default_value": "",
      "field_length": null,
      "id": 16,
      "key": "none",
      "name": "first_name",
      "primary_key": false,
      "relational_table_id": 2,
      "sendable": false,
      "updated_at": "2024-04-24T13:57:33.640-04:00"
    }
  ]
}
PUT https://api.maropost.com/accounts/:account_id/relational_tables/:id(.:format)
relational_tables#update

To update a table using XML as the input data format, you would make a HTTP PUT request:
<relational-table>
  <name> test </name>
  <relational-columns-attributes type="array">
    <relational-columns-attribute>
      <name>id</name>
      <key>none</key>
      <data-type>integer</data-type>
      <primary-key type="boolean">true</primary-key>
      <field-length type="integer">12</field-length>
      <auto-increment type="boolean">true</auto-increment>
      <allow-null type="boolean">true</allow-null>
    </relational-columns-attribute>
    <relational-columns-attribute>
      <name>email</name>
      <key>unique</key>
      <data-type>email</data-type>
      <field-length type="integer">110</field-length>
      <auto-increment type="boolean">false</auto-increment>
      <allow-null type="boolean">true</allow-null>
      <sendable type="boolean">true</sendable>
    </relational-columns-attribute>
  </relational-columns-attributes>
</relational-table>
To update a table using JSON as the input data format, you would make a HTTP PUT request:
{
  "relational_table": {
    "name": " test ",
    "relational_columns_attributes": [
      {
        "name": "id",
        "key": "none",
        "data_type": "integer",
        "primary_key": true,
        "field_length": 12,
        "auto_increment": true,
        "allow_null": true
      },
      {
        "name": "email",
        "key": "unique",
        "data_type": "email",
        "field_length": 110,
        "auto_increment": false,
        "allow_null": true,
        "sendable": true
      }
    ]
  }
}
DELETE https://api.maropost.com/accounts/:account_id/relational_tables/:id(.:format)
(Delete table and records.)
relational_tables#destroy

GET https://api.maropost.com/accounts/:account_id/relational_tables/:id/truncate(.:format)
(Delete the records of table.)
relational_tables#truncate

SMS API's

POST https://api.maropost.com/accounts/:account_id/sms_lists(.:format)
sms_lists#create

To create a sms list using XML as the input data format, you would make a HTTP POST request using the xml extension.
<sms-list>
  <name>Demo List</name>
</sms-list>
To create a sms list using JSON as the input data format, you would make a HTTP POST request using the json extension.
{
  "sms_list": {
    "name": "Demo List"
  }
}

(REQUIRED FIELD) => name

POST https://api.maropost.com/accounts/:account_id/sms_lists/:sms_list_id/sms_contacts(.:format)
sms_contacts#create

To create a new sms_contact using XML as the input data format, you would make a HTTP POST request using the xml extension.
<hash>
  <sms-contact>
    <phone-number>1234567890</phone-number>
  </sms-contact>
  <sms-subscription>
    <active>true</active>
  </sms-subscription>
</hash>
To create a new contact using JSON as the input data format, you would make a HTTP POST request using the json extension.
{
  "sms_contact": {
    "phone_number": "1234567890"
  },
  "sms_subscription": {
    "active": "true"
  }
}

(REQUIRED FIELD) => phone_number,sms_subscription

POST https://api.maropost.com/accounts/:account_id/sms_contacts/upsert(.:format)
sms_contacts#upsert

To create a new or update an existing sms_contact using XML as the input data format, you would make a HTTP POST request using the xml extension.
<sms-contact>
  <uid>12345</uid>
  <phone-number>1234567890</phone-number>
  <remove-from-sms-dnm>false</remove-from-sms-dnm>
  <sms-lists type="array">
    <sms-list>6</sms-list>
    <sms-list>7</sms-list>
  </sms-lists>
</sms-contact>
To create a new or update an existing sms_contact using JSON as the input data format, you would make a HTTP POST request using the json extension.
{
  "sms_contact": {
    "uid": "12345",
    "phone_number": "1234567890",
    "remove_from_sms_dnm": "false",
    "sms_lists": [
      "6",
      "7"
    ]
  }
}

(REQUIRED FIELD) => phone_number

Post https://api.maropost.com/accounts/:account_id/sms_campaigns(.:format)
sms_campaigns#create

To schedule a sms_campaign in XML format, you would make a HTTP Post request using the xml extension
<hash>
  <sms-campaign>
    <name>SMS Campaign Final</name>
    <message>Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...</message>
    <phone-number>1234567891</phone-number>
  </sms-campaign>
  <contact-tags type="array">
    <contact-tag>tag_name</contact-tag>
    <contact-tag>tag_name</contact-tag>
  </contact-tags>
  <sms-message>
    <send-at>once</send-at>
  </sms-message>
  <commit>Send Test</commit>
</hash>
To schedule a sms_campaign in Json format, you would make a HTTP Post request using the json extension
{
  "sms_campaign": {
    "name": "SMS Campaign Final",
    "message": "Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...",
    "phone_number": "1234567891"
  },
  "contact tags": [
    "tag_name",
    "tag_name"
  ],
  "sms_message": {
    "send_at": "once"
  },
  "commit": "Send Test"
}
To schedule a sms_campaign in XML format, you would make a HTTP Post request using the xml extension
<hash>
  <sms-campaign>
    <name>SMS Campaign Final</name>
    <message>Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...</message>
    <from-number>1234567891</from-number>
  </sms-campaign>
  <contact-tags type="array">
    <contact-tag>tag_name</contact-tag>
    <contact-tag>tag_name</contact-tag>
  </contact-tags>
  <sms-lists type="array">
    <sms-list>6</sms-list>
    <sms-list>7</sms-list>
  </sms-lists>
  <sms-message>
    <send-at>once</send-at>
  </sms-message>
  <commit>Save as Draft</commit>
</hash>
To schedule a sms_campaign in Json format, you would make a HTTP Post request using the json extension
{
  "sms_campaign": {
    "name": "SMS Campaign Final",
    "message": "Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...",
    "from_number": "1234567891"
  },
  "contact tags": [
    "tag_name",
    "tag_name"
  ],
  "sms_lists": [
    "6",
    "7"
  ],
  "sms_message": {
    "send_at": "once"
  },
  "commit": "Save as Draft"
}
To schedule a sms_campaign in XML format, you would make a HTTP Post request using the xml extension
<hash>
  <sms-campaign>
    <name>SMS Campaign Final</name>
    <message>Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...</message>
    <from-number>1234567891</from-number>
  </sms-campaign>
  <contact-tags type="array">
    <contact-tag>tag_name</contact-tag>
    <contact-tag>tag_name</contact-tag>
  </contact-tags>
  <sms-lists type="array">
    <sms-list>6</sms-list>
    <sms-list>7</sms-list>
  </sms-lists>
  <commit>Send Now</commit>
</hash>
To schedule a sms_campaign in Json format, you would make a HTTP Post request using the json extension
{
  "sms_campaign": {
    "name": "SMS Campaign Final",
    "message": "Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...",
    "from_number": "1234567891"
  },
  "contact tags": [
    "tag_name",
    "tag_name"
  ],
  "sms_lists": [
    "6",
    "7"
  ],
  "commit": "Send Now"
}
To schedule a sms_campaign in XML format, you would make a HTTP Post request using the xml extension
<hash>
  <sms-campaign>
    <name>SMS Campaign Final</name>
    <message>Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...</message>
    <from-number>1234567891</from-number>
    <send-at>2020-02-07 6:30:00</send-at>
  </sms-campaign>
  <contact-tags type="array">
    <contact-tag>tag_name</contact-tag>
    <contact-tag>tag_name</contact-tag>
  </contact-tags>
  <sms-lists type="array">
    <sms-list>6</sms-list>
    <sms-list>7</sms-list>
  </sms-lists>
  <sms-message>
    <send-at>once</send-at>
  </sms-message>
  <commit>Schedule</commit>
</hash>
To schedule a sms_campaign in Json format, you would make a HTTP Post request using the json extension
{
  "sms_campaign": {
    "name": "SMS Campaign Final",
    "message": "Hey {{contact.phone}}, Click stop|cancel|unsubscribe to unsubscribe from sms campaign lists or stop all to add in sms DNM...",
    "from_number": "1234567891",
    "send_at": "2020-02-07 6:30:00"
  },
  "contact tags": [
    "tag_name",
    "tag_name"
  ],
  "sms_lists": [
    "6",
    "7"
  ],
  "sms_message": {
    "send_at": "once"
  },
  "commit": "Schedule"
}

Transactional API's

GET https://api.maropost.com/accounts/:account_id/transactional_campaigns(.:format)
transactional_campaigns#index

To get a list of transactional campaigns in XML format, you would make a HTTP GET request using the xml extension. You'll receive a response in XML format similar to the following:
<campaigns type="array">
  <campaign>
    <account-id type="integer">4</account-id>
    <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
    <campaign-group-id nil="true"/>
    <campaign-type type="integer">1</campaign-type>
    <contacts-count type="integer">15</contacts-count>
    <content-history-id nil="true"/>
    <content-id type="integer">43060</content-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <decided-by nil="true"/>
    <email-preview-link type="boolean">true</email-preview-link>
    <from-email>test@maropost.com</from-email>
    <from-name>rohit test</from-name>
    <id type="integer">100880</id>
    <language>en</language>
    <list-id nil="true"/>
    <name>test campaign</name>
    <parent-id nil="true"/>
    <recurring nil="true"/>
    <recurring-time nil="true"/>
    <reply-to>test@maropost.com</reply-to>
    <segment-id nil="true"/>
    <send-at nil="true"/>
    <send-optimization type="boolean">false</send-optimization>
    <sent-at nil="true"/>
    <status>draft</status>
    <subject>spam</subject>
    <suppress-workflow type="boolean">false</suppress-workflow>
    <test-campaign type="boolean">false</test-campaign>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <version-number nil="true"/>
    <winner-campaign-id nil="true"/>
  </campaign>
  <campaign>
    <account-id type="integer">4</account-id>
    <address>552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada</address>
    <campaign-group-id nil="true"/>
    <campaign-type type="integer">1</campaign-type>
    <contacts-count type="integer">2</contacts-count>
    <content-history-id nil="true"/>
    <content-id type="integer">42325</content-id>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <decided-by nil="true"/>
    <email-preview-link type="boolean">true</email-preview-link>
    <from-email>test@maropost.com</from-email>
    <from-name>hi</from-name>
    <id type="integer">100913</id>
    <language>es</language>
    <list-id nil="true"/>
    <name>RV2</name>
    <parent-id nil="true"/>
    <recurring nil="true"/>
    <recurring-time nil="true"/>
    <reply-to>test@maropost.com</reply-to>
    <segment-id nil="true"/>
    <send-at nil="true"/>
    <send-optimization type="boolean">false</send-optimization>
    <sent-at nil="true"/>
    <status>workflow</status>
    <subject>hi</subject>
    <suppress-workflow type="boolean">false</suppress-workflow>
    <test-campaign type="boolean">false</test-campaign>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <version-number nil="true"/>
    <winner-campaign-id nil="true"/>
  </campaign>
</campaigns>
To get a list of transactional campaigns in JSON format, you would make a HTTP GET request using the json extension. You'll receive a response in JSON format similar to the following:
[
  {
    "account_id": 4,
    "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
    "campaign_group_id": null,
    "campaign_type": 1,
    "contacts_count": 15,
    "content_history_id": null,
    "content_id": 43060,
    "created_at": "2024-04-24T13:57:33.647-04:00",
    "decided_by": null,
    "email_preview_link": true,
    "from_email": "test@maropost.com",
    "from_name": "rohit test",
    "id": 100880,
    "language": "en",
    "list_id": null,
    "name": "test campaign",
    "parent_id": null,
    "recurring": null,
    "recurring_time": null,
    "reply_to": "test@maropost.com",
    "segment_id": null,
    "send_at": null,
    "send_optimization": false,
    "sent_at": null,
    "status": "draft",
    "subject": "spam",
    "suppress_workflow": false,
    "test_campaign": false,
    "updated_at": "2024-04-24T13:57:33.647-04:00",
    "version_number": null,
    "winner_campaign_id": null
  },
  {
    "account_id": 4,
    "address": "552 Wellington St. West Suite 1103, Toronto, ON, M5V2V5, Canada",
    "campaign_group_id": null,
    "campaign_type": 1,
    "contacts_count": 2,
    "content_history_id": null,
    "content_id": 42325,
    "created_at": "2024-04-24T13:57:33.647-04:00",
    "decided_by": null,
    "email_preview_link": true,
    "from_email": "test@maropost.com",
    "from_name": "hi",
    "id": 100913,
    "language": "es",
    "list_id": null,
    "name": "RV2",
    "parent_id": null,
    "recurring": null,
    "recurring_time": null,
    "reply_to": "test@maropost.com",
    "segment_id": null,
    "send_at": null,
    "send_optimization": false,
    "sent_at": null,
    "status": "workflow",
    "subject": "hi",
    "suppress_workflow": false,
    "test_campaign": false,
    "updated_at": "2024-04-24T13:57:33.647-04:00",
    "version_number": null,
    "winner_campaign_id": null
  }
]
POST https://api.maropost.com/accounts/:account_id/transactional_campaigns(.:format)
transactional_campaigns#create

To create a transactional campaign using XML as the input data format, you would make a HTTP POST request:
<campaign>
  <name>Campaign Final</name>
  <subject>Testing</subject>
  <preheader>Preheader Testing</preheader>
  <from-name>Test</from-name>
  <from-email>test@gmail.com</from-email>
  <reply-to>test@gmail.com</reply-to>
  <content-id>162</content-id>
  <email-preview-link type="boolean">true</email-preview-link>
  <address>Canada </address>
  <language>en</language>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</campaign>
To create a transactional campaign JSON as the input data format, you would make a HTTP POST request:
{
  "campaign": {
    "name": "Campaign Final",
    "subject": "Testing",
    "preheader": "Preheader Testing",
    "from_name": "Test",
    "from_email": "test@gmail.com",
    "reply_to": "test@gmail.com",
    "content_id": "162",
    "email_preview_link": true,
    "address": "Canada ",
    "language": "en",
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
POST https://api.maropost.com/accounts/:account_id/emails/deliver(.:format)
emails#deliver

To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call). Contact block in the api call is the Recipient's information while Sender's information will be automatically fetched from transactional campaign.You can use the tags in the call which will be explained under "with tags" menu.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call). Here you can pass the content_id. while sending email, transactional campaign's content will be replaced by this new content which is passed in the below call. Contact block in the api call is the Recipient's information while Sender's information will be automatically fetched from transactional campaign.You can use the tags in the call which will be explained under "with tags" menu.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <content-id type="integer">150</content-id>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "content_id": 150,
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call). Here you can pass the content body. while sending email, transactional campaign's content will be replaced by this new content which is passed in the below call. Contact block in the api call is the Recipient's information while Sender's information will be automatically fetched from transactional campaign.You can use the tags in the call which will be explained under "with tags" menu.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <content>
    <name>test content</name>
    <html-part>Html Part of content</html-part>
    <text-part>Text Part of content</text-part>
  </content>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "content": {
      "name": "test content",
      "html_part": "Html Part of content",
      "text_part": "Text Part of content"
    },
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call). Here you can pass the sender's information. while sending email, sender's information in transactional campaign will be replaced by this new sender's information which is passed in the below call. You can use the tags in the call which will be explained under "with tags" menu.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <content-id type="integer">150</content-id>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <from-name>test</from-name>
  <from-email>test@maropost.com</from-email>
  <subject>testing</subject>
  <reply-to>test@maropost.com</reply-to>
  <address>Canada</address>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "content_id": 150,
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "from_name": "test",
    "from_email": "test@maropost.com",
    "subject": "testing",
    "reply_to": "test@maropost.com",
    "address": "Canada",
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call). Here you can pass contact id. while sending email, sender's information in transactional campaign will be fetched from contact id which is passed in the below call. You can use the tags in the call which will be explained under "with tags" menu.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <contact-id type="integer">9867830</contact-id>
  <tags>
    <IS-ERROR-MESSAGE type="integer">0</IS-ERROR-MESSAGE>
    <ORDER-ID type="integer">23456789</ORDER-ID>
    <INVOICE-ID type="integer">222333444</INVOICE-ID>
  </tags>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "contact_id": 9867830,
    "tags": {
      "IS_ERROR_MESSAGE": 0,
      "ORDER_ID": 23456789,
      "INVOICE_ID": 222333444
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call). Here you can pass the tags. You can create tags in the content like this {{tag.tag_name}} eg: {{tag.IS_ERROR_MESSAGE}}, {{tag.ORDER_ID}}.
You can aslo use conditional values(if/else) in content like this: {% if contact.first_name == 'john' %} HEY JOHN {% else %} HEY FRIEND {% endif %}
<email>
  <campaign-id type="integer">9298</campaign-id>
  <content-id type="integer">150</content-id>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <from-name>test@maropost.com</from-name>
  <from-email>Test</from-email>
  <subject>testing</subject>
  <reply-to>test@maropost.com</reply-to>
  <tags>
    <IS-ERROR-MESSAGE type="integer">0</IS-ERROR-MESSAGE>
    <ORDER-ID type="integer">23456789</ORDER-ID>
    <INVOICE-ID type="integer">222333444</INVOICE-ID>
  </tags>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "content_id": 150,
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "from_name": "test@maropost.com",
    "from_email": "Test",
    "subject": "testing",
    "reply_to": "test@maropost.com",
    "tags": {
      "IS_ERROR_MESSAGE": 0,
      "ORDER_ID": 23456789,
      "INVOICE_ID": 222333444
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call).

To schedule a email at any set time, If the time set is less than the current time then email will go out on next day.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <content-id type="integer">150</content-id>
  <send-time>
    <hour>06</hour>
    <minute>30</minute>
  </send-time>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "content_id": 150,
    "send_time": {
      "hour": "06",
      "minute": "30"
    },
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send a email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call).
* You can only pass single email address in bcc tag.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <bcc>test@maropost.com</bcc>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "bcc": "test@maropost.com",
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send an email using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call).
* To ignore Do Not Mail list for a contact you have to pass tag as below
<email>
  <campaign-id type="integer">9298</campaign-id>
  <ignore-dnm>true</ignore-dnm>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "ignore_dnm": "true",
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
To send an email using content from structured data , using XML as the input data format, you would make a HTTP POST request:

* You need to create transactional campaign under campaign new page or via API (see above api call).
* You need to create Content Feeds. Then you can select structured data from Content Feed library to be inserted into email content.
* New option is added under content create page "Advanced", under which you can select content feed that you have created earlier.
* Check Documentaion under user guides under content tab.
<email>
  <campaign-id type="integer">9298</campaign-id>
  <contact>
    <email>test@maropost.com</email>
    <first-name>Test</first-name>
    <last-name>Test2</last-name>
    <custom-field>
      <city>Canada</city>
    </custom-field>
  </contact>
  <add-ctags type="array">
    <add-ctag>ctag_name1</add-ctag>
    <add-ctag>ctag_name2</add-ctag>
  </add-ctags>
</email>
To send a email using content from structured data, using JSON as the input data format, you would make a HTTP POST request:
{
  "email": {
    "campaign_id": 9298,
    "contact": {
      "email": "test@maropost.com",
      "first_name": "Test",
      "last_name": "Test2",
      "custom_field": {
        "city": "Canada"
      }
    },
    "add_ctags": [
      "ctag_name1",
      "ctag_name2"
    ]
  }
}
SMTP

To send an email using SMTP, you would make a SMTP request:

* You need to connect with SMTP Server with following settings:
  • SMTP Server: smtp.maropost.com
  • Port: 587
* You need to tell us your injection ip (i.e from where you will connect to smtp.maropost.com) so that we can whitelist it.
* Required headers in email body.
  • From = test@maropost.com
  • To = test@maropost.com
  • X-ApiKey = 123cxjhc33scfsdhjfs7
  • X-CampaignID = 9298
  • X-CampaignName = Test Campaign
  • X-AccountID = 4

Push Notifications API

GET https://api.maropost.com/accounts/:account_id/push_applications(.:format)
push_applications#index

To get list of push applications using XML as the input data format, you would make an HTTP GET request:
<applications type="array">
  <application>
    <name>My Push App</name>
    <environment>sandbox</environment>
    <content-image-url>https://cdn-m4m.chd01.com/logo/icon-60_2x.png</content-image-url>
    <ios-data>
      <ios-cert-passphrase>password</ios-cert-passphrase>
      <ios-bundle-identifier>com.your-company.your-app</ios-bundle-identifier>
    </ios-data>
    <android-data>
      <api-key>xxxxxxxxxxxxxxxxxxxxxxxxx</api-key>
      <package-name>com.your-company.your-app</package-name>
    </android-data>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </application>
</applications>
To get list of push applications using JSON as the input data format, you would make an HTTP GET request:
[
  {
    "name": "My Push App",
    "environment": "sandbox",
    "content_image_url": "https://cdn-m4m.chd01.com/logo/icon-60_2x.png",
    "ios_data": {
      "ios_cert_passphrase": "password",
      "ios_bundle_identifier": "com.your-company.your-app"
    },
    "android_data": {
      "api_key": "xxxxxxxxxxxxxxxxxxxxxxxxx",
      "package_name": "com.your-company.your-app"
    },
    "created_at": "2024-04-24T13:57:33.657-04:00",
    "updated_at": "2024-04-24T13:57:33.657-04:00"
  }
]
POST https://api.maropost.com/accounts/:account_id/push_applications(.:format)
push_applications#create

To create a push application using XML as the input data format, you would make an HTTP POST request:
<push-application>
  <name>My Push App</name>
  <environment>sandbox</environment>
  <content-image-url>https://cdn-m4m.chd01.com/logo/icon-60_2x.png</content-image-url>
  <ios-data>
    <ios-cert-passphrase>password</ios-cert-passphrase>
    <ios-bundle-identifier>com.your-company.your-app</ios-bundle-identifier>
  </ios-data>
  <android-data>
    <api-key>xxxxxxxxxxxxxxxxxxxxxxxxx</api-key>
    <package-name>com.your-company.your-app</package-name>
  </android-data>
</push-application>
To create a push application using JSON as the input data format, you would make an HTTP POST request:
{
  "push_application": {
    "name": "My Push App",
    "environment": "sandbox",
    "content_image_url": "https://cdn-m4m.chd01.com/logo/icon-60_2x.png",
    "ios_data": {
      "ios_cert_passphrase": "password",
      "ios_bundle_identifier": "com.your-company.your-app"
    },
    "android_data": {
      "api_key": "xxxxxxxxxxxxxxxxxxxxxxxxx",
      "package_name": "com.your-company.your-app"
    }
  }
}

* Allowed values for environment: 'sandbox' or 'production'
PUT https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id(.:format)
push_applications#update

To update a push application using XML as the input data format, you would make an HTTP PUT request:
<push-application>
  <name>My Push App</name>
  <environment>sandbox</environment>
  <content-image-url>https://cdn-m4m.chd01.com/logo/icon-60_2x.png</content-image-url>
  <ios-data>
    <ios-cert-passphrase>password</ios-cert-passphrase>
    <ios-bundle-identifier>com.your-company.your-app</ios-bundle-identifier>
  </ios-data>
  <android-data>
    <api-key>xxxxxxxxxxxxxxxxxxxxxxxxx</api-key>
    <package-name>com.your-company.your-app</package-name>
  </android-data>
</push-application>
To update a push application using JSON as the input data format, you would make an HTTP PUT request:
{
  "push_application": {
    "name": "My Push App",
    "environment": "sandbox",
    "content_image_url": "https://cdn-m4m.chd01.com/logo/icon-60_2x.png",
    "ios_data": {
      "ios_cert_passphrase": "password",
      "ios_bundle_identifier": "com.your-company.your-app"
    },
    "android_data": {
      "api_key": "xxxxxxxxxxxxxxxxxxxxxxxxx",
      "package_name": "com.your-company.your-app"
    }
  }
}
DELETE https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id(.:format)
push_applications#destroy


GET https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)
push_messages#index

To get list of push messages for a push application using XML as the input data format, you would make an HTTP GET request:
<push-messages type="array">
  <push-message>
    <id type="integer">1</id>
    <account-id type="integer">1</account-id>
    <push-application-id type="integer">1</push-application-id>
    <send-to>
      <type>device_tokens</type>
      <ios-tokens>JVHGV7676JV887HJHVH...</ios-tokens>
      <android-tokens></android-tokens>
    </send-to>
    <name>smiley test</name>
    <message>This is what your message will look like ...</message>
    <data>{"acme":["data1","data2"],"acme2":{"acme":"backme"}}</data>
    <badge-count type="integer">1</badge-count>
    <sound>default</sound>
    <image-url>https://cdn-m4m.chd01.com/logo/dev_image.jpeg</image-url>
    <deep-linking-url>myapp://host/destinationPage</deep-linking-url>
    <title>My Title</title>
    <sub-title>My Subtitle</sub-title>
    <send-at>null</send-at>
    <sent-at>null</sent-at>
    <status>draft</status>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </push-message>
</push-messages>
To get list of push messages for a push application using JSON as the input data format, you would make an HTTP GET request:
[
  {
    "id": 1,
    "account_id": 1,
    "push_application_id": 1,
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "JVHGV7676JV887HJHVH...",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "This is what your message will look like ...",
    "data": "{\"acme\":[\"data1\",\"data2\"],\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "image_url": "https://cdn-m4m.chd01.com/logo/dev_image.jpeg",
    "deep_linking_url": "myapp://host/destinationPage",
    "title": "My Title",
    "sub_title": "My Subtitle",
    "send_at": "null",
    "sent_at": "null",
    "status": "draft",
    "created_at": "2024-04-24T13:57:33.659-04:00",
    "updated_at": "2024-04-24T13:57:33.659-04:00"
  }
]
GET https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)?token={:device_token}
push_messages/{:device_token}#index

To get list of push messages for a particular device using XML as the input data format, you would make an HTTP GET request:
<push-messages type="array">
  <push-message>
    <id type="integer">1</id>
    <account-id type="integer">1</account-id>
    <push-application-id type="integer">1</push-application-id>
    <send-to>
      <type>device_tokens</type>
      <ios-tokens>JVHGV7676JV887HJHVH...</ios-tokens>
      <android-tokens></android-tokens>
    </send-to>
    <name>smiley test</name>
    <message>This is what your message will look like ...</message>
    <data>{"acme":["data1","data2"],"acme2":{"acme":"backme"}}</data>
    <badge-count type="integer">1</badge-count>
    <sound>default</sound>
    <image-url>https://cdn-m4m.chd01.com/logo/dev_image.jpeg</image-url>
    <deep-linking-url>myapp://host/destinationPage</deep-linking-url>
    <title>My Title</title>
    <sub-title>My Subtitle</sub-title>
    <send-at>null</send-at>
    <sent-at>null</sent-at>
    <status>draft</status>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
  </push-message>
</push-messages>
To get list of push messages for a particular device using JSON as the input data format, you would make an HTTP GET request:
[
  {
    "id": 1,
    "account_id": 1,
    "push_application_id": 1,
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "JVHGV7676JV887HJHVH...",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "This is what your message will look like ...",
    "data": "{\"acme\":[\"data1\",\"data2\"],\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "image_url": "https://cdn-m4m.chd01.com/logo/dev_image.jpeg",
    "deep_linking_url": "myapp://host/destinationPage",
    "title": "My Title",
    "sub_title": "My Subtitle",
    "send_at": "null",
    "sent_at": "null",
    "status": "draft",
    "created_at": "2024-04-24T13:57:33.660-04:00",
    "updated_at": "2024-04-24T13:57:33.660-04:00"
  }
]
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)
push_messages#create

To create a push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <send-to>
    <type>device_tokens</type>
    <ios-tokens>378FBCD...55133394C, 123FBCD...551XXXY4C</ios-tokens>
    <android-tokens></android-tokens>
  </send-to>
  <name>smiley test</name>
  <message>Morning {{push_device.first_name}}, your news feed for today is ready ...</message>
  <data>{"user_email":"{{push_device.email}}","acme2":{"acme":"backme"}}</data>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <image-url>https://cdn-m4m.chd01.com/logo/dev_image.jpeg</image-url>
  <deep-linking-url>myapp://host/destinationPage</deep-linking-url>
  <title>My Title</title>
  <sub-title>My Subtitle</sub-title>
  <status>draft</status>
</push-message>
To create a push message for a push application using JSON as the input data format, you would make an HTTP POST request:
{
  "push_message": {
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "378FBCD...55133394C, 123FBCD...551XXXY4C",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "Morning {{push_device.first_name}}, your news feed for today is ready ...",
    "data": "{\"user_email\":\"{{push_device.email}}\",\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "image_url": "https://cdn-m4m.chd01.com/logo/dev_image.jpeg",
    "deep_linking_url": "myapp://host/destinationPage",
    "title": "My Title",
    "sub_title": "My Subtitle",
    "status": "draft"
  }
}
* Allowed values for send_to -> type: 'all_devices', 'segment_ids', 'device_tokens' and 'login_ids'.
   -> For segment_ids, send a comma separated string of push segment IDs as an additional parameter named 'segment_ids' inside send_to param.
   -> For login_ids, send a comma separated string of login IDs as a parameter named 'login_ids' inside send_to param.
   -> For device_tokens, send a comma separated string of valid iOS device Tokens as a parameter named 'ios_tokens' and a comma separated string of valid Android registration IDs as a parameter named 'android_tokens' inside send_to param.
* Personalize your message or payload data for individual devices with available fields: {{push_device.first_name}}, {{push_device.last_name}}, {{push_device.login_id}} or {{push_device.email}}
PUT https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages/:push_message_id(.:format)
push_messages#update

To update a push message for a push application using XML as the input data format, you would make an HTTP PUT request:
<push-message>
  <send-to>
    <type>device_tokens</type>
    <ios-tokens>378FBCD...55133394C, 123FBCD...551XXXY4C</ios-tokens>
    <android-tokens></android-tokens>
  </send-to>
  <name>smiley test</name>
  <message>Morning {{push_device.first_name}}, your news feed for today is ready ...</message>
  <data>{"user_email":"{{push_device.email}}","acme2":{"acme":"backme"}}</data>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <image-url>https://cdn-m4m.chd01.com/logo/dev_image.jpeg</image-url>
  <deep-linking-url>myapp://host/destinationPage</deep-linking-url>
  <title>My Title</title>
  <sub-title>My Subtitle</sub-title>
  <status>draft</status>
</push-message>
To update a push message for a push application using JSON as the input data format, you would make an HTTP PUT request:
{
  "push_message": {
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "378FBCD...55133394C, 123FBCD...551XXXY4C",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "Morning {{push_device.first_name}}, your news feed for today is ready ...",
    "data": "{\"user_email\":\"{{push_device.email}}\",\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "image_url": "https://cdn-m4m.chd01.com/logo/dev_image.jpeg",
    "deep_linking_url": "myapp://host/destinationPage",
    "title": "My Title",
    "sub_title": "My Subtitle",
    "status": "draft"
  }
}

POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)
push_messages#create

To create an in-app push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <send-to>
    <type>device_tokens</type>
    <ios-tokens>378FBCD...55133394C, 123FBCD...551XXXY4C</ios-tokens>
    <android-tokens></android-tokens>
  </send-to>
  <name>smiley test</name>
  <message>Morning {{push_device.first_name}}, your news feed for today is ready ...</message>
  <data>{"user_email":"{{push_device.email}}","acme2":{"acme":"backme"}}</data>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <status>draft</status>
  <send-type>2</send-type>
  <in-app-options>
    <primary-color>#333333</primary-color>
    <secondary-color>#eeeeee</secondary-color>
    <position>1</position>
    <duration>5</duration>
    <expiry>1</expiry>
  </in-app-options>
</push-message>
To create an in-app push message in JSON format, you would make a HTTP POST request using the json extension
{
  "push_message": {
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "378FBCD...55133394C, 123FBCD...551XXXY4C",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "Morning {{push_device.first_name}}, your news feed for today is ready ...",
    "data": "{\"user_email\":\"{{push_device.email}}\",\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "status": "draft",
    "send_type": "2",
    "in_app_options": {
      "primary_color": "#333333",
      "secondary_color": "#eeeeee",
      "position": "1",
      "duration": "5",
      "expiry": "1"
    }
  }
}
Extra params required for recurring are send_type and in_app_options
Allowed values for send_type are: 0(Push Only), 1(In-App Only) and 2(Push + In-App)
Allowed values for position inside in_app_options are: 0(Top), 1(Bottom) and 2(Center)
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)
push_messages#create

To create a recurring push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <send-to>
    <type>device_tokens</type>
    <ios-tokens>378FBCD...55133394C, 123FBCD...551XXXY4C</ios-tokens>
    <android-tokens></android-tokens>
  </send-to>
  <name>smiley test</name>
  <message>Morning {{push_device.first_name}}, your news feed for today is ready ...</message>
  <data>{"user_email":"{{push_device.email}}","acme2":{"acme":"backme"}}</data>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <status>recurring</status>
  <send-at>March 31, 2016 01:10 AM</send-at>
  <schedule-type>1</schedule-type>
  <recurring-options>
    <schedule>daily</schedule>
    <hour>02</hour>
    <minute>20</minute>
  </recurring-options>
</push-message>
To create a recurring push message in JSON format, you would make a HTTP POST request using the json extension
{
  "push_message": {
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "378FBCD...55133394C, 123FBCD...551XXXY4C",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "Morning {{push_device.first_name}}, your news feed for today is ready ...",
    "data": "{\"user_email\":\"{{push_device.email}}\",\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "status": "recurring",
    "send_at": "March 31, 2016 01:10 AM",
    "schedule_type": "1",
    "recurring_options": {
      "schedule": "daily",
      "hour": "02",
      "minute": "20"
    }
  }
}
Extra params required for recurring are schedule_type and recurring_options
Allowed values for schedule_type are: 0(Send Once) and 1(Recurring), so send schedule_type: 1 for recurring messages
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)
push_messages#create

To create a recurring push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <send-to>
    <type>device_tokens</type>
    <ios-tokens>378FBCD...55133394C, 123FBCD...551XXXY4C</ios-tokens>
    <android-tokens></android-tokens>
  </send-to>
  <name>smiley test</name>
  <message>Morning {{push_device.first_name}}, your news feed for today is ready ...</message>
  <data>{"user_email":"{{push_device.email}}","acme2":{"acme":"backme"}}</data>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <status>recurring</status>
  <send-at>March 31, 2016 01:10 AM</send-at>
  <schedule-type>1</schedule-type>
  <recurring-options>
    <schedule>weekly</schedule>
    <weekday>4</weekday>
    <hour>02</hour>
    <minute>20</minute>
  </recurring-options>
</push-message>
To create a recurring push message in JSON format, you would make a HTTP POST request using the json extension
{
  "push_message": {
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "378FBCD...55133394C, 123FBCD...551XXXY4C",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "Morning {{push_device.first_name}}, your news feed for today is ready ...",
    "data": "{\"user_email\":\"{{push_device.email}}\",\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "status": "recurring",
    "send_at": "March 31, 2016 01:10 AM",
    "schedule_type": "1",
    "recurring_options": {
      "schedule": "weekly",
      "weekday": "4",
      "hour": "02",
      "minute": "20"
    }
  }
}
Extra params required for recurring are schedule_type and recurring_options
Allowed values for schedule_type are: 0(Send Once) and 1(Recurring), so send schedule_type: 1 for recurring messages
Allowed values for weekday are 0 -> 6, where 0 is for 'Sunday', 1 for 'Monday' ... and 6 for 'Saturday'
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)
push_messages#create

To create a recurring push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <send-to>
    <type>device_tokens</type>
    <ios-tokens>378FBCD...55133394C, 123FBCD...551XXXY4C</ios-tokens>
    <android-tokens></android-tokens>
  </send-to>
  <name>smiley test</name>
  <message>Morning {{push_device.first_name}}, your news feed for today is ready ...</message>
  <data>{"user_email":"{{push_device.email}}","acme2":{"acme":"backme"}}</data>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <status>recurring</status>
  <send-at>March 31, 2016 01:10 AM</send-at>
  <schedule-type>1</schedule-type>
  <recurring-options>
    <schedule>monthly</schedule>
    <day>4</day>
    <hour>02</hour>
    <minute>20</minute>
  </recurring-options>
</push-message>
To create a recurring campaign in JSON format, you would make a HTTP POST request using the json extension
{
  "push_message": {
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "378FBCD...55133394C, 123FBCD...551XXXY4C",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "Morning {{push_device.first_name}}, your news feed for today is ready ...",
    "data": "{\"user_email\":\"{{push_device.email}}\",\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "status": "recurring",
    "send_at": "March 31, 2016 01:10 AM",
    "schedule_type": "1",
    "recurring_options": {
      "schedule": "monthly",
      "day": "4",
      "hour": "02",
      "minute": "20"
    }
  }
}
Extra params required for recurring are schedule_type and recurring_options
Allowed values for schedule_type are: 0(Send Once) and 1(Recurring), so send schedule_type: 1 for recurring messages
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_messages(.:format)
push_messages#create

To create a recurring push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <send-to>
    <type>device_tokens</type>
    <ios-tokens>378FBCD...55133394C, 123FBCD...551XXXY4C</ios-tokens>
    <android-tokens></android-tokens>
  </send-to>
  <name>smiley test</name>
  <message>Morning {{push_device.first_name}}, your news feed for today is ready ...</message>
  <data>{"user_email":"{{push_device.email}}","acme2":{"acme":"backme"}}</data>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <status>recurring</status>
  <send-at>March 31, 2016 01:10 AM</send-at>
  <schedule-type>1</schedule-type>
  <recurring-options>
    <schedule>yearly</schedule>
    <day>4</day>
    <month>10</month>
    <hour>02</hour>
    <minute>20</minute>
  </recurring-options>
</push-message>
To create a recurring push message in JSON format, you would make a HTTP POST request using the json extension
{
  "push_message": {
    "send_to": {
      "type": "device_tokens",
      "ios_tokens": "378FBCD...55133394C, 123FBCD...551XXXY4C",
      "android_tokens": ""
    },
    "name": "smiley test",
    "message": "Morning {{push_device.first_name}}, your news feed for today is ready ...",
    "data": "{\"user_email\":\"{{push_device.email}}\",\"acme2\":{\"acme\":\"backme\"}}",
    "badge_count": 1,
    "sound": "default",
    "status": "recurring",
    "send_at": "March 31, 2016 01:10 AM",
    "schedule_type": "1",
    "recurring_options": {
      "schedule": "yearly",
      "day": "4",
      "month": "10",
      "hour": "02",
      "minute": "20"
    }
  }
}
Extra params required for recurring are schedule_type and recurring_options
Allowed values for schedule_type are: 0(Send Once) and 1(Recurring), so send schedule_type: 1 for recurring messages
DELETE https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_devices/:push_message_id(.:format)
push_messages#destroy

POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/new_transactional_message(.:format)
push_messages#create

To create a transactional push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <send-to>
    <type>all_devices</type>
  </send-to>
  <name>smiley test</name>
  <message>Hey {{push_device.first_name}}, join us for {{tag.event_name}} ...</message>
  <data>{"event_id":"{{tag.event_id}}","acme":{"acme":"backme"}}</data>
  <tags>
    <event-name>Product Launch at NYC</event-name>
    <event-id type="integer">23456789</event-id>
  </tags>
  <badge-count type="integer">1</badge-count>
  <sound>default</sound>
  <image-url>https://cdn-m4m.chd01.com/logo/dev_image.jpeg</image-url>
  <deep-linking-url>myapp://host/destinationPage</deep-linking-url>
  <title>My Title</title>
  <sub-title>My Subtitle</sub-title>
</push-message>
To create a transactional push message for a push application using JSON as the input data format, you would make an HTTP POST request:
{
  "push_message": {
    "send_to": {
      "type": "all_devices"
    },
    "name": "smiley test",
    "message": "Hey {{push_device.first_name}}, join us for {{tag.event_name}} ...",
    "data": "{\"event_id\":\"{{tag.event_id}}\",\"acme\":{\"acme\":\"backme\"}}",
    "tags": {
      "event_name": "Product Launch at NYC",
      "event_id": 23456789
    },
    "badge_count": 1,
    "sound": "default",
    "image_url": "https://cdn-m4m.chd01.com/logo/dev_image.jpeg",
    "deep_linking_url": "myapp://host/destinationPage",
    "title": "My Title",
    "sub_title": "My Subtitle"
  }
}
* Customize your message or payload data with tags parameter and using format {{tag.tag_name}} in your message or data, ex: {{tag.event_name}} or {{tag.event_id}} in above example.
* Personalize your message or payload data for individual devices with available fields: {{push_device.first_name}}, {{push_device.last_name}}, {{push_device.login_id}} or {{push_device.email}}
* Allowed values for send_to -> type: 'all_devices', 'segment_ids', 'device_tokens' and 'login_ids'.
   -> For segment_ids, send a comma separated string of push segment IDs as an additional parameter named 'segment_ids' inside send_to param.
   -> For login_ids, send a comma separated string of login IDs as a parameter named 'login_ids' inside send_to param.
   -> For device_tokens, send a comma separated string of valid iOS device Tokens in a parameter named 'ios_tokens' and a comma separated string of valid Android registration IDs in a parameter named 'android_tokens' inside send_to parameter.
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/send_transactional_message(.:format)
push_messages#update

To send a transactional push message for a push application using XML as the input data format, you would make an HTTP POST request:
<push-message>
  <push-message-id type="integer">2</push-message-id>
  <send-to>
    <type>login_ids</type>
    <login-ids>1,2,3</login-ids>
  </send-to>
  <name>smiley test</name>
  <message>Hey {{push_device.first_name}}, join us for {{tag.event_name}} ...</message>
  <data>{"event_id":"{{tag.event_id}}","acme":{"acme":"backme"}}</data>
  <tags>
    <event-name>Product Launch at NYC</event-name>
    <event-id type="integer">23456789</event-id>
  </tags>
  <badge-count>1</badge-count>
  <sound>default</sound>
  <send-at type="dateTime">2024-04-24T13:57:33-04:00</send-at>
  <image-url>https://cdn-m4m.chd01.com/logo/dev_image.jpeg</image-url>
  <deep-linking-url>myapp://host/destinationPage</deep-linking-url>
  <title>My Title</title>
  <sub-title>My Subtitle</sub-title>
</push-message>
To send a transactional push message for a push application using JSON as the input data format, you would make an HTTP POST request:
{
  "push_message": {
    "push_message_id": 2,
    "send_to": {
      "type": "login_ids",
      "login_ids": "1,2,3"
    },
    "name": "smiley test",
    "message": "Hey {{push_device.first_name}}, join us for {{tag.event_name}} ...",
    "data": "{\"event_id\":\"{{tag.event_id}}\",\"acme\":{\"acme\":\"backme\"}}",
    "tags": {
      "event_name": "Product Launch at NYC",
      "event_id": 23456789
    },
    "badge_count": "1",
    "sound": "default",
    "send_at": "2024-04-24T13:57:33.667-04:00",
    "image_url": "https://cdn-m4m.chd01.com/logo/dev_image.jpeg",
    "deep_linking_url": "myapp://host/destinationPage",
    "title": "My Title",
    "sub_title": "My Subtitle"
  }
}
* Customize your message or payload data with tags parameter and using format {{tag.tag_name}} in your message or data, ex: {{tag.event_name}} or {{tag.event_id}} in above example.
* Personalize your message or payload data for individual devices with available fields: {{push_device.first_name}}, {{push_device.last_name}}, {{push_device.login_id}} or {{push_device.email}}
* Allowed values for send_to -> type: 'all_devices', 'segment_ids', 'device_tokens' and 'login_ids'.
   -> For segment_ids, send a comma separated string of push segment IDs as an additional parameter named 'segment_ids' inside send_to param.
   -> For login_ids, send a comma separated string of login IDs as a parameter named 'login_ids' inside send_to param.
   -> For device_tokens, send a comma separated string of valid iOS device Tokens in a parameter named 'ios_tokens' and a comma separated string of valid Android registration IDs in a parameter named 'android_tokens' inside send_to parameter.
* If send_at parameter is not provided, push message is scheduled to be sent immediately regardless of send_at being set when creating the message.
GET https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_devices(.:format)
push_devices#index

To get list of push devices for a push application using XML as the input data format, you would make an HTTP GET request:
<push-devices type="array">
  <push-device>
    <id type="integer">1</id>
    <account-id type="integer">1</account-id>
    <push-application-id type="integer">1</push-application-id>
    <token>378FBCD...55133394C</token>
    <email>email_id@email.com</email>
    <latitude type="float">30.707</latitude>
    <longitude type="float">76.8604</longitude>
    <time-zone-offset type="float">5.5</time-zone-offset>
    <device-tags>double||pipe||appended||keywords||</device-tags>
    <platform type="integer">1</platform>
    <status>1</status>
    <language>en</language>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <login-id>24</login-id>
    <form-factor type="integer">1</form-factor>
    <os-version>9.1.2</os-version>
    <first-name>John</first-name>
    <last-name>Appleseed</last-name>
  </push-device>
</push-devices>
To get list of push devices for a push application using JSON as the input data format, you would make an HTTP GET request:
[
  {
    "id": 1,
    "account_id": 1,
    "push_application_id": 1,
    "token": "378FBCD...55133394C",
    "email": "email_id@email.com",
    "latitude": 30.707,
    "longitude": 76.8604,
    "time_zone_offset": 5.5,
    "device_tags": "double||pipe||appended||keywords||",
    "platform": 1,
    "status": "1",
    "language": "en",
    "created_at": "2024-04-24T13:57:33.668-04:00",
    "updated_at": "2024-04-24T13:57:33.668-04:00",
    "login_id": "24",
    "form_factor": 1,
    "os_version": "9.1.2",
    "first_name": "John",
    "last_name": "Appleseed"
  }
]
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_devices(.:format)?app_key=:app_key
push_devices#create

* auth_token url parameter is NOT required for this API call. Instead, it requires an app_key parameter
To create a push device for a push application using XML as the input data format, you would make an HTTP POST request:
<push-device>
  <token>378FBCD...55133394C</token>
  <email>email_id@email.com</email>
  <latitude type="float">30.707</latitude>
  <longitude type="float">76.8604</longitude>
  <time-zone-offset type="float">5.5</time-zone-offset>
  <device-tags>double||pipe||appended||keywords||</device-tags>
  <platform type="integer">1</platform>
  <status type="integer">1</status>
  <language>en</language>
  <login-id>3249</login-id>
  <form-factor type="integer">1</form-factor>
  <os-version>9.2.1</os-version>
  <first-name>John</first-name>
  <last-name>Appleseed</last-name>
</push-device>
To create a push device for a push application using JSON as the input data format, you would make an HTTP POST request:
{
  "push_device": {
    "token": "378FBCD...55133394C",
    "email": "email_id@email.com",
    "latitude": 30.707,
    "longitude": 76.8604,
    "time_zone_offset": 5.5,
    "device_tags": "double||pipe||appended||keywords||",
    "platform": 1,
    "status": 1,
    "language": "en",
    "login_id": "3249",
    "form_factor": 1,
    "os_version": "9.2.1",
    "first_name": "John",
    "last_name": "Appleseed"
  }
}

* The app_key url parameter is required and is the unique key belonging to your push application (check your push app's details page for its value)
* token and platform fields are required for push devices
   -> Allowed values for platform: '1' (for iOS) or '2' (for Android)
   -> Allowed values for status: '1' (for production) or '2' (for sandbox)
   -> Allowed values for form_factor: '1' (for mobile-phone) or '2' (for tablet)
PUT https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_devices/:push_device_id(.:format)?app_key=:app_key
push_devices#update

* auth_token url parameter is NOT required for this API call. Instead, it requires an app_key parameter
To update a push device for a push application using XML as the input data format, you would make an HTTP PUT request:
<push-device>
  <token>378FBCD...55133394C</token>
  <email>email_id@email.com</email>
  <latitude type="float">30.707</latitude>
  <longitude type="float">76.8604</longitude>
  <time-zone-offset type="float">5.5</time-zone-offset>
  <device-tags>double||pipe||appended||keywords||</device-tags>
  <platform type="integer">1</platform>
  <status type="integer">1</status>
  <language>en</language>
  <login-id>3249</login-id>
  <form-factor type="integer">1</form-factor>
  <os-version>9.2.1</os-version>
  <first-name>John</first-name>
  <last-name>Appleseed</last-name>
</push-device>
To update a push device for a push application using JSON as the input data format, you would make an HTTP PUT request:
{
  "push_device": {
    "token": "378FBCD...55133394C",
    "email": "email_id@email.com",
    "latitude": 30.707,
    "longitude": 76.8604,
    "time_zone_offset": 5.5,
    "device_tags": "double||pipe||appended||keywords||",
    "platform": 1,
    "status": 1,
    "language": "en",
    "login_id": "3249",
    "form_factor": 1,
    "os_version": "9.2.1",
    "first_name": "John",
    "last_name": "Appleseed"
  }
}
DELETE https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_devices/:push_device_id(.:format)
push_devices#destroy

GET https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_segments(.:format)
push_segments#index

To get list of push segments for a push application using XML as the input data format, you would make an HTTP GET request:
<push-segments type="array">
  <push-segment>
    <id type="integer">1</id>
    <account-id type="integer">1</account-id>
    <name>Test segment</name>
    <push-application-id type="integer">1</push-application-id>
    <match-all>true</match-all>
    <contacts-count>0</contacts-count>
    <created-at type="dateTime">2024-04-24T13:57:33-04:00</created-at>
    <updated-at type="dateTime">2024-04-24T13:57:33-04:00</updated-at>
    <refreshed-at>null</refreshed-at>
  </push-segment>
</push-segments>
To get list of push segments for a push application using JSON as the input data format, you would make an HTTP GET request:
[
  {
    "id": 1,
    "account_id": 1,
    "name": "Test segment",
    "push_application_id": 1,
    "match_all": "true",
    "contacts_count": "0",
    "created_at": "2024-04-24T13:57:33.670-04:00",
    "updated_at": "2024-04-24T13:57:33.670-04:00",
    "refreshed_at": "null"
  }
]
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_event_trackings/event(.:format)?auth_token=:api_key
push_event_trackings#added_to_cart

To create push event tracking for "added to cart" event using XML as the input data format, you would make an HTTP POST request:
<push-event-tracking>
  <event-name>added to cart</event-name>
  <cart-id>1</cart-id>
  <sku>green shirt</sku>
  <description>best quantity in the market</description>
  <quantity>1</quantity>
  <product-category>mens shirt</product-category>
  <brand>Your branch name</brand>
  <model-number>ERd3422</model-number>
  <value>2000.00</value>
  <campaign-id>213</campaign-id>
  <latitude>1990100</latitude>
  <longitude>1000.99</longitude>
  <push-device-id>1</push-device-id>
  <session-id>12</session-id>
  <platform>1</platform>
</push-event-tracking>
To create push event tracking for "added to cart" event using JSON as the input data format, you would make an HTTP POST request:
{
  "event_name": "added to cart",
  "cart_id": "1",
  "sku": "green shirt",
  "description": "best quantity in the market",
  "quantity": "1",
  "product_category": "mens shirt",
  "brand": "Your branch name",
  "model_number": "ERd3422",
  "value": "2000.00",
  "campaign_id": "213",
  "latitude": "1990100",
  "longitude": "1000.99",
  "push_device_id": "1",
  "session_id": "12",
  "platform": "1"
}
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_event_trackings/event(.:format)?auth_token=:api_key
push_event_trackings#removed_from_cart

To create push event tracking for "removed from cart" event using XML as the input data format, you would make an HTTP POST request:
<push-event-tracking>
  <event-name>removed from cart</event-name>
  <cart-id>1</cart-id>
  <sku>green shirt</sku>
  <description>best quantity in the market</description>
  <quantity>1</quantity>
  <product-category>mens shirt</product-category>
  <brand>Your branch name</brand>
  <model-number>ERd3422</model-number>
  <value>2000.00</value>
  <campaign-id>213</campaign-id>
  <latitude>1990100</latitude>
  <longitude>1000.99</longitude>
  <push-device-id>1</push-device-id>
  <session-id>12</session-id>
  <platform>1</platform>
</push-event-tracking>
To create push event tracking for "removed from cart" event using JSON as the input data format, you would make an HTTP POST request:
{
  "event_name": "removed from cart",
  "cart_id": "1",
  "sku": "green shirt",
  "description": "best quantity in the market",
  "quantity": "1",
  "product_category": "mens shirt",
  "brand": "Your branch name",
  "model_number": "ERd3422",
  "value": "2000.00",
  "campaign_id": "213",
  "latitude": "1990100",
  "longitude": "1000.99",
  "push_device_id": "1",
  "session_id": "12",
  "platform": "1"
}
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_event_trackings/event(.:format)?auth_token=:api_key
push_event_trackings#started_checkout

To create push event tracking for "started checkout" event using XML as the input data format, you would make an HTTP POST request:
<push-event-tracking>
  <event-name>started checkout</event-name>
  <cart-id>1</cart-id>
  <value>2000.00</value>
  <campaign-id>213</campaign-id>
  <latitude>1990100</latitude>
  <longitude>1000.99</longitude>
  <push-device-id>1</push-device-id>
  <session-id>12</session-id>
  <platform>1</platform>
</push-event-tracking>
To create push event tracking for "started checkout" event using JSON as the input data format, you would make an HTTP POST request:
{
  "event_name": "started checkout",
  "cart_id": "1",
  "value": "2000.00",
  "campaign_id": "213",
  "latitude": "1990100",
  "longitude": "1000.99",
  "push_device_id": "1",
  "session_id": "12",
  "platform": "1"
}
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_event_trackings/event(.:format)?auth_token=:api_key
push_event_trackings#completed_checkout

To create push event tracking for "finished checkout" event using XML as the input data format, you would make an HTTP POST request:
<push-event-tracking>
  <event-name>completed checkout</event-name>
  <order-id>1</order-id>
  <order-date>2018-10-30 06:33:17 +05:30</order-date>
  <order-status>completed</order-status>
  <value>300.00</value>
  <coupon-code>ERX50WV</coupon-code>
  <session-id>13</session-id>
  <platform>1</platform>
  <campaign-id>23</campaign-id>
  <latitude>1990100</latitude>
  <longitude>1000.99</longitude>
  <push-device-id>1</push-device-id>
</push-event-tracking>
To create push event tracking for "completed checkout" event using JSON as the input data format, you would make an HTTP POST request:
{
  "event_name": "completed checkout",
  "order_id": "1",
  "order_date": "2018-10-30 06:33:17 +05:30",
  "order_status": "completed",
  "value": "300.00",
  "coupon_code": "ERX50WV",
  "session_id": "13",
  "platform": "1",
  "campaign_id": "23",
  "latitude": "1990100",
  "longitude": "1000.99",
  "push_device_id": "1"
}
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_event_trackings/event(.:format)?auth_token=:api_key
push_event_trackings#started_content

To create push event tracking for "started content" event using XML as the input data format, you would make an HTTP POST request:
<push-event-tracking>
  <event-name>started content</event-name>
  <content-id>1</content-id>
  <title>game start now</title>
  <description>Best player</description>
  <category>IER</category>
  <value>1009.99</value>
  <campaign-id>213</campaign-id>
  <latitude>1990100.0</latitude>
  <longitude>1000.99</longitude>
  <push-device-id>1</push-device-id>
  <session-id>12</session-id>
  <platform>1</platform>
</push-event-tracking>
To create push event tracking for "started content" event using JSON as the input data format, you would make an HTTP POST request:
{
  "event_name": "started content",
  "content_id": "1",
  "title": "game start now",
  "description": "Best player",
  "category": "IER",
  "value": "1009.99",
  "campaign_id": "213",
  "latitude": "1990100.0",
  "longitude": "1000.99",
  "push_device_id": "1",
  "session_id": "12",
  "platform": "1"
}
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_event_trackings/event(.:format)?auth_token=:api_key
push_event_trackings#finished_content

To create push event tracking for "finished content" event using XML as the input data format, you would make an HTTP POST request:
<push-event-tracking>
  <event-name>finished content</event-name>
  <content-id>1</content-id>
  <title>game finished</title>
  <description>Player won</description>
  <category>Game</category>
  <value>1009.99</value>
  <campaign-id>213</campaign-id>
  <latitude>1990100.00</latitude>
  <longitude>1000.99</longitude>
  <push-device-id>1</push-device-id>
  <session-id>12</session-id>
  <platform>1</platform>
</push-event-tracking>
To create push event tracking for "finished content" event using JSON as the input data format, you would make an HTTP POST request:
{
  "event_name": "finished content",
  "content_id": "1",
  "title": "game finished",
  "description": "Player won",
  "category": "Game",
  "value": "1009.99",
  "campaign_id": "213",
  "latitude": "1990100.00",
  "longitude": "1000.99",
  "push_device_id": "1",
  "session_id": "12",
  "platform": "1"
}
POST https://api.maropost.com/accounts/:account_id/push_applications/:push_application_id/push_event_trackings/event(.:format)?auth_token=:api_key
push_event_trackings#custom_event

To create push event tracking for "custom event (You can create any event name from event management dashboard and also use default event field or create new event field based on requirement)" event using XML as the input data format, you would make an HTTP POST request:
<push-event-tracking>
  <event-name>product info</event-name>
  <content-id>1</content-id>
  <title>Gemy</title>
  <description>Best product in the market</description>
  <category>ecommerce</category>
  <value>2000.00</value>
  <order-id>25</order-id>
  <phone-number>+9109299992</phone-number>
  <company-name>brand value</company-name>
  <campaign-id>213</campaign-id>
  <latitude>1990100.00</latitude>
  <longitude>1000.99</longitude>
  <push-device-id>1</push-device-id>
  <session-id>12</session-id>
  <platform>1</platform>
</push-event-tracking>
To create push event tracking for "(custom event (You can create any event name from event management dashboard and also use default event field or create new event field based on requirement)" event using JSON as the input data format, you would make an HTTP POST request:
{
  "event_name": "product info",
  "content_id": "1",
  "title": "Gemy",
  "description": "Best product in the market",
  "category": "ecommerce",
  "value": "2000.00",
  "order_id": "25",
  "phone_number": "+9109299992",
  "company_name": "brand value",
  "campaign_id": "213",
  "latitude": "1990100.00",
  "longitude": "1000.99",
  "push_device_id": "1",
  "session_id": "12",
  "platform": "1"
}