Skip to main content
If you’re currently using SendGrid and want to migrate to SendPost, we offer a SendGrid-Compatible API that minimizes code changes.

IP Pool Requirement

Mandatory Requirement: To use the SendGrid-Compatible API, you must have an IP Pool configured in both SendGrid and SendPost with the same name.
The IP Pool name in your SendGrid requests (ip_pool_name) must match an IP Pool in SendPost that is configured to route traffic to your SendGrid provider. This ensures proper routing of emails through SendGrid. Setup Steps:
  1. Note the IP Pool name you use in SendGrid (e.g., “transactional” or “marketing”)
  2. Create an IP Pool in SendPost with the exact same name
  3. Configure the SendPost IP Pool to route traffic to your SendGrid provider

Quick Migration Steps

1

Configure IP Pool

Create an IP Pool in SendPost with the same name as your SendGrid IP Pool, configured to route to SendGrid
2

Change the base URL

  • From: https://api.sendgrid.com
  • To: https://api.sendpost.io/v1/sendgrid
3

Update the API key header

  • From: Authorization: Bearer SG.xxxx
  • To: X-SubAccount-ApiKey: YOUR_SENDPOST_API_KEY
4

Send emails

Use the same payload format as before (including ip_pool_name)

Migration Example

curl -X POST "https://api.sendgrid.com/v3/mail/send" \
  -H "Authorization: Bearer SG.xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "personalizations": [{
      "to": [{"email": "[email protected]", "name": "John"}]
    }],
    "from": {"email": "[email protected]"},
    "subject": "Hello World",
    "content": [
      {"type": "text/plain", "value": "Hello!"},
      {"type": "text/html", "value": "<p>Hello!</p>"}
    ],
    "ip_pool_name": "transactional"
  }'
The ip_pool_name in your request must match an IP Pool configured in SendPost that routes to SendGrid. Without this, the SendGrid-Compatible API will not know where to route your emails.

Supported SendGrid Features

FeatureSupportedNotes
from / to / subjectDirect mapping
content (text/html)Supports both plain text and HTML
reply_toSingle reply-to address
headersCustom headers preserved
custom_argsMerged into headers
categoriesMapped to SendPost groups
ip_pool_nameRequired - Must match an IP Pool in SendPost configured for SendGrid routing
attachmentsBase64 encoded attachments
personalizationsMultiple recipients with personalization
substitutionsMapped to custom fields
Open trackingtracking_settings.open_tracking
Click trackingtracking_settings.click_tracking

Unsupported SendGrid Features

The following SendGrid features are not supported and will return an error if present:
FeatureAlternative
template_idUse SendPost’s native template API or include content directly
reply_to_listUse single reply_to address
send_at (scheduled sending)Not available through this endpoint
batch_idNot supported
asm (suppression groups)Use SendPost’s {{unsubscribe}} template variable
mail_settingsNot supported
subscription_trackingUse SendPost’s {{unsubscribe}} template variable
ganalyticsNot supported
attachments.dispositionAll attachments treated as standard
attachments.content_idInline images via CID not supported
Error Response for Unsupported Fields:
{
  "errors": [{
    "message": "Field 'template_id' is not supported. Please use SendPost's native template API or include content directly.",
    "field": "template_id"
  }]
}

Response Mapping

SendGrid ResponseSendPost Behavior
HTTP 202 AcceptedSendPost returns 202 with empty body on success
HTTP 400 Bad RequestValidation errors in SendGrid format
HTTP 401 UnauthorizedInvalid or missing API key
HTTP 413 Payload Too LargeRequest exceeds 30MB limit

Next Steps