<commit_before>---
seo:
 title: Setting Up The Inbound Parse Webhook
 description: How to set up the Inbound Parse Webhook to process and parse incoming email
 keywords: Inbound Parse, Inbound Parse Webhook, Email Processing
title: Setting Up The Inbound Parse Webhook
group: inbound-parse
weight: 90
layout: page
navigation:
 show: true
---

As you’re probably aware, SendGrid is great at sending your email, but SendGrid can also help you process email using the Inbound Parse Webhook. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments then POSTs multipart/form-data to a URL that you choose.

<call-out>

XML is only available in v2.

</call-out>

What your application does with this parsed data is up to you. For some ideas of what the Inbound Parse Webhook can do, check out this [blog post](https://sendgrid.com/blog/parse-api-oh-what-you-can-do/).

<call-out>

Check out some pre-made integrations for the SendGrid Parse Webhook in the [Library Index]({{root_url}}/for-developers/sending-email/libraries/#web-api-libraries).

</call-out>

## 	Setup

To begin processing email using SendGrid's Inbound Parse Webhook, you will have to setup MX Records, choose the hostname (or receiving domain) that will be receiving the emails you want to parse, and define the URL where you want to POST your parsed emails.

 ### 	Setting up an MX Record

1. Navigate to the MX Records page on your hosting provider’s website. If you’re unsure who your hosting or DNS provider is, please contact your website administrator.

2. Create a new MX record for the subdomain (e.g. parse.yourdomain.com) you want to process incoming email.

<call-out>

This hostname should be used exclusively to parse your incoming email.

</call-out>

<call-out type="warning">

Do not change the MX record for your domain. If you do, you will no longer receive email.

</call-out>

3. Assign the MX record a priority of 10, and point it to the address: `mx.sendgrid.net.`

  It should look something like this:

   ![]({{root_url}}/images/Inbound_Parse_01_MX_Record.png)

<call-out>

If there is no field for priority, type 10 before the address. e.g. `10 mx.sendgrid.net.`

</call-out>

 ### 	Pointing to a Hostname and URL

 1. From your SendGrid Dashboard click **Settings**, and then click **Inbound Parse**.

  You are now on the Inbound Parse page.

 2. Click **Add Host & URL**.

  Here you will specify the subdomain and root domain of the receiving domain (or hostname). All emails sent to this receiving domain will be parsed.

  If you use the same return path (subdomain) as your authenticated domain, you must have Automatic Security disabled on the authenticated domain. Otherwise, those messages will bounce due to an infinite CNAME>MX loop.

<call-out>

The URL must be accessible from the public web.

</call-out>

3. Enter the subdomain (for example, "parse") and select the authenticated root domain for your receiving domain. Enter the public URL where you would like the parsed data to be POSTed.

  ![]({{root_url}}/images/setting_up_inbound_parse_1.png)

4. (Optional) Check **Spam Check** if you want Inbound Parse to check incoming email for spam. Checking this box will also include the spam report and spam score in the payload.

5. (Optional) Check **Send Raw** if you would prefer to receive the full MIME message URL encoded in multipart/form-data.

<call-out type="warning">

If you do not check **Send Raw**, the post will be multipart/form-data with the email content URL encoded, but the attachments will be in multipart/form-data. If your code is only set up to read URL encoding, attachments could be dropped.

</call-out>

6. Click Save.

You have just finished configuring Inbound Parse!

## 	Testing

To test if everything is working, send an email from your email account to <EMAIL>.

<call-out>

The local-part (i.e. anything before @) can be any word or combination because all email for the domain or subdomain will be processed.

</call-out>

You can check the [Activity Feed](https://app.sendgrid.com/email_activity?) from your SendGrid dashboard to see if incoming mail was parsed. For more help, see [Debugging a Webhook]({{root_url}}/for-developers/tracking-events/troubleshooting/).

<call-out type="warning">

Remember to direct your incoming email to your hostname (for example, <EMAIL>). If you do not, your incoming email will not be parsed.

</call-out>

## 	Default Parameters

<table class="table">
  <colgroup>
  <col class="table-col-200">
  <col>
  </colgroup>
   <tbody>
      <tr>
         <th>headers</th>
         <td>The raw headers of the email.</td>
      </tr>
      <tr>
         <th>dkim</th>
         <td>A string containing the verification results of any DKIM and domain keys signatures in the message.</td>
      </tr>
      <tr>
         <th>content-ids</th>
         <td>A string containing the number of attachments. </td><commit_msg>Update to Parse + Activity Feed Section<commit_after>---
seo:
 title: Setting Up The Inbound Parse Webhook
 description: How to set up the Inbound Parse Webhook to process and parse incoming email
 keywords: Inbound Parse, Inbound Parse Webhook, Email Processing
title: Setting Up The Inbound Parse Webhook
group: inbound-parse
weight: 90
layout: page
navigation:
 show: true
---

As you’re probably aware, SendGrid is great at sending your email, but SendGrid can also help you process email using the Inbound Parse Webhook. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments then POSTs multipart/form-data to a URL that you choose.

<call-out>

XML is only available in v2.

</call-out>

What your application does with this parsed data is up to you. For some ideas of what the Inbound Parse Webhook can do, check out this [blog post](https://sendgrid.com/blog/parse-api-oh-what-you-can-do/).

<call-out>

Check out some pre-made integrations for the SendGrid Parse Webhook in the [Library Index]({{root_url}}/for-developers/sending-email/libraries/#web-api-libraries).

</call-out>

## 	Setup

To begin processing email using SendGrid's Inbound Parse Webhook, you will have to setup MX Records, choose the hostname (or receiving domain) that will be receiving the emails you want to parse, and define the URL where you want to POST your parsed emails.

 ### 	Setting up an MX Record

1. Navigate to the MX Records page on your hosting provider’s website. If you’re unsure who your hosting or DNS provider is, please contact your website administrator.

2. Create a new MX record for the subdomain (e.g. parse.yourdomain.com) you want to process incoming email.

<call-out>

This hostname should be used exclusively to parse your incoming email.

</call-out>

<call-out type="warning">

Do not change the MX record for your domain. If you do, you will no longer receive email.

</call-out>

3. Assign the MX record a priority of 10, and point it to the address: `mx.sendgrid.net.`

  It should look something like this:

   ![]({{root_url}}/images/Inbound_Parse_01_MX_Record.png)

<call-out>

If there is no field for priority, type 10 before the address. e.g. `10 mx.sendgrid.net.`

</call-out>

 ### 	Pointing to a Hostname and URL

 1. From your SendGrid Dashboard click **Settings**, and then click **Inbound Parse**.

  You are now on the Inbound Parse page.

 2. Click **Add Host & URL**.

  Here you will specify the subdomain and root domain of the receiving domain (or hostname). All emails sent to this receiving domain will be parsed.

  If you use the same return path (subdomain) as your authenticated domain, you must have Automatic Security disabled on the authenticated domain. Otherwise, those messages will bounce due to an infinite CNAME>MX loop.

<call-out>

The URL must be accessible from the public web.

</call-out>

3. Enter the subdomain (for example, "parse") and select the authenticated root domain for your receiving domain. Enter the public URL where you would like the parsed data to be POSTed.

  ![]({{root_url}}/images/setting_up_inbound_parse_1.png)

4. (Optional) Check **Spam Check** if you want Inbound Parse to check incoming email for spam. Checking this box will also include the spam report and spam score in the payload.

5. (Optional) Check **Send Raw** if you would prefer to receive the full MIME message URL encoded in multipart/form-data.

<call-out type="warning">

If you do not check **Send Raw**, the post will be multipart/form-data with the email content URL encoded, but the attachments will be in multipart/form-data. If your code is only set up to read URL encoding, attachments could be dropped.

</call-out>

6. Click Save.

You have just finished configuring Inbound Parse!

## 	Testing

To test if everything is working, send an email from your email account to <EMAIL>.

<call-out>

The local-part (i.e. anything before @) can be any word or combination because all email for the domain or subdomain will be processed.

</call-out>

<call-out type="warning">

Remember to direct your incoming email to your hostname (for example, <EMAIL>). If you do not, your incoming email will not be parsed.

</call-out>

## 	Default Parameters

<table class="table">
  <colgroup>
  <col class="table-col-200">
  <col>
  </colgroup>
   <tbody>
      <tr>
         <th>headers</th>
         <td>The raw headers of the email.</td>
      </tr>
      <tr>
         <th>dkim</th>
         <td>A string containing the verification results of any DKIM and domain keys signatures in the message.</td>
      </tr>
      <tr>
         <th>content-ids</th>
         <td>A string containing the number of attachments. </td>
{'fraction_non_alphanumeric': 0.08171487603305785, 'fraction_numerical': 0.0049586776859504135, 'mean_word_length': 3.7760236803157374, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 91, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '20565', 'n_tokens_mistral': 2822, 'n_tokens_neox': 2702, 'n_words': 1364}