{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"17dc85ab-2dfc-4cdf-ad30-bdaa6aa50f71","name":"Mailprotector API","description":"The Mailprotector API is structured in a way to provide most console functionality through a RESTful interface. Access to some endpoints may be restricted for API keys belonging to managers with certain permissions. For any questions or suggestions, please create a new ticket with our support team: [https://support.mailprotector.com/hc/en-us/requests/new](https://support.mailprotector.com/hc/en-us/requests/new).\n\n# Authentication\n\nAuthentication for all requests is granted via a Bearer token in the header of a request. Each manager account is provisioned with an API key for each active **role** which can be accessed via the web console.\n\nTo find the key of the current manager account, first log in to your manager account in the web console, then click on \"Edit my profile\" under the dropdown at the upper right corner of the page (logged in users can also go to [https://emailservice.io/profile](https://emailservice.io/profile) ). Once there, click the \"...\" button on the role that you would like to utilize in the API, and click the \"View API Key\" option.\n\nThe token will provide the same permissions as the role whose key is being used. The request's header should have the following field provided for every request.\n\n```\n\"Authorization\": \"Bearer {{your_api_key_here}}\"\n\n ```\n\n# List Request Parameters\n\nAll GET request routes which provide a list of entities (i.e. GET users) can be optionally filtered using query parameters which map to a field on the entity being requested. For example, when requesting a list of users, the `first_name` field can be filtered on by using the following URL:\n\n```\n\"emailservice.io/api/v1/domains/{{domain_id}}/users?first_name={{first_name}}\"\n\n ```\n\nResults can also be filtered down based on the date or datetime the objects were created or updated. Five comparisons for dates/datetimes can be made:\n\n| Abbreviation | Function |\n| --- | --- |\n| Ge | Greater than |\n| Geq | Greater than or equal |\n| Le | Less than |\n| Leq | Less than or equal |\n| Eq | Exactly equals |\n\nAs an example, to find a list of users created on or after a certain date, you could use the following URL:\n\n```\n\"emailservice.io/api/v1/domains/{{domain_id}}/users?created_at[geq]=2018-01-01\"\n\n ```\n\nAll returned lists will include information about the current status of the paging through the response headers. Below is an example of what is returned under the \"X-Pagination\" key in the response headers.\n\n```\n{\n   \"total\":41,\n   \"total_pages\":2,\n   \"per_page\":25,\n   \"first_page\":true,\n   \"last_page\":false,\n   \"previous_page\":null,\n   \"current_page\":1,\n   \"next_page\":2,\n   \"out_of_range\":false\n}\n\n ```\n\nThe returned pages can be manipulated through the combination of the `page` and `per_page` keys. By default, these values are 1 and 25 respectively.\n\n# Filtering Logs\n\nThe _logs_ endpoints for each entity can be filtered using the same criteria as the web console.\n\n| Options | Possible Values |\n| --- | --- |\n| sort_direction | \"desc\" (default), \"asc\" |\n| sort_field | **\"@timestamp\"** (default)  <br>**\"prime.direction\"** - Sort by inbound/outbound messages  <br>**\"prime.from_header_raw\"** - Sort by _from_ address  <br>**\"prime.recipient\"** - Sort by _to_ address  <br>**\"prime.subject\"** - Sort by subject line  <br>**\"prime.decision\"** - Sort by decision on messages (i.e \"deliver\" vs \"quarantine_spam\", etc)  <br>**\"prime.score\"** - Sort by the score of each message |\n| page | int (default of 1) |\n| page_size | int (default of 25) |\n| sender | string (optional) |\n| recipient | string (optional) |\n| subject | string (optional) |\n| decision | \"all\" (default),\"deliver\", \"quarantine_spam\", \"quarantine_virus\",  <br>\"quarantine_policy\", \"bounce\", \"encrypt\", \"delete\" |\n| direction | \"inbound\", \"outbound\" (leave blank to retrieve both) |\n| date_range_type | \"relative\" - Relative to the _date_range_minutes_ provided  <br>\"custom\" - Absolute time provided as _start_datetime_ and _end_datetime_ parameters |\n| date_range_minutes | int (defaults to 15). Only used if _date_range_type_ is \"relative\". |\n| start_datetime | iso8601 formatted datetime. Defaults to 15 minutes prior to the request being made. |\n| end_datetime | iso8601 formatted datetime. Defaults to the time of the request if not provided. |\n\nAn example request may look like the following:\n\n```\nemailservice.io/domains/{{domain_id}}/logs?sort_direction=desc&sort_field=@timestamp&page=1&sender=address&recipient=address&subject=subject&decision=deliver&direction=inbound&date_range_type=relative&date_range_minutes=30&start_datetime=2020-01-21T22:01:09Z&end_datetime=2020-01-21T22:16:09Z\n\n ```","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"9753375","team":612185,"collectionId":"17dc85ab-2dfc-4cdf-ad30-bdaa6aa50f71","publishedId":"SWE83H2P","public":true,"publicUrl":"https://api.mailprotector.com","privateUrl":"https://go.postman.co/documentation/9753375-17dc85ab-2dfc-4cdf-ad30-bdaa6aa50f71","customColor":{"top-bar":"","right-sidebar":"303030","highlight":"99CC00"},"documentationLayout":"classic-double-column","version":"8.11.4","publishDate":"2020-01-06T22:25:23.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Production","id":"8c971622-762f-4c4d-850f-5623e1b6a8ea","owner":"9753486","values":[{"key":"hostname","value":"emailservice.io","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/43821ee111389e31579194a27e8be1b76e7c6933bc543282e6325a70bbd3d60c","favicon":"https://res.cloudinary.com/postman/image/upload/v1671055018/team/wrryy1tuolfoo7lghusp.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Production","value":"9753486-8c971622-762f-4c4d-850f-5623e1b6a8ea"}],"canonicalUrl":"https://api.mailprotector.com/view/metadata/SWE83H2P"}