{"_id":"582cef7efd7f750f0085a5ee","version":{"_id":"5588b8a2f6c18d0d005bba06","project":"5588b8a2f6c18d0d005bba03","__v":16,"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","58db348aa32c8419002433bb","5a31c9409a6f2000125c079f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"57f53fb368a53b2000e03f0f","version":"5588b8a2f6c18d0d005bba06","project":"5588b8a2f6c18d0d005bba03","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-10-05T18:00:19.547Z","from_sync":false,"order":0,"slug":"api","title":"REST API: Access your Mixmax data"},"githubsync":"","parentDoc":null,"__v":7,"project":"5588b8a2f6c18d0d005bba03","user":"5588b847f6c18d0d005bba01","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-16T23:45:02.009Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"post","results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n \"_id\":\"582621e1ffaa42dd37ef23b9\",\n  \"email\":\"foo:::at:::mixmax.com\",\n  \"userId\":\"pnrondsRr7MoYDR6x\",\n  \"timestamp\":1479339976660,\n  \"groups\":[\"582b77f6c1f0754d9407cfd9\"]\n}"},{"code":"","language":"text","status":404}]},"settings":"","examples":{"codes":[{"code":"curl -XPOST \\\n    --header 'Content-Type: application/json' \\\n    --header \"X-API-Token: <your token>\" \\\n    https://api.mixmax.com/v1/contactgroups/582ceec00800751a1e25fcca/contacts \\\n    -d '{\"email\":\"foo@mixmax.com\"}'","language":"curl"},{"code":"curl -XPOST \\\n    --header 'Content-Type: application/json' \\\n    --header \"X-API-Token: <your token>\" \\\n    https://api.mixmax.com/v1/contactgroups/582ceec00800751a1e25fcca/contacts \\\n    -d '{\"contacts\":[{email:\"foo@mixmax.com\"}, {\"contactId\":\"3513513dfdf2\", \"meta\": {\"Pet\":\"Dog\", \"Score\":123}]}'","language":"curl","name":"Bulk Insert"}]},"auth":"required","params":[{"_id":"5826691a3c689e25000139e5","ref":"","in":"path","required":false,"desc":"The _id of the Contact Group the Contact will be added to","default":"","type":"string","name":"id"},{"_id":"582cf08d3104da0f00cbd6ec","ref":"","in":"body","required":false,"desc":"Email of the contact to add. Resolves the email to a contact owned by the user. One of `email` or `contactId` must be defined.","default":"","type":"string","name":"email"},{"_id":"58ec1019f158590f00b50f08","ref":"","in":"body","required":false,"desc":"The id of the contact to add to the group. One of `email` or `contactId` must be defined.","default":"","type":"string","name":"contactId"},{"_id":"582cf08d3104da0f00cbd6eb","ref":"","in":"body","required":false,"desc":"Name of the contact to add","default":"","type":"string","name":"name"},{"_id":"58d0b60cba22ef0f00515c8e","ref":"","in":"body","required":false,"desc":"Contact variables from any source (ex. Salesforce) that are used to populate sequences and templates variables. Anything passed here will be merged with an existing contact's `meta`, if one exists for the same email.","default":"","type":"object","name":"meta"},{"_id":"5ba566e0bd4aad0003f7f5d1","ref":"","in":"body","required":false,"desc":"For bulk adding recipients. Max 100 entries. Each entry in the array is required to have either `email` or `contactId` field. Optional fields `meta` and `name` are also allowed and are inserted with the contact.","default":"","type":"array_object","name":"contacts"}],"url":"/v1/contactgroups/:id/contacts"},"isReference":true,"order":25,"body":"You must either own or have edit access to the group to use this.\n\nFor response format, see [/contacts API](http://developer.mixmax.com/docs/contacts).","excerpt":"Adds a Contact to a Contact Group. You must own the group to add contacts to it.","slug":"contactgroupsidcontacts-1","type":"endpoint","title":"/contactgroups/:id/contacts"}

post/contactgroups/:id/contacts

Adds a Contact to a Contact Group. You must own the group to add contacts to it.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
string
The _id of the Contact Group the Contact will be added to

Body Params

email:
string
Email of the contact to add. Resolves the email to a contact owned by the user. One of `email` or `contactId` must be defined.
contactId:
string
The id of the contact to add to the group. One of `email` or `contactId` must be defined.
name:
string
Name of the contact to add
meta:
object
Contact variables from any source (ex. Salesforce) that are used to populate sequences and templates variables. Anything passed here will be merged with an existing contact's `meta`, if one exists for the same email.
contacts:
array of objects
For bulk adding recipients. Max 100 entries. Each entry in the array is required to have either `email` or `contactId` field. Optional fields `meta` and `name` are also allowed and are inserted with the contact.

Examples


Result Format


Documentation

You must either own or have edit access to the group to use this. For response format, see [/contacts API](http://developer.mixmax.com/docs/contacts).

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 }}