# Connect Sparkpost API

**Watch our SparkPost API introduction video then read through our easy to follow documentation with more details below:**

{% embed url="<https://emailteam.wistia.com/medias/6m1dgu1af1>" %}

Unlike SMTP Relay, API integration must be customized for each ESP. If you are a customer and want an API integration for your favorite ESP, please [open a support ticket](https://emaildeliverycom.freshdesk.com/support/tickets/new).&#x20;

{% hint style="info" %}
**API integrations are bidirectional**

To track real-time delivery progress natively in your platform including bounce and complaint rates, use an API implementation such as Mailgun, Sparkpost, or Amazon SES.

Velocity MTA, which comes free with your platform, also tracks real-time delivery over your own IP Addresses.  &#x20;
{% endhint %}

While logged in to the backend as administrator, click the connect menu, select SparkPost API, then click add SparkPost account.

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FztjzJInGvhES2HwduvNJ%2FScreenshot%202023-06-05%20at%204.38.56%20PM.png?alt=media&#x26;token=144daa1f-6c60-401d-b189-2a680ce7ff6f" alt="" width="232"><figcaption></figcaption></figure></div>

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FK8Hi5fZR3dgVsZ7taMgu%2FScreenshot%202023-06-05%20at%204.40.01%20PM.png?alt=media&#x26;token=cc399f5d-55a7-40ad-8395-d944f3687915" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Name**

Give your API connection an internal name. This will only be seen by you and is for management purposes only.
{% endhint %}

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FnUfAZ1et0okRobsuCzNT%2FScreenshot%202023-06-05%20at%204.29.53%20PM.png?alt=media&#x26;token=aa0376e0-3441-4508-9ed9-5041db92cf97" alt="" width="313"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Create an API Key**

Create an API Key in SparkPost and copy it into your platform configuration.&#x20;
{% endhint %}

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FADvGWWpdu5VgX6MevEFf%2FScreenshot%202023-06-05%20at%204.43.39%20PM.png?alt=media&#x26;token=ce831908-002f-46e9-aec6-06b696047ef0" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Leave 'Allowed IPs' blank, unless you know what you're doing.&#x20;
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2Fdv6gLSb16PZcGH6VsA33%2FScreenshot%202023-06-05%20at%204.44.42%20PM.png?alt=media&#x26;token=508bcc6c-512e-4546-8896-cebdf2d7290f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Copy your API Key from SparkPost and paste it into your emaildelivery.com SparkPost API configuration.
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FgcJi4qQ04dZgKhk1gDhw%2FScreenshot%202023-06-05%20at%204.45.01%20PM.png?alt=media&#x26;token=8e4b1353-6b4c-4f6a-a63c-810d4c1da579" alt=""><figcaption></figcaption></figure>

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2F3EpGDsl5SZOLEBVV9N96%2FScreenshot%202023-06-05%20at%2012.05.37%20AM.png?alt=media&#x26;token=720f6e18-2f04-4fe2-9b52-8e506af14343" alt="" width="358"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Adding a sending domain to SparkPost**

Before you can use your sending domain through the SparkPost API, you must add your domain to SparkPost and verify you're the owner.
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2F0s1ObmFQJUHxN2K6mfSd%2FScreenshot%202023-06-05%20at%205.00.45%20PM.png?alt=media&#x26;token=8c8cf383-9cab-4900-a682-19fbb727a8ca" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Enter a base domain or subdomain**&#x20;

Most mailbox providers such as Gmail recommend using a subdomain, however, this decision is based on your own preferences and goals. Using 'sp' or 'sparkpost' is a common subdomain seen with SparkPost customers.&#x20;
{% endhint %}

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FmNFdCdy3BtFVvlOquGbK%2FScreenshot%202023-06-05%20at%205.03.52%20PM.png?alt=media&#x26;token=1c0e7d89-c3c2-4cee-80c3-73eaa30613bd" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Domain Alignment**

You'll receive a popup window after continuing. We recommend selecting 'no' on strict alignment.
{% endhint %}

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FlTJpq6B88F2XRY0a005o%2FScreenshot%202023-06-05%20at%205.04.55%20PM.png?alt=media&#x26;token=e5be63b7-b6f2-4a8e-a888-a04aaefedc1e" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Verify ownership by adding DKIM authentication**

Follow SparkPost's instruction for adding DKIM verification records to your DNS provider.
{% endhint %}

<figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FVRf7MlxKCdVcqL9QskJq%2FScreenshot%202023-06-05%20at%205.07.59%20PM.png?alt=media&#x26;token=42ae174f-c6f9-4ec5-8c77-43862444ce55" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
SparkPost may need a moment to detect the changes you've made to your domain configuration. If it doesn't verify you right away try again in 1-2 minutes.
{% endhint %}

{% hint style="info" %}
**White-label tracking links**&#x20;

Unless you change your link domain, your admin\_url domain will be used for your tracking links in your email messages. You can add a custom link to automatically match your domain branding for mail sent through this API connection. No further action is required beyond this step.&#x20;
{% endhint %}

{% hint style="warning" %}
**Make sure you point a DNS A record at your platform IP Address for your tracking link or it will not work.**
{% endhint %}

<div align="left"><figure><img src="https://2024949584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHNgw7cfnOYHQr0B6GDXr%2Fuploads%2FjQQAzJ8PUhB0bVcvPn07%2FScreenshot%202023-06-05%20at%2012.05.59%20AM.png?alt=media&#x26;token=e2076e88-6aea-438a-a59e-66675de3646a" alt="" width="251"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Next Steps**

Return to the [getting ready to send page](https://docs.emaildelivery.com/docs/introduction/getting-ready-to-send) and follow the instructions to start using your newly configured Mailgun API connection.
{% endhint %}

{% content-ref url="getting-ready-to-send" %}
[getting-ready-to-send](https://docs.emaildelivery.com/docs/introduction/getting-ready-to-send)
{% endcontent-ref %}
