{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/email-api/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","tabs","tab"]},"type":"markdown"},"seo":{"title":"Parse API: inbound emails","siteUrl":"https://dev.mailjet.com/","projectTitle":"Mailjet Developer Documentation","description":"Set up Mailjet Parse API to receive and parse inbound emails by creating a parseroute via POST /parseroute and pointing it to your webhook URL.","image":"https://dev.mailjet.com/og-image.png","lang":"en-US","keywords":["Mailjet API","Email API","Content API","SMTP Relay","transactional email","email delivery","Send API","email templates","developer documentation"],"meta":[{"name":"og:type","content":"website"},{"name":"og:site_name","content":"Mailjet Developer Documentation"},{"name":"twitter:card","content":"summary_large_image"},{"name":"robots","content":"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"},{"name":"googlebot","content":"index, follow, max-snippet:-1, max-image-preview:large"}],"jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://dev.mailjet.com/#organization","name":"Mailjet","alternateName":"Sinch Mailjet","url":"https://www.mailjet.com","logo":"https://assets.mailjet.com/lib/images/mailjetLogo/mj_logo_with_text_color.png","parentOrganization":{"@type":"Organization","name":"Sinch","url":"https://www.sinch.com"}},{"@type":"WebSite","@id":"https://dev.mailjet.com/#website","name":"Mailjet Developer Documentation","description":"Official developer documentation for the Mailjet Email API, Content API and SMTP Relay.","url":"https://dev.mailjet.com/","inLanguage":"en-US","publisher":{"@id":"https://dev.mailjet.com/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://dev.mailjet.com/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]},"llmstxt":{"hide":false,"title":"Mailjet Developer Documentation","description":"Developer documentation for the Mailjet Email API, Content API and SMTP Relay - guides, API references and code samples for sending, templating and tracking email at scale.","details":{"content":"Mailjet (part of Sinch) provides APIs for sending and managing email.\n\nThis documentation covers four main areas:\n\n- **Email API** - the Send API (v3 and v3.1) for transactional and marketing email,\n  plus contact management, segmentation, campaigns, statistics, webhooks, the Parse API\n  and the Mailjet Templating Language.\n- **Content API** - programmatic management of email templates, template contents,\n  images, labels and authentication tokens (v1).\n- **SMTP Relay** - sending through Mailjet's SMTP servers, including custom headers.\n- **API Reference** - the complete, generated reference for every endpoint, built directly\n  from the OpenAPI specifications.\n\nBase URL for all REST APIs: `https://api.mailjet.com`.\nAuthentication uses HTTP Basic auth with an API key and secret key.\n\n## Machine-readable entry points\n\nPrefer these when you need the API surface in as few requests as possible:\n\n- `/openapi/openapi-mailjet.md` - the **complete** Email API reference (every endpoint,\n  grouped by resource) as a single Markdown document.\n- `/openapi/openapi-passport.md` - the **complete** Content API reference as a single\n  Markdown document.\n- `/_bundle/openapi/openapi-mailjet.yaml` - the raw, fully bundled OpenAPI 3 description\n  of the Email API.\n- `/_bundle/openapi/openapi-passport.yaml` - the raw, fully bundled OpenAPI 3 description\n  of the Content API.\n- `/sitemap.xml` - every indexable URL on this site.\n\nEvery page on this site is also available as clean Markdown by appending `.md` to its URL."},"sections":[{"title":"Email API","description":"Sending, contacts, campaigns, statistics, webhooks and templating.","includeFiles":["docs/email-api/**/*.md"],"excludeFiles":[]},{"title":"Content API","description":"Manage templates, template contents, images, labels and tokens.","includeFiles":["docs/content-api/**/*.md","docs/content-api.md"],"excludeFiles":[]},{"title":"SMTP Relay","description":"Send email through Mailjet's SMTP servers.","includeFiles":["docs/smtp-relay/**/*.md"],"excludeFiles":[]},{"title":"API Reference","description":"Complete generated reference for every Mailjet API endpoint.","includeFiles":["openapi/openapi-mailjet.yaml","openapi/openapi-passport.yaml","docs/api-reference/**/*.md"],"excludeFiles":[]},{"title":"Migrating from Mandrill","description":"Guides for switching from Mandrill to Mailjet.","includeFiles":["docs/mandrill/**/*.md"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"parse-api-inbound-emails","__idx":0},"children":["Parse API: inbound emails"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Parse API is available only for users on paid Mailjet plans (Premium 50k and above). Check our ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://app.mailjet.com/subscription"},"children":["plans"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.mailjet.com/pricing/"},"children":["pricing pages"]}," for more information."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Parse API allows you to have inbound emails parsed and their content delivered to a webhook of your choice."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It will make the processing of inbound messages easier as Mailjet will do all the job of sifting through and organizing all the information in headers, content and attachments. What's left to do is just to save the information in your CRM or database."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"basic-setup","__idx":1},"children":["Basic Setup"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"# Create : ParseRoute description\ncurl -s \\\n\t-X POST \\\n\t--user \"$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE\" \\\n\thttps://api.mailjet.com/v3/REST/parseroute \\\n\t-H 'Content-Type: application/json' \\\n\t-d '{\n\t\t\"Url\":\"https://www.mydomain.com/mj_parse.php\"\n\t}'\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PHP","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\n/*\nCreate : ParseRoute description\n*/\nrequire 'vendor/autoload.php';\nuse \\Mailjet\\Resources;\n$mj = new \\Mailjet\\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));\n$body = [\n    'Url' => \"https://www.mydomain.com/mj_parse.php\"\n];\n$response = $mj->post(Resources::$Parseroute, ['body' => $body]);\n$response->success() && var_dump($response->getData());\n?>\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Node.js","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"/**\n *\n * Create : ParseRoute description\n *\n */\nconst mailjet = require ('node-mailjet')\n\t.connect(process.env.MJ_APIKEY_PUBLIC, process.env.MJ_APIKEY_PRIVATE)\nconst request = mailjet\n\t.post(\"parseroute\")\n\t.request({\n\t\t\"Url\":\"https://www.mydomain.com/mj_parse.php\"\n\t})\nrequest\n\t.then((result) => {\n\t\tconsole.log(result.body)\n\t})\n\t.catch((err) => {\n\t\tconsole.log(err.statusCode)\n\t})\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Ruby","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","header":{"controls":{"copy":{}}},"source":"# Create : ParseRoute description\nrequire 'mailjet'\nMailjet.configure do |config|\n  config.api_key = ENV['MJ_APIKEY_PUBLIC']\n  config.secret_key = ENV['MJ_APIKEY_PRIVATE']  \nend\nvariable = Mailjet::Parseroute.create(url: \"https://www.mydomain.com/mj_parse.php\"\n)\np variable.attributes['Data']\n","lang":"ruby"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"\"\"\"\nCreate : ParseRoute description\n\"\"\"\nfrom mailjet_rest import Client\nimport os\napi_key = os.environ['MJ_APIKEY_PUBLIC']\napi_secret = os.environ['MJ_APIKEY_PRIVATE']\nmailjet = Client(auth=(api_key, api_secret))\ndata = {\n  'Url': 'https://www.mydomain.com/mj_parse.php'\n}\nresult = mailjet.parseroute.create(data=data)\nprint result.status_code\nprint result.json()\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"package com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Parseroute;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Create : ParseRoute description\n     */\n    public static void main(String[] args) throws MailjetException, MailjetSocketTimeoutException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(System.getenv(\"MJ_APIKEY_PUBLIC\"), System.getenv(\"MJ_APIKEY_PRIVATE\"));\n      request = new MailjetRequest(Parseroute.resource)\n\t\t\t.property(Parseroute.URL, \"https://www.mydomain.com/mj_parse.php\");\n      response = client.post(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Go","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"go","header":{"controls":{"copy":{}}},"source":"/*\nCreate : ParseRoute description\n*/\npackage main\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\tmailjet \"github.com/mailjet/mailjet-apiv3-go\"\n\t\"github.com/mailjet/mailjet-apiv3-go/resources\"\n)\nfunc main () {\n\tmailjetClient := NewMailjetClient(os.Getenv(\"MJ_APIKEY_PUBLIC\"), os.Getenv(\"MJ_APIKEY_PRIVATE\"))\n\tvar data []resources.Parseroute\n\tmr := &Request{\n\t  Resource: \"parseroute\",\n\t}\n\tfmr := &FullRequest{\n\t  Info: mr,\n\t  Payload: &resources.Parseroute {\n      Url: \"https://www.mydomain.com/mj_parse.php\",\n    },\n\t}\n\terr := mailjetClient.Post(fmr, &data)\n\tif err != nil {\n\t  fmt.Println(err)\n\t}\n\tfmt.Printf(\"Data array: %+v\\n\", data)\n}\n","lang":"go"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"C#","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using Mailjet.Client;\nusing Mailjet.Client.Resources;\nusing System;\nusing Newtonsoft.Json.Linq;\nnamespace Mailjet.ConsoleApplication\n{\n   class Program\n   {\n      /// <summary>\n      /// Create : ParseRoute description\n      /// </summary>\n      static void Main(string[] args)\n      {\n         RunAsync().Wait();\n      }\n      static async Task RunAsync()\n      {\n         MailjetClient client = new MailjetClient(Environment.GetEnvironmentVariable(\"MJ_APIKEY_PUBLIC\"), Environment.GetEnvironmentVariable(\"MJ_APIKEY_PRIVATE\"));\n         MailjetRequest request = new MailjetRequest\n         {\n            Resource = Parseroute.Resource,\n         }\n            .Property(Parseroute.Url, \"https://www.mydomain.com/mj_parse.php\");\n         MailjetResponse response = await client.PostAsync(request);\n         if (response.IsSuccessStatusCode)\n         {\n            Console.WriteLine(string.Format(\"Total: {0}, Count: {1}\\n\", response.GetTotal(), response.GetCount()));\n            Console.WriteLine(response.GetData());\n         }\n         else\n         {\n            Console.WriteLine(string.Format(\"StatusCode: {0}\\n\", response.StatusCode));\n            Console.WriteLine(string.Format(\"ErrorInfo: {0}\\n\", response.GetErrorInfo()));\n            Console.WriteLine(response.GetData());\n            Console.WriteLine(string.Format(\"ErrorMessage: {0}\\n\", response.GetErrorMessage()));\n         }\n      }\n   }\n}\n","lang":"csharp"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-response","__idx":2},"children":["API Response"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n\t\"Count\": 1,\n\t\"Data\": [\n\t\t{\n\t\t\t\"APIKeyID\": \"11111111\",\n\t\t\t\"Email\": \"16Hy-aOYhApIzTgN@parse-in1.mailjet.com\",\n\t\t\t\"ID\": \"1\",\n\t\t\t\"Url\": \"https://www.mydomain.com/mj_parse.php\"\n\t\t}\n\t],\n\t\"Total\": 1\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to begin receiving emails to your webhook, create a new instance of the Parse API via a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," request on the /parseroute resource. This call has only one mandatory property - the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Url"]}," of the webhook (Note: URLs provided cannot be the root). Mailjet will provide an Email address (on the subdomain @parse-in1.mailjet.com) in the response, you can begin to use immediately. It can be used as a Reply-to Email address for example."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We strongly recommend using a secure (HTTPS) URL in combination with a basic authentification to make sure data cannot be intercepted, and that only our servers can send you data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["E.g.: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://username:password@www.example.com/mailjet_parser.php"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also specify a port in your webhook URL."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["E.g.: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://www.example.com:123/mailjet_triggers.php"]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mailjet provides only one Email address (on the subdomain @parse-in1.mailjet.com) per API key."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Parse API also allows you to use your own email address and domain using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]}," property in the /parseroute resource. Visit use your own domain section for more information on how to setup your DNS and your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parseroute"]},"."]}]},"headings":[{"value":"Parse API: inbound emails","id":"parse-api-inbound-emails","depth":1},{"value":"Basic Setup","id":"basic-setup","depth":2},{"value":"API Response","id":"api-response","depth":3}],"frontmatter":{"title":"Parse API- inbound emails","seo":{"description":"Set up Mailjet Parse API to receive and parse inbound emails by creating a parseroute via POST /parseroute and pointing it to your webhook URL.","title":"Parse API: inbound emails"}},"lastModified":"2026-08-26T10:53:57.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/email-api/parse-api/basic-setup","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}