Add recipients

Add people to a campaign with a name and custom fields for the text replacements in your emails.

POST https://cotlet.dev/api/v1/mailshake/campaigns/{campaign_id}/recipients

write Confirm

Adds recipients to a campaign and waits for Mailshake to finish the import, then returns what was skipped. Addresses on your unsubscribe list and addresses already in the campaign are skipped. A campaign holds up to 5,000 recipients through the API, and your plan limits how many recipients you can add per month. Unless the campaign is paused, new recipients are scheduled to get its emails right away. A field your emails use as a text replacement but a recipient lacks keeps that recipient's emails from being scheduled. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: add_recipients
NameTypeDescription
campaign_id integer required integer Campaign ID from list_campaigns.
addresses object[] required object[] Each item: email_address (required), full_name, and fields, an object of custom values such as company. Mailshake adds first, last and name text replacements from full_name. Up to 30 fields per recipient.
add_as_new_list boolean boolean true to keep these recipients grouped as their own list. Default: false, they join the last list you uploaded.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/mailshake/campaigns/4821/recipients \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"addresses":[{"email_address":"dana@brightpath.example","full_name":"Dana Whitfield","fields":{"company":"Brightpath"}},{"email_address":"omar@lumenlabs.example","full_name":"Omar Haddad","fields":{"company":"Lumen Labs"}},{"email_address":"li@oldclient.example","full_name":"Li Chen","fields":{"company":"Old Client"}}],"add_as_new_list":true}'
Python
result = client.call("mailshake", "add_recipients", {"campaign_id":4821,"addresses":[{"email_address":"dana@brightpath.example","full_name":"Dana Whitfield","fields":{"company":"Brightpath"}},{"email_address":"omar@lumenlabs.example","full_name":"Omar Haddad","fields":{"company":"Lumen Labs"}},{"email_address":"li@oldclient.example","full_name":"Li Chen","fields":{"company":"Old Client"}}],"add_as_new_list":True})
Node.js
const result = await cotlet.call('mailshake', 'add_recipients', {"campaign_id":4821,"addresses":[{"email_address":"dana@brightpath.example","full_name":"Dana Whitfield","fields":{"company":"Brightpath"}},{"email_address":"omar@lumenlabs.example","full_name":"Omar Haddad","fields":{"company":"Lumen Labs"}},{"email_address":"li@oldclient.example","full_name":"Li Chen","fields":{"company":"Old Client"}}],"add_as_new_list":true});
CLI
cotlet call mailshake add_recipients --data '{"campaign_id":4821,"addresses":[{"email_address":"dana@brightpath.example","full_name":"Dana Whitfield","fields":{"company":"Brightpath"}},{"email_address":"omar@lumenlabs.example","full_name":"Omar Haddad","fields":{"company":"Lumen Labs"}},{"email_address":"li@oldclient.example","full_name":"Li Chen","fields":{"company":"Old Client"}}],"add_as_new_list":true}'

Example response

JSON

{
  "campaign_id": 4821,
  "submitted": 3,
  "added": 2,
  "invalid_emails": [],
  "problems": {
    "unsubscribed_emails": [
      "li@oldclient.example"
    ],
    "already_in_campaign_emails": [],
    "over_campaign_limit_emails": []
  }
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.