{"__v":8,"_id":"57f65dec8d22352b00353a02","category":{"__v":0,"_id":"57f53fb368a53b2000e03f0f","project":"5588b8a2f6c18d0d005bba03","version":"5588b8a2f6c18d0d005bba06","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-10-05T18:00:19.547Z","from_sync":false,"order":0,"slug":"api","title":"REST API"},"parentDoc":null,"project":"5588b8a2f6c18d0d005bba03","user":"5588b847f6c18d0d005bba01","version":{"__v":14,"_id":"5588b8a2f6c18d0d005bba06","project":"5588b8a2f6c18d0d005bba03","createdAt":"2015-06-23T01:38:42.696Z","releaseDate":"2015-06-23T01:38:42.696Z","categories":["5588b8a3f6c18d0d005bba07","5588e9689cfea70d00371df3","5588f5921163180d00b64704","561598b121e9110d0078025a","5616f1c9d170d00d00189306","5616f5c3a410c90d00c6121e","561803dcf8c9632100ac7592","563667280441020d0000e9eb","5642570d9417b40d00c0fcd3","57bf5f02efe0050e00d50bd5","57f53fb368a53b2000e03f0f","57f55187440418170086325a","582e3afa72fd270f0006926d","5841faa973967b0f004b4a2b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-06T14:21:32.729Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"cURL","language":"curl","code":"curl -XPOST \\\n    --header 'Content-Type: application/json' \\\n    --header \"X-API-Token: <your token>\" \\\n    https://api.mixmax.com/v1/sequences/593HF9J3IJ4JF30IF/recipients \\\n    -d '{\n        \"recipients\": [{\n              \"email\": \"hello:::at:::mixmax.com\",\n              \"variables\": {\n                  \"name\": \"Hugo Brockman\",\n                  \"email\": \"hello@mixmax.com\"\n              }\n          },\n          {\n              \"email\": \"careers@mixmax.com\",\n              \"variables\": {\n                  \"name\": \"Mixmax hello\",\n                  \"email\": \"careers@mixmax.com\"\n              }\n          }],\n          \"scheduledAt\": 1490300970312\n      }'"},{"name":"cURL (keep in draft)","language":"curl","code":"curl -XPOST \\\n    --header 'Content-Type: application/json' \\\n    --header \"X-API-Token: <your token>\" \\\n    https://api.mixmax.com/v1/sequences/593HF9J3IJ4JF30IF/recipients/ \\\n    -d '{\n        \"recipients\": [{\n              \"email\": \"hello@mixmax.com\",\n              \"variables\": {\n                  \"name\": \"Hugo Brockman\",\n                  \"email\": \"hello@mixmax.com\"\n              }\n          }],\n          \"scheduledAt\": false\n      }'"},{"code":"curl -XPOST \\\n    --header 'Content-Type: application/json' \\\n    --header \"X-API-Token: <your token>\" \\\n    https://api.mixmax.com/v1/sequences/593HF9J3IJ4JF30IF/recipients/ \\\n    -d '{\n        \"recipients\": [{\n              \"email\": \"hello@mixmax.com\",\n              \"variables\": {\n                  \"name\": \"Hugo Brockman\",\n                  \"email\": \"hello@mixmax.com\"\n              },\n              \"scheduledAt\": false\n          },\n          {\n              \"email\": \"careers@mixmax.com\",\n              \"variables\": {\n                  \"name\": \"Mixmax hello\",\n                  \"email\": \"careers@mixmax.com\"\n              }\n          }],\n          \"scheduledAt\": 1478110013\n      }'","language":"curl","name":"cURL (override scheduledAt)"}]},"method":"post","results":{"codes":[{"name":"","code":"[\n  {\n    \"email\": \"hello@mixmax.com\",\n    \"status\": \"success\"\n  },\n  {\n    \"email\": \"careers@mixmax.com\",\n    \"status\": \"duplicated\"\n  },\n  {\n    \"email\": \"hugo@mixmax.com\",\n    \"status\": \"unsubscribed\"\n  },\n  {\n    \"email\": \"foo\",\n    \"status\": \"error\",\n    \"errors\": [\"Must provide a valid email\"]\n  }\n]\n","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"57f65dec8d22352b00353a06","ref":"","in":"path","required":true,"desc":"The ID of the Sequence you'd like to add the user to.","default":"","type":"string","name":"id"},{"_id":"5819289ef62fee0f00949866","ref":"","in":"body","required":true,"desc":"Array of recipients to add. See below for object structure.","default":"empty array","type":"array_object","name":"recipients"},{"_id":"581a3f843a2da40f00873a76","ref":"","in":"body","required":false,"desc":"The unix timestamp, in milliseconds, that you'd like the Sequence to activate at for ALL recipients. Set to the current time to send immediately. If set to special value `false`, then the recipient will be kept in draft. Note that this can be overridden for each recipient by passing `scheduledAt` for that recipient.","default":"(current time)","type":"timestamp","name":"scheduledAt"}],"url":"/v1/sequences/:id/recipients/"},"isReference":true,"order":61,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Recipient structure\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"email\",\n    \"0-1\": \"*String*\",\n    \"0-2\": \"The email of the recipient\",\n    \"1-0\": \"variables\",\n    \"1-1\": \"*Object*\",\n    \"1-2\": \"Any variables that your Sequence requires (see example above)\",\n    \"2-0\": \"scheduledAt\",\n    \"2-1\": \"*Timestamp*\",\n    \"2-2\": \"Optional. Overrides the root-level `scheduledAt` property for just this recipient.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Response structure\"\n}\n[/block]\nDuplicated and unsubsribed recipients are NOT recognized case-sensitively. So `john@company.com` is different from `John@company.com`\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"recipients\",\n    \"0-1\": \"Array\",\n    \"0-2\": \"The list of processed recipients\",\n    \"1-0\": \"recipients.email\",\n    \"1-1\": \"String\",\n    \"1-2\": \"The email of the processed recipients\",\n    \"2-0\": \"recipients.status\",\n    \"2-1\": \"String (success, error, duplicated, unsubscribed)\",\n    \"2-2\": \"The status of the recipients. \\n\\n`duplicated` is for recipients that are already existing in the sequence and were skipped.\\n\\n`unsubscribed` is for recipients that are unsubscribed from receiving sequences from the team. They will not be added to the sequence\",\n    \"3-0\": \"[recipients.errors]\",\n    \"3-1\": \"String[]\",\n    \"3-2\": \"If the recipient status is error, this property will contain an array of found errors while processing the recipient\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]","excerpt":"Adds new recipients to a Sequence.","slug":"sequencessequenceidrecipients","type":"endpoint","title":"/sequences/:id/recipients"}

post/sequences/:id/recipients

Adds new recipients to a Sequence.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
The ID of the Sequence you'd like to add the user to.

Body Params

recipients:
required
array of objectsempty array
Array of recipients to add. See below for object structure.
scheduledAt:
timestamp(current time)
The unix timestamp, in milliseconds, that you'd like the Sequence to activate at for ALL recipients. Set to the current time to send immediately. If set to special value `false`, then the recipient will be kept in draft. Note that this can be overridden for each recipient by passing `scheduledAt` for that recipient.

Examples


Result Format


Documentation

[block:api-header] { "type": "basic", "title": "Recipient structure" } [/block] [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "email", "0-1": "*String*", "0-2": "The email of the recipient", "1-0": "variables", "1-1": "*Object*", "1-2": "Any variables that your Sequence requires (see example above)", "2-0": "scheduledAt", "2-1": "*Timestamp*", "2-2": "Optional. Overrides the root-level `scheduledAt` property for just this recipient." }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "title": "Response structure" } [/block] Duplicated and unsubsribed recipients are NOT recognized case-sensitively. So `john@company.com` is different from `John@company.com` [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Type", "h-2": "Description", "0-0": "recipients", "0-1": "Array", "0-2": "The list of processed recipients", "1-0": "recipients.email", "1-1": "String", "1-2": "The email of the processed recipients", "2-0": "recipients.status", "2-1": "String (success, error, duplicated, unsubscribed)", "2-2": "The status of the recipients. \n\n`duplicated` is for recipients that are already existing in the sequence and were skipped.\n\n`unsubscribed` is for recipients that are unsubscribed from receiving sequences from the team. They will not be added to the sequence", "3-0": "[recipients.errors]", "3-1": "String[]", "3-2": "If the recipient status is error, this property will contain an array of found errors while processing the recipient" }, "cols": 3, "rows": 4 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}