{"_id":"59f0d0ea139705001037d691","project":"55843604fd8d910d007b9502","version":{"_id":"558444ceafccfd0d00fcb2bb","forked_from":"55843604fd8d910d007b9505","project":"55843604fd8d910d007b9502","__v":66,"createdAt":"2015-06-19T16:35:26.435Z","releaseDate":"2015-06-19T16:35:26.435Z","categories":["558444cfafccfd0d00fcb2bc","558444cfafccfd0d00fcb2bd","55ad4ce733616a0d00599d2e","55ad4cef6aadf20d0015b764","55ad4cf36aadf20d0015b765","55ad4cfb24cf160d0013584f","55ad4d0024cf160d00135850","55ad4d0a24cf160d00135851","55ad4d0d24cf160d00135852","55ad4d126aadf20d0015b766","55ad4d1624cf160d00135853","55ad4d1933616a0d00599d2f","55ad4d2233616a0d00599d30","55ad4d2e24cf160d00135854","55d35b6bf77e6d0d00b1b092","55d3649a0168850d0073f14a","55d366d40168850d0073f15a","55d37fcff77e6d0d00b1b13f","55d383e50168850d0073f1e1","55d3ac26c336ec0d007c2251","55d3c51cb2330119009c31db","55d3c59bfe37111900e536f3","55d3c5a7fe37111900e536f4","55d3c5b4fe37111900e536f5","55d3c5d4fe37111900e536f6","55d3c5d6b2330119009c31df","55d3c5d71f478b170077c164","55d3c687b2330119009c31e4","55d3c6a4fe37111900e536f9","55d3c6befe37111900e536fa","55d3c6e8d2c66f0d00497f93","55d49dcfd7c16b2d007de905","55d4ca8f5082980d0009c79b","55d4cab9c95a3d2f0069ad3d","55d4d279c95a3d2f0069ad60","55d4d9355082980d0009c7e1","55d4f6b5988e130d000b3eb1","55d64dc8e60a2f0d00b88ecb","5627ca43fcbbc621004ec07d","56c64a0d8f98b50d0012c37c","56f1b8b13eb62a34003ea041","56f1b9df4476fb2200795e8c","57f6907dca5e5d1700039ae9","591dd06ca266c423002ec4ca","59234825e465c11900922518","5936f82eaa591e0027638d57","59972f54fd7078001992c136","599c6da8f180820025f14909","59b054613c3e1b0019cf27d9","59b1ceca2d6231003ad73e5f","59b1cf1857911600382e0dc4","59b1cf2730f3d60010c30ef7","59b1cf385d4b89003035441a","59b1cf5857911600382e0dc6","59bc2c4e26ac9b0010a8b753","59bc2ce20b3eb30010657b70","59f0c793ba3bc90030f413ab","59f0cd62f5ecda00325294b9","59fb55a8e8d0f600101aedc3","59fcb05c067f8d0028613f86","5a2af4a1bc5fba00283909c1","5a83673b0e56010012138c12","5a972f2e77b85a0070e4ebe2","5aa300224ed4b40012c53e1d","5acd20095efd8d000359bb3c","5ad50889c05179000306021e","5af0927a8779670003daff34"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3"},"category":{"_id":"59f0c793ba3bc90030f413ab","project":"55843604fd8d910d007b9502","version":"558444ceafccfd0d00fcb2bb","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-10-25T17:19:15.405Z","from_sync":false,"order":35,"slug":"target-audience-sample-definitions","title":"Target Audience Sample Definitions"},"user":"57bb969a36eff81700666822","__v":51,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-25T17:59:06.230Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"post","examples":{"codes":[{"language":"curl","code":"curl -X POST \\ 'https://yourdatacenterid.qualtrics.com/API/v3/directories/POOL_012345678901234/samples/definitions' \\ \n-H 'X-API-TOKEN: apitokenhere' \\\n-H 'content-type: application/json' \\ \n-d '\n     {\n       \"sampleCriteria\": {\n           \"simpleFilter\": {\n              \"filterType\": \"lastName\",\n              \"comparison\": \"contains\",\n              \"value\": \"5\"\n           }\n       },\n       \"maxSampleSize\": 9\n     }\n  '"}]},"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"result\": {\n        \"sampleDefinitionId\": \"SAMD_012345678901234\"\n    },\n    \"meta\": {\n        \"httpStatus\": \"200 - OK\",\n        \"requestId\": \"c4d2c6c6-e08a-45e4-94d4-6381e1230a3e\"\n    }\n}","name":""}]},"settings":"","auth":"required","params":[{"_id":"59f0dd15d9106d001a272f9a","ref":"","in":"path","required":true,"desc":"the directory ID, also known as a pool ID.","default":"","type":"string","name":"directoryId"},{"_id":"59f0dd15d9106d001a272f99","ref":"","in":"body","required":true,"desc":"The search logic used to build a sample, see below.","default":"","type":"object","name":"sampleCriteria"},{"_id":"59f0dd15d9106d001a272f98","ref":"","in":"body","required":true,"desc":"The maximum size of any sample generated from this definition.","default":"","type":"int","name":"maxSampleSize"},{"_id":"59f0f0b8ba3bc90030f41a28","ref":"","in":"header","required":true,"desc":"","default":"application/json","type":"string","name":"Content-Type"},{"_id":"59f0f654139705001037dc73","ref":"","in":"header","required":true,"desc":"Your api token.","default":"","type":"string","name":"X-API-TOKEN"}],"url":"/v:version/directories/:directoryId/samples/definitions"},"isReference":false,"order":2,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"This API call is only available to Target Audience users.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"The size of the JSON body accepted by this API call is 10kB.\",\n  \"body\": \"Formulating a multi-category and deeply nested sample criteria allows one to describe a search with high precision, but it also comes with the pitfall of inadvertently including criteria that are contradictory or impossible to satisfy. We recommend that you keep your sample criteria flat and concise.\"\n}\n[/block]\n\nThe JSON object represented by the **sampleCriteria** key allows one to specify a single criterion or group and nest criteria.\n\nSuppose you have criteria _W_, _X_, _Y_ and _Z_.\n\nA correctly constructed **sampleCriteria** key will allow you to specify any of the following and more:\n\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_W_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_X_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_Y_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_Z_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(W or X)_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(W and X)_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(W or Y)_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(W or Z)_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(X or Y)_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(X and Y)_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(X or Z)_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(W or (X and Y))_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(W or (X and Z))_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(W or (X and (Y or Z)))_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(X and (Y or (Z and W)))_.\n- Retrieve contacts which satisfy   &nbsp;&nbsp;_(X and Y) or (Z and W)_.\n- **and so on...**\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Constructing the simpleFilter JSON object\",\n  \"body\": \"At its core, the JSON object is formed by parameters describing the evaluation of a single criterion or is formed by criteria that are grouped together with a conjunction (_and_, _or_), thereby creating a **filterGroup**.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Simple Filter Criterion\"\n}\n[/block]\nBelow are the supported filter criteria and their associated JSON syntax. Read beyond the table to understand the mechanics of grouping and nesting criteria via a **[filterGroup](doc:create-sample-definition#filter-group)**.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Criterion\",\n    \"h-1\": \"JSON Syntax\",\n    \"h-2\": \"As simpleFilter\",\n    \"h-3\": \"As Filter\",\n    \"0-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"email\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"startsWith\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"pritty\\\"\\n}\",\n    \"0-0\": \"email\",\n    \"0-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"email\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [stringComparison](doc:create-sample-definition#stringcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"0-3\": \"\",\n    \"1-0\": \"first name\",\n    \"2-0\": \"last name\",\n    \"3-0\": \"external data reference\",\n    \"4-0\": \"any field ([Notes](doc:create-sample-definition#any-field))\",\n    \"1-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"firstName\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [stringComparison](doc:create-sample-definition#stringcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"2-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"lastName\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [stringComparison](doc:create-sample-definition#stringcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"3-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"extRef\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [stringComparison](doc:create-sample-definition#stringcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"4-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"anyField\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [stringComparison](doc:create-sample-definition#stringcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"1-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"firstName\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"eq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"Iain\\\"\\n}\",\n    \"2-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"lastName\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"neq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"reezy\\\"\\n}\",\n    \"3-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"extRef\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"contains\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"beryl\\\"\\n}\",\n    \"4-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"anyField\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"doesNotContain\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"math\\\"\\n}\",\n    \"5-0\": \"subscribed\",\n    \"5-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"subscribed\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [booleanComparison](doc:create-sample-definition#booleancomparison)\\n}\",\n    \"5-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"subscribed\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": true\\n}\",\n    \"6-0\": \"embedded data ([Notes](doc:create-sample-definition#embedded-data))\",\n    \"6-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"embeddedData\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [embeddedDataComparison](doc:create-sample-definition#embeddeddatacomparison),\\n&nbsp;&nbsp;\\\"field\\\": [plainString](doc:create-sample-definition#plainstring),\\n&nbsp;&nbsp;\\\"value\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"6-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"embeddedData\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"eq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"field\\\": \\\"citizenship\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"switzerland\\\"\\n}\",\n    \"10-0\": \"info field state\",\n    \"11-0\": \"embedded data field state ([Notes](doc:create-sample-definition#embedded-data))\",\n    \"12-0\": \"in list\",\n    \"13-0\": \"in sample\",\n    \"10-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"infoFieldState\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [emptyComparison](doc:create-sample-definition#emptycomparison),\\n&nbsp;&nbsp;\\\"field\\\": [infoField](doc:create-sample-definition#infofield)\\n}\",\n    \"11-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"embeddedDataFieldState\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [emptyComparison](doc:create-sample-definition#emptycomparison),\\n&nbsp;&nbsp;\\\"field\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"10-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"infoFieldState\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"empty\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"field\\\": \\\"email\\\"\\n}\",\n    \"11-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"embeddedDataFieldState\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"notEmpty\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"field\\\": \\\"edf11\\\"\\n}\",\n    \"12-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"inList\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [booleanComparison](doc:create-sample-definition#booleancomparison),\\n&nbsp;&nbsp;\\\"mailingListId\\\": [listId](doc:create-sample-definition#listid)\\n}\",\n    \"13-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"inSample\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [booleanComparison](doc:create-sample-definition#booleancomparison),\\n&nbsp;&nbsp;\\\"sampleId\\\": [sampleId](doc:create-sample-definition#sampleid)\\n}\",\n    \"12-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"inList\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": true,\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"mailingListId\\\": \\\"CG_0CgJ5dUewtIvxIN\\\"\\n}\",\n    \"13-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"inSample\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": false,\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"sampleId\\\": \\\"CG_77fAbR6TjhDxOKh\\\"\\n}\",\n    \"14-0\": \"created\",\n    \"16-0\": \"unsubscribe date\",\n    \"17-0\": \"last modified date\",\n    \"18-0\": \"last email date\",\n    \"19-0\": \"last invite date\",\n    \"20-0\": \"last response date\",\n    \"14-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"created\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\\n}\",\n    \"16-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"unsubscribeDate\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\\n}\",\n    \"14-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"created\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"eq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2017-03-01 23:18:12\\\"\\n}\",\n    \"15-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"created\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"neq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2017-03-08\\\"\\n}\",\n    \"16-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"unsubscribeDate\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"eq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2017-01-20 21:00:11\\\"\\n}\",\n    \"17-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"lastModified\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\\n}\",\n    \"18-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"lastEmail\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\\n}\",\n    \"19-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"lastInvite\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\\n}\",\n    \"20-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"lastResponse\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\\n}\",\n    \"17-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"lastModified\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gt\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2013-10-31 23:48:59\\\"\\n}\",\n    \"18-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"lastEmail\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"lt\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2015-11-30 08:00:00\\\"\\n}\",\n    \"19-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"lastInvite\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2016-10-04\\\"\\n}\",\n    \"20-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"lastResponse\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"lte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2015-05-20\\\"\\n}\",\n    \"21-0\": \"total emails\",\n    \"22-0\": \"total invites\",\n    \"23-0\": \"total responses\",\n    \"21-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"totalEmails\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\\n}\",\n    \"22-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"totalInvites\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\\n}\",\n    \"23-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"totalResponses\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [nonNegativeInt](doc:create-sample-definitions#nonnegativeint)\\n}\",\n    \"21-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"totalEmails\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"lte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 2\\n}\",\n    \"22-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"totalInvites\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 5\\n}\",\n    \"23-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"totalResponses\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"neq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 7\\n}\",\n    \"24-0\": \"response rate ([Notes](doc:create-sample-definition#response-rate))\",\n    \"25-0\": \"average response time ([Notes](doc:create-sample-definition#average-response-time))\",\n    \"26-0\": \"points\",\n    \"24-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"responseRate\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\\n}\",\n    \"24-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"responseRate\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gt\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 49\\n}\",\n    \"25-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"averageResponseTime\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\\n}\",\n    \"25-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"averageResponseTime\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gt\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 2\\n}\",\n    \"26-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"points\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [numericComparison](doc:create-sample-definition#numericcomparison),\\n&nbsp;&nbsp;\\\"value\\\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\\n}\",\n    \"26-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"points\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"lt\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 27\\n}\",\n    \"7-2\": \"\\\"\\\"simpleFilter\\\"\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"embeddedData\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"field\\\": \\\"age\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"23\\\"\\n}\",\n    \"8-0\": \"transaction data ([Notes](doc:create-sample-definition#transactiondatacomparison))\",\n    \"8-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"transactionData\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [transactionDataComparison](doc:create-sample-definition#transactiondatacomparison),\\n&nbsp;&nbsp;\\\"field\\\": [plainString](doc:create-sample-definition#plainstring),\\n&nbsp;&nbsp;\\\"value\\\": [plainString](doc:create-sample-definition#plainstring)\\n}\",\n    \"8-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"transactionData\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"eq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"field\\\": \\\"citizenship\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"switzerland\\\"\\n}\",\n    \"9-2\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"transactionData\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gt\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"field\\\": \\\"Q_TransactionDateTime\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"2016-12-04 15:41:34\\\",\\n}\",\n    \"9-0\": \"transaction date ([Notes](doc:create-sample-definition#transactiondatecomparison))\",\n    \"9-1\": \"{\\n&nbsp;&nbsp;\\\"filterType\\\": \\\"transactionData\\\",\\n&nbsp;&nbsp;\\\"comparison\\\": [transactionDateComparison](doc:create-sample-definition#transactiondatecomparison),\\n&nbsp;&nbsp;\\\"field\\\": \\\"Q_TransactionDateTime\\\",\\n&nbsp;&nbsp;\\\"value\\\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\\n}\"\n  },\n  \"cols\": 3,\n  \"rows\": 27\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Leading and trailing spaces\",\n  \"body\": \"String values associated with JSON keys that are not **filterType** or **comparison** will have any leading and trailing spaces trimmed off.\\n\\nThe JSON keys **filterType** and **comparison** have strict values enumerated herein. Any deviation from those values will result in an error being returned in the API response.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Filter Group\"\n}\n[/block]\nThe filter group allows one to create complex and nested criteria.\n\nThe filter group is equivalent to taking several [simple criterion](doc:create-sample-definition#simple-filter-criterion) (_X_, _Y_, _Z_), inserting a common boolean operator between them, and surrounding the criteria in parentheses, e.g. _(X and Y and Z)_ or _(X or Y or Z)_.\n\nFilter groups can be nested within other filter groups, allowing you to produce statements like _(X and (Y or Z))_. \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"simpleFilterGroup JSON Syntax\",\n    \"h-1\": \"As simpleFilter\",\n    \"0-0\": \"{\\n&nbsp;&nbsp;\\\"conjunction\\\": [conjunction](doc:create-sample-definition#conjunction),\\n&nbsp;&nbsp;\\\"filters\\\": [simpleFilters](doc:create-sample-definition#simplefilters)\\n}\",\n    \"0-1\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"conjunction\\\": \\\"or\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filters\\\": [\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"eq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"lastName\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"test\\\"\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"totalEmails\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 7\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\\n&nbsp;&nbsp;&nbsp;&nbsp;]\\n}\",\n    \"1-1\": \"\\\"simpleFilter\\\": {\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"conjunction\\\": \\\"or\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;\\\"filters\\\": [\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"eq\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"lastName\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"test\\\"\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"gte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"totalEmails\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": 7\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"conjunction\\\": \\\"and\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"filters\\\": [\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": \\\"lte\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"embeddedData\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"field\\\": \\\"experience\\\",\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"value\\\": \\\"13\\\"\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"comparison\\\": true,\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\\"filterType\\\": \\\"subscribed\\\"\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\\n&nbsp;&nbsp;&nbsp;&nbsp;]\\n}\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Valid associations between filter, filterGroup and filters\",\n  \"body\": \"**simpleFilter** => **simpleFilterGroup** <===> **simpleFilters**\\n\\nOne cannot mix and match between these associations.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"booleanComparison\"\n}\n[/block]\n**JSON data type**: boolean\n**Valid values are**:\n- true\n- false\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"embeddedDataComparison\"\n}\n[/block]\n**JSON data type**: string\n**Valid values are**:\n- contains\n- doesNotContain\n- eq\n- neq\n- gt\n- lt\n- gte\n- lte\n\nEmbedded data comparison is **not case sensitive** for the values it is inspecting. *EdVAlue* is equivalent to *edvalue*, *EDVALUE*, *eDvaLUE* and so on...\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"transactionDataComparison\"\n}\n[/block]\n**JSON data type**: string\n**Valid values are**:\n- eq\n\nTransaction data comparison is **not case sensitive** for the values it is inspecting. *TdVAlue* is equivalent to *tdvalue*, *TDVALUE*, *tDvaLUE* and so on...\n\n**Important: transactionDataComparison\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"transactionDateComparison\"\n}\n[/block]\n**JSON data type**: dateOrUTCDateTime\n**Valid values are**:\n- gt\n- gte\n- le\n- lte\n\nNote: **on date** can be implemented by AND-ing a **gte** *day-before* with **lte** *day-after*\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"emptyComparison\"\n}\n[/block]\n**JSON data type**: string\n**Valid values are**:\n- empty\n- notEmpty\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"numericComparison\"\n}\n[/block]\n**JSON data type**: string\n**Valid values are**:\n- eq\n- neq\n- gt\n- lt\n- gte\n- lte\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"stringComparison\"\n}\n[/block]\n**JSON data type**: string\n**Valid values are**:\n- startsWith\n- eq\n- neq\n- contains\n- doesNotContain\n\nString comparison is **not case sensitive** for the values it is inspecting. *sEArcH* is equivalent to *search*, *SEARCH*, *SeaRCh* and so on...\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"conjunction\"\n}\n[/block]\n**JSON data type**: string\n**Valid values are**:\n- and\n- or\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"date\"\n}\n[/block]\n**JSON data type**: string\nValue represents a date. The value must match the format **yyyy-MM-dd**.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"dateOrUTCDateTime\"\n}\n[/block]\n**JSON data type**: string\nValue represents a date or a UTC date time. The value must match the format **yyyy-MM-dd HH:mm:ss** or **yyyy-MM-dd**.\n\nIf the string value provided is of the form **yyyy-MM-dd**, then the **HH:mm:ss** will default to **00:00:00**.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"simpleFilters\"\n}\n[/block]\n**JSON data type**: array\nMust have a minimum of two items in the array; there is no maximum.\n\nThe JSON array can contain any combination of [simpleFilterGroup](doc:create-sample-definition#filter-group)(s) and [simple filter criterion](doc:create-sample-definition#simple-filter-criterion).\n\nFor example you could have:\n\n[\n&nbsp;&nbsp;<simpleFilterGroup1>,\n&nbsp;&nbsp;<simpleFilterGroup2>,\n&nbsp;&nbsp;<firstName criterion>\n]\n\nor\n\n[\n&nbsp;&nbsp;<inList criterion>,\n&nbsp;&nbsp;<subscribed criterion>,\n&nbsp;&nbsp;<extRef criterion>\n]\n\nand so on...\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"infoField\"\n}\n[/block]\n**JSON data type**: string\n**Valid values are**:\n- email\n- firstName\n- lastName\n- extRef\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"listId\"\n}\n[/block]\n**JSON data type**: string\nValue must match the regex, **^CG_[0-9a-zA-Z]{11,15}$**\n\nWhen specifying a mailingListId or a sampleId for the filterTypes, **inList** or **inSample**, take care to not associate the value with an incompatible filterType.\n\nAn invalid id value may affect resultant samples.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"nonNegativeInt\"\n}\n[/block]\n**JSON data type**: number\nValue is treated as an integer and must be greater than or equal to 0.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"plainString\"\n}\n[/block]\n**JSON data type**: string\nThere is no minimum or maximum length.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"sampleId\"\n}\n[/block]\n**JSON data type**: string\nValue must match the regex, **^CG_[0-9a-zA-Z]{11,15}$**\n\nWhen specifying a mailingListId or a sampleId for the filterTypes, **inList** or **inSample**, take care to not associate the value with an incompatible filterType.\n\nAn invalid id value may affect resultant samples.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"surveyId\"\n}\n[/block]\n**JSON data type**: string\nValue must match the regex, **^SV_[0-9a-zA-Z]{11,15}$**\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Any Field\"\n}\n[/block]\n**anyField** is a superset of **email**, **firstName**, **lastName** and **extRef**. It does not mean a fuzzy-search like filter on any piece of data belonging to a contact.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Embedded Data\"\n}\n[/block]\nCurrently only a total of **5** embedded data related filterTypes can be included in the **filter**.\nThe **filterTypes** associated with this restriction are _embeddedData_ and _embeddedDataFieldState_.\n\nThe **field** that one provides for the _embeddedData_ or _embeddedDataFieldState_ filters are **case-sensitive**. For example, *edFIEld* is different from *EDFIELD* or *edfield*.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response Rate\"\n}\n[/block]\n\nThe **value** for the **responseRate** filterType should be treated as a percentage out of _100_, i.e. a **value** of _50_ is **50%** and a **value** of _7_ is **7%**.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Average Response Time\"\n}\n[/block]\nThe **value** for the **averageResponseTime** filterType should be treated as the _hours_ it takes for a recipient to respond.\n\nThe **precision** of average response time is limited to **hours**.","excerpt":"Create a sample definition.","slug":"create-sample-definition","type":"endpoint","title":"Create Sample Definition"}

postCreate Sample Definition

Create a sample definition.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

directoryId:
required
string
the directory ID, also known as a pool ID.

Body Params

sampleCriteria:
required
object
The search logic used to build a sample, see below.
maxSampleSize:
required
integer
The maximum size of any sample generated from this definition.

Headers

Content-Type:
required
stringapplication/json
X-API-TOKEN:
required
string
Your api token.

Examples


Result Format


Documentation

[block:callout] { "type": "info", "title": "This API call is only available to Target Audience users." } [/block] [block:callout] { "type": "danger", "title": "The size of the JSON body accepted by this API call is 10kB.", "body": "Formulating a multi-category and deeply nested sample criteria allows one to describe a search with high precision, but it also comes with the pitfall of inadvertently including criteria that are contradictory or impossible to satisfy. We recommend that you keep your sample criteria flat and concise." } [/block] The JSON object represented by the **sampleCriteria** key allows one to specify a single criterion or group and nest criteria. Suppose you have criteria _W_, _X_, _Y_ and _Z_. A correctly constructed **sampleCriteria** key will allow you to specify any of the following and more: - Retrieve contacts which satisfy &nbsp;&nbsp;_W_. - Retrieve contacts which satisfy &nbsp;&nbsp;_X_. - Retrieve contacts which satisfy &nbsp;&nbsp;_Y_. - Retrieve contacts which satisfy &nbsp;&nbsp;_Z_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(W or X)_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(W and X)_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(W or Y)_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(W or Z)_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(X or Y)_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(X and Y)_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(X or Z)_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(W or (X and Y))_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(W or (X and Z))_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(W or (X and (Y or Z)))_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(X and (Y or (Z and W)))_. - Retrieve contacts which satisfy &nbsp;&nbsp;_(X and Y) or (Z and W)_. - **and so on...** [block:callout] { "type": "info", "title": "Constructing the simpleFilter JSON object", "body": "At its core, the JSON object is formed by parameters describing the evaluation of a single criterion or is formed by criteria that are grouped together with a conjunction (_and_, _or_), thereby creating a **filterGroup**." } [/block] [block:api-header] { "type": "basic", "title": "Simple Filter Criterion" } [/block] Below are the supported filter criteria and their associated JSON syntax. Read beyond the table to understand the mechanics of grouping and nesting criteria via a **[filterGroup](doc:create-sample-definition#filter-group)**. [block:parameters] { "data": { "h-0": "Criterion", "h-1": "JSON Syntax", "h-2": "As simpleFilter", "h-3": "As Filter", "0-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"email\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"startsWith\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"pritty\"\n}", "0-0": "email", "0-1": "{\n&nbsp;&nbsp;\"filterType\": \"email\",\n&nbsp;&nbsp;\"comparison\": [stringComparison](doc:create-sample-definition#stringcomparison),\n&nbsp;&nbsp;\"value\": [plainString](doc:create-sample-definition#plainstring)\n}", "0-3": "", "1-0": "first name", "2-0": "last name", "3-0": "external data reference", "4-0": "any field ([Notes](doc:create-sample-definition#any-field))", "1-1": "{\n&nbsp;&nbsp;\"filterType\": \"firstName\",\n&nbsp;&nbsp;\"comparison\": [stringComparison](doc:create-sample-definition#stringcomparison),\n&nbsp;&nbsp;\"value\": [plainString](doc:create-sample-definition#plainstring)\n}", "2-1": "{\n&nbsp;&nbsp;\"filterType\": \"lastName\",\n&nbsp;&nbsp;\"comparison\": [stringComparison](doc:create-sample-definition#stringcomparison),\n&nbsp;&nbsp;\"value\": [plainString](doc:create-sample-definition#plainstring)\n}", "3-1": "{\n&nbsp;&nbsp;\"filterType\": \"extRef\",\n&nbsp;&nbsp;\"comparison\": [stringComparison](doc:create-sample-definition#stringcomparison),\n&nbsp;&nbsp;\"value\": [plainString](doc:create-sample-definition#plainstring)\n}", "4-1": "{\n&nbsp;&nbsp;\"filterType\": \"anyField\",\n&nbsp;&nbsp;\"comparison\": [stringComparison](doc:create-sample-definition#stringcomparison),\n&nbsp;&nbsp;\"value\": [plainString](doc:create-sample-definition#plainstring)\n}", "1-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"firstName\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"eq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"Iain\"\n}", "2-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"lastName\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"neq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"reezy\"\n}", "3-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"extRef\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"contains\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"beryl\"\n}", "4-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"anyField\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"doesNotContain\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"math\"\n}", "5-0": "subscribed", "5-1": "{\n&nbsp;&nbsp;\"filterType\": \"subscribed\",\n&nbsp;&nbsp;\"comparison\": [booleanComparison](doc:create-sample-definition#booleancomparison)\n}", "5-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"subscribed\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": true\n}", "6-0": "embedded data ([Notes](doc:create-sample-definition#embedded-data))", "6-1": "{\n&nbsp;&nbsp;\"filterType\": \"embeddedData\",\n&nbsp;&nbsp;\"comparison\": [embeddedDataComparison](doc:create-sample-definition#embeddeddatacomparison),\n&nbsp;&nbsp;\"field\": [plainString](doc:create-sample-definition#plainstring),\n&nbsp;&nbsp;\"value\": [plainString](doc:create-sample-definition#plainstring)\n}", "6-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"embeddedData\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"eq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"field\": \"citizenship\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"switzerland\"\n}", "10-0": "info field state", "11-0": "embedded data field state ([Notes](doc:create-sample-definition#embedded-data))", "12-0": "in list", "13-0": "in sample", "10-1": "{\n&nbsp;&nbsp;\"filterType\": \"infoFieldState\",\n&nbsp;&nbsp;\"comparison\": [emptyComparison](doc:create-sample-definition#emptycomparison),\n&nbsp;&nbsp;\"field\": [infoField](doc:create-sample-definition#infofield)\n}", "11-1": "{\n&nbsp;&nbsp;\"filterType\": \"embeddedDataFieldState\",\n&nbsp;&nbsp;\"comparison\": [emptyComparison](doc:create-sample-definition#emptycomparison),\n&nbsp;&nbsp;\"field\": [plainString](doc:create-sample-definition#plainstring)\n}", "10-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"infoFieldState\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"empty\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"field\": \"email\"\n}", "11-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"embeddedDataFieldState\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"notEmpty\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"field\": \"edf11\"\n}", "12-1": "{\n&nbsp;&nbsp;\"filterType\": \"inList\",\n&nbsp;&nbsp;\"comparison\": [booleanComparison](doc:create-sample-definition#booleancomparison),\n&nbsp;&nbsp;\"mailingListId\": [listId](doc:create-sample-definition#listid)\n}", "13-1": "{\n&nbsp;&nbsp;\"filterType\": \"inSample\",\n&nbsp;&nbsp;\"comparison\": [booleanComparison](doc:create-sample-definition#booleancomparison),\n&nbsp;&nbsp;\"sampleId\": [sampleId](doc:create-sample-definition#sampleid)\n}", "12-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"inList\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": true,\n&nbsp;&nbsp;&nbsp;&nbsp;\"mailingListId\": \"CG_0CgJ5dUewtIvxIN\"\n}", "13-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"inSample\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": false,\n&nbsp;&nbsp;&nbsp;&nbsp;\"sampleId\": \"CG_77fAbR6TjhDxOKh\"\n}", "14-0": "created", "16-0": "unsubscribe date", "17-0": "last modified date", "18-0": "last email date", "19-0": "last invite date", "20-0": "last response date", "14-1": "{\n&nbsp;&nbsp;\"filterType\": \"created\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\n}", "16-1": "{\n&nbsp;&nbsp;\"filterType\": \"unsubscribeDate\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\n}", "14-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"created\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"eq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2017-03-01 23:18:12\"\n}", "15-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"created\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"neq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2017-03-08\"\n}", "16-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"unsubscribeDate\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"eq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2017-01-20 21:00:11\"\n}", "17-1": "{\n&nbsp;&nbsp;\"filterType\": \"lastModified\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\n}", "18-1": "{\n&nbsp;&nbsp;\"filterType\": \"lastEmail\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\n}", "19-1": "{\n&nbsp;&nbsp;\"filterType\": \"lastInvite\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\n}", "20-1": "{\n&nbsp;&nbsp;\"filterType\": \"lastResponse\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\n}", "17-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"lastModified\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gt\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2013-10-31 23:48:59\"\n}", "18-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"lastEmail\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"lt\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2015-11-30 08:00:00\"\n}", "19-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"lastInvite\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gte\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2016-10-04\"\n}", "20-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"lastResponse\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"lte\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2015-05-20\"\n}", "21-0": "total emails", "22-0": "total invites", "23-0": "total responses", "21-1": "{\n&nbsp;&nbsp;\"filterType\": \"totalEmails\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\n}", "22-1": "{\n&nbsp;&nbsp;\"filterType\": \"totalInvites\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\n}", "23-1": "{\n&nbsp;&nbsp;\"filterType\": \"totalResponses\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [nonNegativeInt](doc:create-sample-definitions#nonnegativeint)\n}", "21-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"totalEmails\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"lte\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 2\n}", "22-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"totalInvites\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gte\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 5\n}", "23-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"totalResponses\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"neq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 7\n}", "24-0": "response rate ([Notes](doc:create-sample-definition#response-rate))", "25-0": "average response time ([Notes](doc:create-sample-definition#average-response-time))", "26-0": "points", "24-1": "{\n&nbsp;&nbsp;\"filterType\": \"responseRate\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\n}", "24-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"responseRate\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gt\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 49\n}", "25-1": "{\n&nbsp;&nbsp;\"filterType\": \"averageResponseTime\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\n}", "25-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"averageResponseTime\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gt\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 2\n}", "26-1": "{\n&nbsp;&nbsp;\"filterType\": \"points\",\n&nbsp;&nbsp;\"comparison\": [numericComparison](doc:create-sample-definition#numericcomparison),\n&nbsp;&nbsp;\"value\": [nonNegativeInt](doc:create-sample-definition#nonnegativeint)\n}", "26-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"points\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"lt\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 27\n}", "7-2": "\"\"simpleFilter\"\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"embeddedData\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gte\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"field\": \"age\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"23\"\n}", "8-0": "transaction data ([Notes](doc:create-sample-definition#transactiondatacomparison))", "8-1": "{\n&nbsp;&nbsp;\"filterType\": \"transactionData\",\n&nbsp;&nbsp;\"comparison\": [transactionDataComparison](doc:create-sample-definition#transactiondatacomparison),\n&nbsp;&nbsp;\"field\": [plainString](doc:create-sample-definition#plainstring),\n&nbsp;&nbsp;\"value\": [plainString](doc:create-sample-definition#plainstring)\n}", "8-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"transactionData\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"eq\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"field\": \"citizenship\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"switzerland\"\n}", "9-2": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"transactionData\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gt\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"field\": \"Q_TransactionDateTime\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"2016-12-04 15:41:34\",\n}", "9-0": "transaction date ([Notes](doc:create-sample-definition#transactiondatecomparison))", "9-1": "{\n&nbsp;&nbsp;\"filterType\": \"transactionData\",\n&nbsp;&nbsp;\"comparison\": [transactionDateComparison](doc:create-sample-definition#transactiondatecomparison),\n&nbsp;&nbsp;\"field\": \"Q_TransactionDateTime\",\n&nbsp;&nbsp;\"value\": [dateOrUTCDateTime](doc:create-sample-definition#dateorutcdatetime)\n}" }, "cols": 3, "rows": 27 } [/block] [block:callout] { "type": "warning", "title": "Leading and trailing spaces", "body": "String values associated with JSON keys that are not **filterType** or **comparison** will have any leading and trailing spaces trimmed off.\n\nThe JSON keys **filterType** and **comparison** have strict values enumerated herein. Any deviation from those values will result in an error being returned in the API response." } [/block] [block:api-header] { "type": "basic", "title": "Filter Group" } [/block] The filter group allows one to create complex and nested criteria. The filter group is equivalent to taking several [simple criterion](doc:create-sample-definition#simple-filter-criterion) (_X_, _Y_, _Z_), inserting a common boolean operator between them, and surrounding the criteria in parentheses, e.g. _(X and Y and Z)_ or _(X or Y or Z)_. Filter groups can be nested within other filter groups, allowing you to produce statements like _(X and (Y or Z))_. [block:parameters] { "data": { "h-0": "simpleFilterGroup JSON Syntax", "h-1": "As simpleFilter", "0-0": "{\n&nbsp;&nbsp;\"conjunction\": [conjunction](doc:create-sample-definition#conjunction),\n&nbsp;&nbsp;\"filters\": [simpleFilters](doc:create-sample-definition#simplefilters)\n}", "0-1": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"conjunction\": \"or\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"filters\": [\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"eq\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"lastName\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"test\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gte\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"totalEmails\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 7\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;]\n}", "1-1": "\"simpleFilter\": {\n&nbsp;&nbsp;&nbsp;&nbsp;\"conjunction\": \"or\",\n&nbsp;&nbsp;&nbsp;&nbsp;\"filters\": [\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"eq\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"lastName\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"test\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"gte\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"totalEmails\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"value\": 7\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"conjunction\": \"and\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"filters\": [\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": \"lte\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"embeddedData\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"field\": \"experience\",\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"value\": \"13\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"comparison\": true,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"filterType\": \"subscribed\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n&nbsp;&nbsp;&nbsp;&nbsp;]\n}" }, "cols": 2, "rows": 2 } [/block] [block:callout] { "type": "danger", "title": "Valid associations between filter, filterGroup and filters", "body": "**simpleFilter** => **simpleFilterGroup** <===> **simpleFilters**\n\nOne cannot mix and match between these associations." } [/block] [block:api-header] { "type": "basic", "title": "booleanComparison" } [/block] **JSON data type**: boolean **Valid values are**: - true - false [block:api-header] { "type": "basic", "title": "embeddedDataComparison" } [/block] **JSON data type**: string **Valid values are**: - contains - doesNotContain - eq - neq - gt - lt - gte - lte Embedded data comparison is **not case sensitive** for the values it is inspecting. *EdVAlue* is equivalent to *edvalue*, *EDVALUE*, *eDvaLUE* and so on... [block:api-header] { "type": "basic", "title": "transactionDataComparison" } [/block] **JSON data type**: string **Valid values are**: - eq Transaction data comparison is **not case sensitive** for the values it is inspecting. *TdVAlue* is equivalent to *tdvalue*, *TDVALUE*, *tDvaLUE* and so on... **Important: transactionDataComparison [block:api-header] { "type": "basic", "title": "transactionDateComparison" } [/block] **JSON data type**: dateOrUTCDateTime **Valid values are**: - gt - gte - le - lte Note: **on date** can be implemented by AND-ing a **gte** *day-before* with **lte** *day-after* [block:api-header] { "type": "basic", "title": "emptyComparison" } [/block] **JSON data type**: string **Valid values are**: - empty - notEmpty [block:api-header] { "type": "basic", "title": "numericComparison" } [/block] **JSON data type**: string **Valid values are**: - eq - neq - gt - lt - gte - lte [block:api-header] { "type": "basic", "title": "stringComparison" } [/block] **JSON data type**: string **Valid values are**: - startsWith - eq - neq - contains - doesNotContain String comparison is **not case sensitive** for the values it is inspecting. *sEArcH* is equivalent to *search*, *SEARCH*, *SeaRCh* and so on... [block:api-header] { "type": "basic", "title": "conjunction" } [/block] **JSON data type**: string **Valid values are**: - and - or [block:api-header] { "type": "basic", "title": "date" } [/block] **JSON data type**: string Value represents a date. The value must match the format **yyyy-MM-dd**. [block:api-header] { "type": "basic", "title": "dateOrUTCDateTime" } [/block] **JSON data type**: string Value represents a date or a UTC date time. The value must match the format **yyyy-MM-dd HH:mm:ss** or **yyyy-MM-dd**. If the string value provided is of the form **yyyy-MM-dd**, then the **HH:mm:ss** will default to **00:00:00**. [block:api-header] { "type": "basic", "title": "simpleFilters" } [/block] **JSON data type**: array Must have a minimum of two items in the array; there is no maximum. The JSON array can contain any combination of [simpleFilterGroup](doc:create-sample-definition#filter-group)(s) and [simple filter criterion](doc:create-sample-definition#simple-filter-criterion). For example you could have: [ &nbsp;&nbsp;<simpleFilterGroup1>, &nbsp;&nbsp;<simpleFilterGroup2>, &nbsp;&nbsp;<firstName criterion> ] or [ &nbsp;&nbsp;<inList criterion>, &nbsp;&nbsp;<subscribed criterion>, &nbsp;&nbsp;<extRef criterion> ] and so on... [block:api-header] { "type": "basic", "title": "infoField" } [/block] **JSON data type**: string **Valid values are**: - email - firstName - lastName - extRef [block:api-header] { "type": "basic", "title": "listId" } [/block] **JSON data type**: string Value must match the regex, **^CG_[0-9a-zA-Z]{11,15}$** When specifying a mailingListId or a sampleId for the filterTypes, **inList** or **inSample**, take care to not associate the value with an incompatible filterType. An invalid id value may affect resultant samples. [block:api-header] { "type": "basic", "title": "nonNegativeInt" } [/block] **JSON data type**: number Value is treated as an integer and must be greater than or equal to 0. [block:api-header] { "type": "basic", "title": "plainString" } [/block] **JSON data type**: string There is no minimum or maximum length. [block:api-header] { "type": "basic", "title": "sampleId" } [/block] **JSON data type**: string Value must match the regex, **^CG_[0-9a-zA-Z]{11,15}$** When specifying a mailingListId or a sampleId for the filterTypes, **inList** or **inSample**, take care to not associate the value with an incompatible filterType. An invalid id value may affect resultant samples. [block:api-header] { "type": "basic", "title": "surveyId" } [/block] **JSON data type**: string Value must match the regex, **^SV_[0-9a-zA-Z]{11,15}$** [block:api-header] { "type": "basic", "title": "Any Field" } [/block] **anyField** is a superset of **email**, **firstName**, **lastName** and **extRef**. It does not mean a fuzzy-search like filter on any piece of data belonging to a contact. [block:api-header] { "type": "basic", "title": "Embedded Data" } [/block] Currently only a total of **5** embedded data related filterTypes can be included in the **filter**. The **filterTypes** associated with this restriction are _embeddedData_ and _embeddedDataFieldState_. The **field** that one provides for the _embeddedData_ or _embeddedDataFieldState_ filters are **case-sensitive**. For example, *edFIEld* is different from *EDFIELD* or *edfield*. [block:api-header] { "type": "basic", "title": "Response Rate" } [/block] The **value** for the **responseRate** filterType should be treated as a percentage out of _100_, i.e. a **value** of _50_ is **50%** and a **value** of _7_ is **7%**. [block:api-header] { "type": "basic", "title": "Average Response Time" } [/block] The **value** for the **averageResponseTime** filterType should be treated as the _hours_ it takes for a recipient to respond. The **precision** of average response time is limited to **hours**.

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