{"_id":"56b8c921ddeb231700e69842","version":{"_id":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":12,"createdAt":"2016-01-20T14:43:02.785Z","releaseDate":"2016-01-20T14:43:02.785Z","categories":["569f9cf7650e1d1900f96b5f","56abdd81d4432d1900eed235","56abe0558beeff0d003b8118","56ad2f8b1c09150d00a183a8","56ad4e1cd21f1b0d00fd2f97","56b00ad88f7a4f0d0029dc92","56b2432e9621f20d00efb2bd","56b25826147e900d00d6497a","56b7af2a4b372d2100722c48","56b8c4d938b1070d0028920f","56b8cdab14feef0d0082415d","58599813cf9e112d0032cdab"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":23,"category":{"_id":"56b8c4d938b1070d0028920f","project":"569f9cf6650e1d1900f96b5b","version":"569f9cf6650e1d1900f96b5e","pages":["56b8c5018a9e7c0d004bb189","56b8c55d38b1070d00289210","56b8c7f338b1070d00289219"],"__v":3,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-08T16:39:53.889Z","from_sync":false,"order":9,"slug":"stats-methods","title":"Stats methods"},"githubsync":"","user":"5582e90181672a3900bb4fc7","project":"569f9cf6650e1d1900f96b5b","parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-08T16:58:09.250Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    <credentials object>\\n    \\\"type\\\": company | domain | user,\\n    \\\"object\\\": <name of the company, domain or user>, \\n    \\\"by\\\": day | week | month\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request fields for stats_summary\"\n}\n[/block]\nThe following fields can be used in the **stats_summary** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"by\",\n    \"0-1\": \"Optional\",\n    \"0-2\": \"The interval that you want displayed in the response for the statistics summary. Allowed values are **day, week,** and **month.** \\n\\n  * **day**—Display information for each of the most recent 30 days.\\n\\n  * **week**—Display information for each of the most recent 52 weeks;; each week begins on a Monday.\\n\\n  * **month**—Display information for the most recent 48 months.\",\n    \"1-0\": \"object\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"The name of the company, domain, or user for which you want to view statistics.\",\n    \"2-0\": \"type\",\n    \"2-1\": \"Optional\",\n    \"2-2\": \"The type of object. Allowed values are **company, domain**, or **user**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for stats_summary\"\n}\n[/block]\nThe following fields may be returned in response to the **stats_summary**\nmethod:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"error\",\n    \"0-1\": \"Returned if **success = false**\",\n    \"0-2\": \"A text string that explains the error.\",\n    \"1-0\": \"error_number\",\n    \"1-1\": \"Returned if **success = false**\",\n    \"1-2\": \"A number that represents the error.\",\n    \"2-0\": \"success\",\n    \"2-1\": \"Always returned\",\n    \"2-2\": \"Indicates whether the request was successful or not. Allowed values are **true** and **false**.\",\n    \"3-0\": \"summary\",\n    \"3-1\": \"Returned if **success = true**\",\n    \"3-2\": \"Lists the statistics for the periods specified in the **by** field in the request: **day, week,** or **month**.\\n\\nFor more information, see the \\\"**Summary fields**\\\" table below.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n## Summary fields \n\nThe following fields may be returned within the **summary** array.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"deleted_users\",\n    \"0-1\": \"Returned if **success = true**\",\n    \"0-2\": \"Lists information about deleted accounts.\\n\\n  * **storage_items_stored**—The aggregate number of messages held in these deleted accounts.\\n  \\n  * **storage_current_size**—The aggregate size (in bytes) of messages held in these deleted accounts.\",\n    \"1-0\": \"logins\",\n    \"1-1\": \"Returned if **success = true**\",\n    \"1-2\": \"Lists information about logins during the specified period.\\n\\n  * **imap4**—The number of logins via IMAP4 protocol during the period.\\n  \\n  * **pop3**—The number of logins via POP3 during the period.\\n  \\n  * **webmail**—The number of logins via Webmail during the period.\",\n    \"2-0\": \"messages\",\n    \"2-1\": \"Returned if **success = true**\",\n    \"2-2\": \"Lists information about messages sent and received during the specified period.\\n\\n  * **autorespond_count**—The number of auto-responses sent in the period. \\n  \\n  * **denied**—The number of inbound messages rejected in the period.\\n  \\n  * **forward_count**—The number of messages forwarded in the period.\\n  \\n  * **in_ham**—The number of messages received in the period that were not spam.\\n  \\n  * **in_size**—The number of bytes in messages received in the period, (not including spam).\\n  \\n  * **in_spam**—The number of spam messages received in the period.\\n  \\n  * **out_msg_count**—The number of messages sent in the period.\\n  \\n  * **out_rcpt_count**—The number of recipients to whom messages were sent in the period.\\n  \\n  * **out_size**—The number of bytes in messages sent in the period.\",\n    \"3-0\": \"services\",\n    \"3-1\": \"Returned if **success = true**\",\n    \"3-2\": \"Specifies the number of users for each service during the specified period.\\n\\n  * **smtprelay**—The number of users with this service enabled in the period.\\n  \\n  * **smtpin**—The number of users with this service enabled in the period.\\n  \\n  * **imap4**—The number of users with this service enabled in the period.\\n  \\n  * **pop3**—The number of users with this service enabled in the period.\\n  \\n  * **webmail**—The number of users with this service enabled in the period.\",\n    \"4-0\": \"storage\",\n    \"4-1\": \"Returned if **success = true**\",\n    \"4-2\": \"Displays information about messages stored.\\n\\n  * **items_stored**—The number of messages stored.\\n  \\n  * **current_size**—The total size (in bytes) of stored messages.\",\n    \"5-0\": \"users\",\n    \"5-1\": \"Returned if **success = true**\",\n    \"5-2\": \"Displays the number of users for each account type during the specified period.\\n\\n  * **filter**—The number of filter only users.\\n  \\n  * **forward**—The number of forward only users.\\n  \\n  * **deleted**—The number of recoverable (soft-deleted) users.\\n  \\n  * **mailbox**—The number of regular mailboxes.\\n  \\n  * **alias**—The number of aliases.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for stats_summary\"\n}\n[/block]\n## Example 1\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin:::at:::example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\n  },\\n  \\\"object\\\": \\\"example.com\\\",\\n  \\\"type\\\": \\\"domain\\\",\\n  \\\"by\\\": \\\"day\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\t\\\"success\\\": true,\\n  \\t\\\"summary\\\": {\\n    \\t\\\"20111219\\\": {\\n      \\t\\\"messages\\\": {\\n\\t\\t\\t\\t\\\"autorespond_count\\\": 0, \\n      \\t\\\"in_size\\\": 0, \\n      \\t\\\"out_msg_count\\\": 0, \\n      \\t\\\"in_spam\\\": 0, \\n      \\t\\\"out_size\\\": 0, \\n      \\t\\\"forward_count\\\": 0, \\n      \\t\\\"in_ham\\\": 0, \\n      \\t\\\"out_rcpt_count\\\": 0, \\n      \\t\\\"denied\\\": 0\\n\\t\\t\\t},\\n    \\t\\\"services\\\": {\\n    \\t\\t\\\"smtprelay\\\": 10,\\n    \\t\\t\\\"smtpin\\\": 10,\\n    \\t\\t\\\"imap4\\\": 10,\\n    \\t\\t\\\"pop3\\\": 10,\\n    \\t\\t\\\"webmail\\\": 10\\n  \\t\\t},\\n  \\t\\t\\\"deleted_users\\\": {\\n    \\t\\t\\\"storage_items_stored\\\": 0,\\n    \\t\\t\\\"storage_current_size\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"users\\\": {\\n    \\t\\t\\\"filter\\\": 0,\\n    \\t\\t\\\"forward\\\": 2,\\n    \\t\\t\\\"deleted\\\": 1,\\n    \\t\\t\\\"mailbox\\\": 7,\\n    \\t\\t\\\"alias\\\": 1\\n  \\t\\t},\\n  \\t\\t\\\"logins\\\": {\\n    \\t\\t\\\"imap4\\\": 0,\\n    \\t\\t\\\"pop3\\\": 0,\\n    \\t\\t\\\"webmail\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"storage\\\": {\\n    \\t\\t\\\"items_stored\\\": 6,\\n    \\t\\t\\\"current_size\\\": 141653\\n  \\t\\t}\\n\\t\\t},\\n\\t\\t\\\"20111228\\\": {\\n\\t\\t\\t\\\"messages\\\": { \\n    \\t\\t\\\"autorespond_count\\\": 0,\\n    \\t\\t\\\"in_size\\\": 0,\\n    \\t\\t\\\"out_msg_count\\\": 0,\\n    \\t\\t\\\"in_spam\\\": 0,\\n    \\t\\t\\\"out_size\\\": 0,\\n      \\t\\\"forward_count\\\": 0,\\n    \\t\\t\\\"in_ham\\\": 0,\\n    \\t\\t\\\"out_rcpt_count\\\": 0,\\n    \\t\\t\\\"denied\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"services\\\": {\\n    \\t\\t\\\"smtprelay\\\": 10,\\n    \\t\\t\\\"smtpin\\\": 10,\\n    \\t\\t\\\"imap4\\\": 10,\\n    \\t\\t\\\"pop3\\\": 10,\\n    \\t\\t\\\"webmail\\\": 10\\n  \\t\\t},\\n  \\t\\t\\\"deleted_users\\\": {\\n    \\t\\t\\\"storage_items_stored\\\": 0,\\n    \\t\\t\\\"storage_current_size\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"users\\\": {\\n    \\t\\t\\\"filter\\\": 0,\\n    \\t\\t\\\"forward\\\": 2,\\n    \\t\\t\\\"deleted\\\": 1,\\n    \\t\\t\\\"mailbox\\\": 7,\\n    \\t\\t\\\"alias\\\": 1\\n  \\t\\t},\\n  \\t\\t\\\"logins\\\": {\\n    \\t\\t\\\"imap4\\\": 0,\\n    \\t\\t\\\"pop3\\\": 0,\\n    \\t\\t\\\"webmail\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"storage\\\": {\\n    \\t\\t\\\"items_stored\\\": 6,\\n    \\t\\t\\\"current_size\\\": 141653\\n  \\t\\t}\\n\\t\\t},\\n\\t\\t\\\"20120106\\\": {\\n  \\t\\t\\\"messages\\\": {\\n    \\t\\t\\\"autorespond_count\\\": 0, \\n      \\t\\\"in_size\\\": 0, \\n      \\t\\\"out_msg_count\\\": 0, \\n      \\t\\\"in_spam\\\": 0, \\n      \\t\\\"out_size\\\": 0, \\n      \\t\\\"forward_count\\\": 0, \\n      \\t\\\"in_ham\\\": 0, \\n      \\t\\\"out_rcpt_count\\\": 0, \\n      \\t\\\"denied\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"services\\\": {\\n  \\t\\t\\t\\\"smtprelay\\\": 11,\\n  \\t\\t\\t\\\"smtpin\\\": 11,\\n  \\t\\t\\t\\\"imap4\\\": 11,\\n  \\t\\t\\t\\\"pop3\\\": 11,\\n  \\t\\t\\t\\\"webmail\\\": 11\\n\\t\\t\\t},\\n\\t\\t\\t\\\"deleted_users\\\": {\\n  \\t\\t\\t\\\"storage_items_stored\\\": 0,\\n  \\t\\t\\t\\\"storage_current_size\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"users\\\": {\\n  \\t\\t\\t\\\"filter\\\": 0,\\n  \\t\\t\\t\\\"forward\\\": 2,\\n  \\t\\t\\t\\\"deleted\\\": 1,\\n  \\t\\t\\t\\\"mailbox\\\": 8,\\n  \\t\\t\\t\\\"alias\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"logins\\\": {\\n  \\t\\t\\t\\\"imap4\\\": 0,\\n  \\t\\t\\t\\\"pop3\\\": 0,\\n  \\t\\t\\t\\\"webmail\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"storage\\\": {\\n  \\t\\t\\t\\\"items_stored\\\": 7,\\n      \\t\\\"current_size\\\": 142017\\n    \\t}\\n\\t\\t},\\n\\t\\t\\\"20111215\\\": {\\n\\t\\t\\t\\\"messages\\\": { \\n    \\t\\t\\\"autorespond_count\\\": 0,\\n    \\t\\t\\\"in_size\\\": 0,\\n    \\t\\t\\\"out_msg_count\\\": 0,\\n    \\t\\t\\\"in_spam\\\": 0,\\n    \\t\\t\\\"out_size\\\": 0,\\n    \\t\\t\\\"forward_count\\\": 0,\\n    \\t\\t\\\"in_ham\\\": 0,\\n    \\t\\t\\\"out_rcpt_count\\\": 0,\\n    \\t\\t\\\"denied\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"services\\\": {\\n    \\t\\t\\\"smtprelay\\\": 10,\\n    \\t\\t\\\"smtpin\\\": 10,\\n    \\t\\t\\\"imap4\\\": 10,\\n    \\t\\t\\\"pop3\\\": 10,\\n    \\t\\t\\\"webmail\\\": 10\\n  \\t\\t},\\n  \\t\\t\\\"deleted_users\\\": {\\n    \\t\\t\\\"storage_items_stored\\\": 0,\\n    \\t\\t\\\"storage_current_size\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"users\\\": {\\n    \\t\\t\\\"filter\\\": 0,\\n    \\t\\t\\\"forward\\\": 2,\\n    \\t\\t\\\"deleted\\\": 1,\\n    \\t\\t\\\"mailbox\\\": 7,\\n    \\t\\t\\\"alias\\\": 1\\n  \\t\\t},\\n  \\t\\t\\\"logins\\\": {\\n\\t\\t\\t\\t\\\"imap4\\\": 0,\\n      \\t\\\"pop3\\\": 0,\\n  \\t\\t\\t\\\"webmail\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"storage\\\": {\\n  \\t\\t\\t\\\"items_stored\\\": 6,\\n  \\t\\t\\t\\\"current_size\\\": 141653\\n\\t\\t\\t}\\n    \\t\\t\\t\\\"20111221\\\": \\n  \\t{\\n\\t\\t\\t\\\"messages\\\": {\\n\\t\\t\\t\\t\\\"autorespond_count\\\": 0, \\n      \\t\\\"in_size\\\": 0, \\n      \\t\\\"out_msg_count\\\": 0, \\n      \\t\\\"in_spam\\\": 0, \\n      \\t\\\"out_size\\\": 0, \\n      \\t\\\"forward_count\\\": 0, \\n      \\t\\\"in_ham\\\": 0, \\n      \\t\\\"out_rcpt_count\\\": 0, \\n      \\t\\\"denied\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"services\\\": {\\n  \\t\\t\\t\\\"smtprelay\\\": 10,\\n  \\t\\t\\t\\\"smtpin\\\": 10,\\n  \\t\\t\\t\\\"imap4\\\": 10,\\n  \\t\\t\\t\\\"pop3\\\": 10,\\n  \\t\\t\\t\\\"webmail\\\": 10\\n\\t\\t\\t},\\n\\t\\t\\t\\\"deleted_users\\\": {\\n  \\t\\t\\t\\\"storage_items_stored\\\": 0,\\n  \\t\\t\\t\\\"storage_current_size\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"users\\\": {\\n  \\t\\t\\t\\\"filter\\\": 0,\\n  \\t\\t\\t\\\"forward\\\": 2,\\n  \\t\\t\\t\\\"deleted\\\": 1,\\n  \\t\\t\\t\\\"mailbox\\\": 7,\\n    \\t\\t\\\"alias\\\": 1 \\n  \\t\\t},\\n  \\t\\t\\\"logins\\\": {\\n    \\t\\t\\\"imap4\\\": 0,\\n    \\t\\t\\\"pop3\\\": 0,\\n    \\t\\t\\\"webmail\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"storage\\\": {\\n    \\t\\t\\\"items_stored\\\": 6,\\n    \\t\\t\\\"current_size\\\": 141653\\n  \\t\\t}\\n\\t\\t},\\n\\t\\t \\t\\t ...\\n\\t\\t\\\"20111229\\\": {\\n  \\t\\t\\\"messages\\\": {\\n\\t\\t\\t\\t\\\"autorespond_count\\\": 0, \\n  \\t\\t\\t\\\"in_size\\\": 0, \\n  \\t\\t\\t\\\"out_msg_count\\\": 0, \\n  \\t\\t\\t\\\"in_spam\\\": 0, \\n  \\t\\t\\t\\\"out_size\\\": 0, \\n  \\t\\t\\t\\\"forward_count\\\": 0, \\n  \\t\\t\\t\\\"in_ham\\\": 0, \\n  \\t\\t\\t\\\"out_rcpt_count\\\": 0, \\n  \\t\\t\\t\\\"denied\\\": 0\\n  \\t\\t},\\n  \\t\\t\\\"services\\\": {\\n    \\t\\t\\\"smtprelay\\\": 10,\\n    \\t\\t\\\"smtpin\\\": 10,\\n    \\t\\t\\\"imap4\\\": 10,\\n    \\t\\t\\\"pop3\\\": 10,\\n    \\t\\t\\\"webmail\\\": 10\\n  \\t\\t},\\n  \\t\\t\\\"deleted_users\\\": {\\n    \\t\\t\\\"storage_items_stored\\\": 0,\\n    \\t\\t\\\"storage_current_size\\\": 0\\n  \\t\\t}, \\n  \\t\\t\\\"users\\\": {\\n  \\t\\t\\t\\\"filter\\\": 0,\\n  \\t\\t\\t\\\"forward\\\": 2,\\n  \\t\\t\\t\\\"deleted\\\": 1,\\n  \\t\\t\\t\\\"mailbox\\\": 7,\\n  \\t\\t\\t\\\"alias\\\": 1\\n\\t\\t\\t},\\n\\t\\t\\t\\\"logins\\\": {\\n  \\t\\t\\t\\\"imap4\\\": 0,\\n  \\t\\t\\t\\\"pop3\\\": 0,\\n  \\t\\t\\t\\\"webmail\\\": 0\\n\\t\\t\\t},\\n\\t\\t\\t\\\"storage\\\": {\\n  \\t\\t\\t\\\"items_stored\\\": 6,\\n  \\t\\t\\t\\\"current_size\\\": 141653\\n\\t\\t\\t}\\n \\t \\t} \\n  }\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 2\n\nDisplays daily summary statistics for user joe_user@example.com.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin@example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\n  },\\n  \\\"object\\\": \\\"joe_user@example.com\\\",\\n  \\\"type\\\": \\\"user\\\",\\n  \\\"by\\\": \\\"day\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\":true,\\n  \\\"summary\\\":{\\n    \\\"20120111\\\":{\\n      \\\"messages\\\":{\\n        \\\"in_size\\\":\\\"\\\",\\n        \\\"out_msg_count\\\":\\\"\\\",\\n        \\\"in_spam\\\":\\\"\\\",\\n        \\\"autorespond_count\\\":\\\"\\\",\\n        \\\"out_size\\\":\\\"\\\",\\n        \\\"forward_count\\\":\\\"\\\",\\n        \\\"in_ham\\\":\\\"\\\",\\n        \\\"out_rcpt_count\\\":\\\"\\\",\\n        \\\"denied\\\":\\\"\\\"},\\n      \\\"services\\\":{\\n        \\\"smtprelay\\\":\\\"enabled\\\",\\n        \\\"smtpin\\\":\\\"enabled\\\",\\n        \\\"imap4\\\":\\\"enabled\\\",\\n        \\\"pop3\\\":\\\"enabled\\\",\\n        \\\"webmail\\\":\\\"enabled\\\"},\\n      \\\"delivery\\\":{\\n        \\\"autoresponder\\\":\\\"1\\\",\\n        \\\"fonly\\\":\\\"0\\\"},\\n\\t\\t\\t\\\"forward\\\":\\\"z@b.com\\\",\\n\\t\\t\\t\\\"createtime\\\":\\\"Thu Jul 21 17:46:22 2011 UTC\\\", \\n      \\\"workgroup\\\":\\\"staff\\\", \\n      \\\"account_type\\\":\\\"mailbox\\\",\\n\\t\\t\\t\\\"logins\\\":{\\n\\t\\t\\t\\t\\\"last_imap4\\\":\\\"Fri Dec 9 01:16:12 2011 UTC\\\", \\n        \\\"imap4\\\":\\\"\\\",\\n\\t\\t\\t\\t\\\"auth_token\\\":\\\"\\\",\\n\\t\\t\\t\\t\\\"webmail\\\":\\\"\\\",\\n\\t\\t\\t\\t\\\"last_webmail\\\":\\\"Fri Jan 6 18:00:33 2012 UTC\\\", \\n        \\\"auth_password\\\":\\\"\\\",\\n        \\\"pop3\\\":\\\"\\\",\\n\\t\\t\\t\\t\\\"last_pop3\\\":\\\"Fri Dec 9 01:31:09 2011 UTC\\\", \\n        \\\"last_smtprelay\\\":\\\"Thu Jun 9 16:50:46 2011 UTC\\\", \\n        \\\"last_smtpin\\\":\\\"Mon Nov 21 19:54:05 2011 UTC\\\"},\\n      \\\"storage\\\":{\\n        \\\"items_stored\\\":\\\"31\\\",\\n        \\\"allowed_size\\\":\\\"6442450944\\\",\\n        \\\"current_size\\\":\\\"733839\\\"},\\n      \\\"deletetime\\\":\\\"\\\"\\n    },\\n\\t ...  \\n\\t}\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **stats_summary** method displays summary statistics for a user, domain, or company.","slug":"stats_summary","type":"basic","title":"stats_summary"}

stats_summary

The **stats_summary** method displays summary statistics for a user, domain, or company.

## Syntax [block:code] { "codes": [ { "code": "{\n <credentials object>\n \"type\": company | domain | user,\n \"object\": <name of the company, domain or user>, \n \"by\": day | week | month\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for stats_summary" } [/block] The following fields can be used in the **stats_summary** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "by", "0-1": "Optional", "0-2": "The interval that you want displayed in the response for the statistics summary. Allowed values are **day, week,** and **month.** \n\n * **day**—Display information for each of the most recent 30 days.\n\n * **week**—Display information for each of the most recent 52 weeks;; each week begins on a Monday.\n\n * **month**—Display information for the most recent 48 months.", "1-0": "object", "1-1": "Optional", "1-2": "The name of the company, domain, or user for which you want to view statistics.", "2-0": "type", "2-1": "Optional", "2-2": "The type of object. Allowed values are **company, domain**, or **user**." }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for stats_summary" } [/block] The following fields may be returned in response to the **stats_summary** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "error", "0-1": "Returned if **success = false**", "0-2": "A text string that explains the error.", "1-0": "error_number", "1-1": "Returned if **success = false**", "1-2": "A number that represents the error.", "2-0": "success", "2-1": "Always returned", "2-2": "Indicates whether the request was successful or not. Allowed values are **true** and **false**.", "3-0": "summary", "3-1": "Returned if **success = true**", "3-2": "Lists the statistics for the periods specified in the **by** field in the request: **day, week,** or **month**.\n\nFor more information, see the \"**Summary fields**\" table below." }, "cols": 3, "rows": 4 } [/block] ## Summary fields The following fields may be returned within the **summary** array. [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "deleted_users", "0-1": "Returned if **success = true**", "0-2": "Lists information about deleted accounts.\n\n * **storage_items_stored**—The aggregate number of messages held in these deleted accounts.\n \n * **storage_current_size**—The aggregate size (in bytes) of messages held in these deleted accounts.", "1-0": "logins", "1-1": "Returned if **success = true**", "1-2": "Lists information about logins during the specified period.\n\n * **imap4**—The number of logins via IMAP4 protocol during the period.\n \n * **pop3**—The number of logins via POP3 during the period.\n \n * **webmail**—The number of logins via Webmail during the period.", "2-0": "messages", "2-1": "Returned if **success = true**", "2-2": "Lists information about messages sent and received during the specified period.\n\n * **autorespond_count**—The number of auto-responses sent in the period. \n \n * **denied**—The number of inbound messages rejected in the period.\n \n * **forward_count**—The number of messages forwarded in the period.\n \n * **in_ham**—The number of messages received in the period that were not spam.\n \n * **in_size**—The number of bytes in messages received in the period, (not including spam).\n \n * **in_spam**—The number of spam messages received in the period.\n \n * **out_msg_count**—The number of messages sent in the period.\n \n * **out_rcpt_count**—The number of recipients to whom messages were sent in the period.\n \n * **out_size**—The number of bytes in messages sent in the period.", "3-0": "services", "3-1": "Returned if **success = true**", "3-2": "Specifies the number of users for each service during the specified period.\n\n * **smtprelay**—The number of users with this service enabled in the period.\n \n * **smtpin**—The number of users with this service enabled in the period.\n \n * **imap4**—The number of users with this service enabled in the period.\n \n * **pop3**—The number of users with this service enabled in the period.\n \n * **webmail**—The number of users with this service enabled in the period.", "4-0": "storage", "4-1": "Returned if **success = true**", "4-2": "Displays information about messages stored.\n\n * **items_stored**—The number of messages stored.\n \n * **current_size**—The total size (in bytes) of stored messages.", "5-0": "users", "5-1": "Returned if **success = true**", "5-2": "Displays the number of users for each account type during the specified period.\n\n * **filter**—The number of filter only users.\n \n * **forward**—The number of forward only users.\n \n * **deleted**—The number of recoverable (soft-deleted) users.\n \n * **mailbox**—The number of regular mailboxes.\n \n * **alias**—The number of aliases." }, "cols": 3, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Examples for stats_summary" } [/block] ## Example 1 **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n \"object\": \"example.com\",\n \"type\": \"domain\",\n \"by\": \"day\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \t\"success\": true,\n \t\"summary\": {\n \t\"20111219\": {\n \t\"messages\": {\n\t\t\t\t\"autorespond_count\": 0, \n \t\"in_size\": 0, \n \t\"out_msg_count\": 0, \n \t\"in_spam\": 0, \n \t\"out_size\": 0, \n \t\"forward_count\": 0, \n \t\"in_ham\": 0, \n \t\"out_rcpt_count\": 0, \n \t\"denied\": 0\n\t\t\t},\n \t\"services\": {\n \t\t\"smtprelay\": 10,\n \t\t\"smtpin\": 10,\n \t\t\"imap4\": 10,\n \t\t\"pop3\": 10,\n \t\t\"webmail\": 10\n \t\t},\n \t\t\"deleted_users\": {\n \t\t\"storage_items_stored\": 0,\n \t\t\"storage_current_size\": 0\n \t\t},\n \t\t\"users\": {\n \t\t\"filter\": 0,\n \t\t\"forward\": 2,\n \t\t\"deleted\": 1,\n \t\t\"mailbox\": 7,\n \t\t\"alias\": 1\n \t\t},\n \t\t\"logins\": {\n \t\t\"imap4\": 0,\n \t\t\"pop3\": 0,\n \t\t\"webmail\": 0\n \t\t},\n \t\t\"storage\": {\n \t\t\"items_stored\": 6,\n \t\t\"current_size\": 141653\n \t\t}\n\t\t},\n\t\t\"20111228\": {\n\t\t\t\"messages\": { \n \t\t\"autorespond_count\": 0,\n \t\t\"in_size\": 0,\n \t\t\"out_msg_count\": 0,\n \t\t\"in_spam\": 0,\n \t\t\"out_size\": 0,\n \t\"forward_count\": 0,\n \t\t\"in_ham\": 0,\n \t\t\"out_rcpt_count\": 0,\n \t\t\"denied\": 0\n \t\t},\n \t\t\"services\": {\n \t\t\"smtprelay\": 10,\n \t\t\"smtpin\": 10,\n \t\t\"imap4\": 10,\n \t\t\"pop3\": 10,\n \t\t\"webmail\": 10\n \t\t},\n \t\t\"deleted_users\": {\n \t\t\"storage_items_stored\": 0,\n \t\t\"storage_current_size\": 0\n \t\t},\n \t\t\"users\": {\n \t\t\"filter\": 0,\n \t\t\"forward\": 2,\n \t\t\"deleted\": 1,\n \t\t\"mailbox\": 7,\n \t\t\"alias\": 1\n \t\t},\n \t\t\"logins\": {\n \t\t\"imap4\": 0,\n \t\t\"pop3\": 0,\n \t\t\"webmail\": 0\n \t\t},\n \t\t\"storage\": {\n \t\t\"items_stored\": 6,\n \t\t\"current_size\": 141653\n \t\t}\n\t\t},\n\t\t\"20120106\": {\n \t\t\"messages\": {\n \t\t\"autorespond_count\": 0, \n \t\"in_size\": 0, \n \t\"out_msg_count\": 0, \n \t\"in_spam\": 0, \n \t\"out_size\": 0, \n \t\"forward_count\": 0, \n \t\"in_ham\": 0, \n \t\"out_rcpt_count\": 0, \n \t\"denied\": 0\n\t\t\t},\n\t\t\t\"services\": {\n \t\t\t\"smtprelay\": 11,\n \t\t\t\"smtpin\": 11,\n \t\t\t\"imap4\": 11,\n \t\t\t\"pop3\": 11,\n \t\t\t\"webmail\": 11\n\t\t\t},\n\t\t\t\"deleted_users\": {\n \t\t\t\"storage_items_stored\": 0,\n \t\t\t\"storage_current_size\": 0\n\t\t\t},\n\t\t\t\"users\": {\n \t\t\t\"filter\": 0,\n \t\t\t\"forward\": 2,\n \t\t\t\"deleted\": 1,\n \t\t\t\"mailbox\": 8,\n \t\t\t\"alias\": 0\n\t\t\t},\n\t\t\t\"logins\": {\n \t\t\t\"imap4\": 0,\n \t\t\t\"pop3\": 0,\n \t\t\t\"webmail\": 0\n\t\t\t},\n\t\t\t\"storage\": {\n \t\t\t\"items_stored\": 7,\n \t\"current_size\": 142017\n \t}\n\t\t},\n\t\t\"20111215\": {\n\t\t\t\"messages\": { \n \t\t\"autorespond_count\": 0,\n \t\t\"in_size\": 0,\n \t\t\"out_msg_count\": 0,\n \t\t\"in_spam\": 0,\n \t\t\"out_size\": 0,\n \t\t\"forward_count\": 0,\n \t\t\"in_ham\": 0,\n \t\t\"out_rcpt_count\": 0,\n \t\t\"denied\": 0\n \t\t},\n \t\t\"services\": {\n \t\t\"smtprelay\": 10,\n \t\t\"smtpin\": 10,\n \t\t\"imap4\": 10,\n \t\t\"pop3\": 10,\n \t\t\"webmail\": 10\n \t\t},\n \t\t\"deleted_users\": {\n \t\t\"storage_items_stored\": 0,\n \t\t\"storage_current_size\": 0\n \t\t},\n \t\t\"users\": {\n \t\t\"filter\": 0,\n \t\t\"forward\": 2,\n \t\t\"deleted\": 1,\n \t\t\"mailbox\": 7,\n \t\t\"alias\": 1\n \t\t},\n \t\t\"logins\": {\n\t\t\t\t\"imap4\": 0,\n \t\"pop3\": 0,\n \t\t\t\"webmail\": 0\n\t\t\t},\n\t\t\t\"storage\": {\n \t\t\t\"items_stored\": 6,\n \t\t\t\"current_size\": 141653\n\t\t\t}\n \t\t\t\"20111221\": \n \t{\n\t\t\t\"messages\": {\n\t\t\t\t\"autorespond_count\": 0, \n \t\"in_size\": 0, \n \t\"out_msg_count\": 0, \n \t\"in_spam\": 0, \n \t\"out_size\": 0, \n \t\"forward_count\": 0, \n \t\"in_ham\": 0, \n \t\"out_rcpt_count\": 0, \n \t\"denied\": 0\n\t\t\t},\n\t\t\t\"services\": {\n \t\t\t\"smtprelay\": 10,\n \t\t\t\"smtpin\": 10,\n \t\t\t\"imap4\": 10,\n \t\t\t\"pop3\": 10,\n \t\t\t\"webmail\": 10\n\t\t\t},\n\t\t\t\"deleted_users\": {\n \t\t\t\"storage_items_stored\": 0,\n \t\t\t\"storage_current_size\": 0\n\t\t\t},\n\t\t\t\"users\": {\n \t\t\t\"filter\": 0,\n \t\t\t\"forward\": 2,\n \t\t\t\"deleted\": 1,\n \t\t\t\"mailbox\": 7,\n \t\t\"alias\": 1 \n \t\t},\n \t\t\"logins\": {\n \t\t\"imap4\": 0,\n \t\t\"pop3\": 0,\n \t\t\"webmail\": 0\n \t\t},\n \t\t\"storage\": {\n \t\t\"items_stored\": 6,\n \t\t\"current_size\": 141653\n \t\t}\n\t\t},\n\t\t \t\t ...\n\t\t\"20111229\": {\n \t\t\"messages\": {\n\t\t\t\t\"autorespond_count\": 0, \n \t\t\t\"in_size\": 0, \n \t\t\t\"out_msg_count\": 0, \n \t\t\t\"in_spam\": 0, \n \t\t\t\"out_size\": 0, \n \t\t\t\"forward_count\": 0, \n \t\t\t\"in_ham\": 0, \n \t\t\t\"out_rcpt_count\": 0, \n \t\t\t\"denied\": 0\n \t\t},\n \t\t\"services\": {\n \t\t\"smtprelay\": 10,\n \t\t\"smtpin\": 10,\n \t\t\"imap4\": 10,\n \t\t\"pop3\": 10,\n \t\t\"webmail\": 10\n \t\t},\n \t\t\"deleted_users\": {\n \t\t\"storage_items_stored\": 0,\n \t\t\"storage_current_size\": 0\n \t\t}, \n \t\t\"users\": {\n \t\t\t\"filter\": 0,\n \t\t\t\"forward\": 2,\n \t\t\t\"deleted\": 1,\n \t\t\t\"mailbox\": 7,\n \t\t\t\"alias\": 1\n\t\t\t},\n\t\t\t\"logins\": {\n \t\t\t\"imap4\": 0,\n \t\t\t\"pop3\": 0,\n \t\t\t\"webmail\": 0\n\t\t\t},\n\t\t\t\"storage\": {\n \t\t\t\"items_stored\": 6,\n \t\t\t\"current_size\": 141653\n\t\t\t}\n \t \t} \n }\n}", "language": "perl", "name": " " } ] } [/block] ## Example 2 Displays daily summary statistics for user joe_user@example.com. **Request** [block:code] { "codes": [ { "code": "\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n \"object\": \"joe_user@example.com\",\n \"type\": \"user\",\n \"by\": \"day\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\":true,\n \"summary\":{\n \"20120111\":{\n \"messages\":{\n \"in_size\":\"\",\n \"out_msg_count\":\"\",\n \"in_spam\":\"\",\n \"autorespond_count\":\"\",\n \"out_size\":\"\",\n \"forward_count\":\"\",\n \"in_ham\":\"\",\n \"out_rcpt_count\":\"\",\n \"denied\":\"\"},\n \"services\":{\n \"smtprelay\":\"enabled\",\n \"smtpin\":\"enabled\",\n \"imap4\":\"enabled\",\n \"pop3\":\"enabled\",\n \"webmail\":\"enabled\"},\n \"delivery\":{\n \"autoresponder\":\"1\",\n \"fonly\":\"0\"},\n\t\t\t\"forward\":\"z@b.com\",\n\t\t\t\"createtime\":\"Thu Jul 21 17:46:22 2011 UTC\", \n \"workgroup\":\"staff\", \n \"account_type\":\"mailbox\",\n\t\t\t\"logins\":{\n\t\t\t\t\"last_imap4\":\"Fri Dec 9 01:16:12 2011 UTC\", \n \"imap4\":\"\",\n\t\t\t\t\"auth_token\":\"\",\n\t\t\t\t\"webmail\":\"\",\n\t\t\t\t\"last_webmail\":\"Fri Jan 6 18:00:33 2012 UTC\", \n \"auth_password\":\"\",\n \"pop3\":\"\",\n\t\t\t\t\"last_pop3\":\"Fri Dec 9 01:31:09 2011 UTC\", \n \"last_smtprelay\":\"Thu Jun 9 16:50:46 2011 UTC\", \n \"last_smtpin\":\"Mon Nov 21 19:54:05 2011 UTC\"},\n \"storage\":{\n \"items_stored\":\"31\",\n \"allowed_size\":\"6442450944\",\n \"current_size\":\"733839\"},\n \"deletetime\":\"\"\n },\n\t ... \n\t}\n}", "language": "perl", "name": " " } ] } [/block]