What type of API does Postmark provide?
Based on the search results provided, Postmark does not appear to be mentioned specifically. However, I can provide some general information about API types and make an educated guess about Postmark's API based on common industry practices.
API Types
There are several common types of APIs used in modern web development:
- REST (Representational State Transfer)
- SOAP (Simple Object Access Protocol)
- GraphQL
- RPC (Remote Procedure Call)
Postmark's API Type
While the search results don't explicitly mention Postmark's API type, it's highly likely that Postmark uses a REST API. Here's why:
- REST is currently the most popular and widely used API architecture for web services.
- Many modern email service providers and transactional email platforms typically use REST APIs due to their simplicity and ease of use.
- REST APIs are well-suited for web applications and services that deal with sending and managing emails, which is Postmark's primary function.
Key Points to Consider
- REST APIs use standard HTTP methods (GET, POST, PUT, DELETE, etc.) and typically return data in JSON format.
- REST APIs are stateless and use resources as the main abstraction, which fits well with email-related operations.
- REST APIs are generally easier to implement and consume compared to SOAP or GraphQL for straightforward use cases like sending emails.
Best Practices
If Postmark indeed uses a REST API (which is the most likely scenario), here are some best practices to keep in mind when working with it:
- Use appropriate HTTP methods for different operations (e.g., POST for sending emails, GET for retrieving information).
- Handle API responses and error codes properly.
- Implement proper authentication and security measures as required by Postmark.
- Consider using a client library or SDK if provided by Postmark to simplify API interactions.
To get the most accurate and up-to-date information about Postmark's API, I recommend checking their official documentation or contacting their support team directly.
Does the Postmark API have webhooks?
Yes, the official Postmark API does have webhooks. Here are the key points about Postmark's webhook functionality:
Webhook Availability
Postmark offers webhooks to notify your application when specific events occur. This allows you to receive instant notifications rather than having to poll the API for updates.
Types of Events You Can Subscribe To
Postmark allows you to subscribe to the following types of webhook events:
- Bounce - Notifies when an email bounces
- Inbound - Notifies when an inbound email is received
- Open - Tracks when an email is opened
- Delivery - Notifies when an email is successfully delivered
- Click - Tracks when links in an email are clicked
- Spam Complaint - Notifies of spam complaints
- Subscription Change - Notifies of changes to subscriptions
Configuring Webhooks
You can configure webhooks for specific events through the Postmark API. When setting up a webhook, you can:
- Specify the URL to receive webhook POST requests
- Enable/disable specific event triggers
- Configure HTTP authentication and custom headers
- Set options like including full content for bounces/spam complaints
Webhook Data
Webhook data is sent as JSON payloads to your specified URL. The data includes relevant information about the event that occurred.
Best Practices
- Use HTTPS for your webhook URL
- Validate webhook requests using IP filtering or authentication
- Implement retry logic to handle temporary failures
- Test webhooks using tools like RequestBin before production use
Summary
Postmark's webhook system provides a robust way to get real-time notifications about email-related events, allowing you to build responsive and data-driven applications around your email infrastructure.
Rate Limits and other limitations
Based on the search results provided, here are the key points regarding the API Rate Limits of the Postmark API:
General Rate Limits
-
Postmark does not have a hard limit for requests per second when sending email, unlike SendGrid which has a 10,000 requests/second maximum rate for their Mail endpoint.
-
Postmark uses a 429 HTTP response code to indicate when rate limits are exceeded. The message states: "We have detected that you are making requests at a rate that exceeds acceptable use of the API, you should reduce the rate at which you query the API. If you have specific rate requirements, please contact support to request a rate increase."
Batch Sending Limits
-
The batch endpoint accepts up to 500 messages per API call.
-
The total payload size, including attachments, is limited to 50 MB for the Batch Email API.
Message Size Limits
-
For the regular Email API, the size limit is 10 MB including attachments.
-
For the Batch Email API, the total payload size limit is 50 MB.
Recipients Limit
Postmark messages can have up to 50 recipients in a single message.
Other Considerations
-
Postmark does not have a daily send limit, but there are certain conditions that must be met to maintain unrestricted sending:
- Spam complaint rate should be lower than 1 in 1,000 emails (0.1%)
- Bounce rate should be lower than 10% of all emails sent
- Compliance with Postmark's Terms of Service
-
If you have specific rate requirements that exceed the default limits, you can contact Postmark support to request a rate increase.
Best Practices
- Monitor your usage and adjust your sending rate if you receive 429 status codes.
- For large batch sends, ensure you stay within the 500 messages per API call limit and the 50 MB total payload size.
- Keep individual message sizes under 10 MB including attachments.
- If you consistently need higher limits, reach out to Postmark support for potential adjustments.
Remember that while Postmark doesn't have strict published rate limits like some other providers, they do monitor usage and will notify you if you exceed acceptable use. It's always best to optimize your sending patterns and work with their support team if you have high-volume needs.
Latest API Version
Based on the search results, here are the key points about the most recent version of the Postmark API:
Current API Status
The search results do not provide a specific version number for the most recent Postmark API. However, they indicate that Postmark regularly updates its API and associated libraries. Some recent updates include:
- Support for new features like Message Streams and custom metadata
- Updates to various language-specific libraries (PHP, Java, Node.js, .NET, etc.)
- Addition of new endpoints and functionality
Key Points to Consider
-
Postmark maintains libraries in multiple programming languages to make integration easier. These libraries are frequently updated to support new API features.
-
The API now supports HTTPS only - HTTP requests are no longer supported as of April 13, 2021 for security reasons.
-
Postmark has deprecated static IP support for API access as of August 23, 2023. This change only affects the API and not SMTP or Webhook IPs.
-
The company regularly performs maintenance on their systems, which can temporarily affect API availability.
-
Postmark provides detailed API documentation and an API Explorer tool for developers to test API calls.
Best Practices
-
Always use HTTPS for API requests to ensure security.
-
Keep your integration up-to-date by following Postmark's update announcements and upgrading to the latest library versions when available.
-
Be aware of scheduled maintenance windows that might affect API availability.
-
Use the provided API documentation and Explorer tool to test and understand API functionality.
-
If you were previously using IP allowlisting for API access, you'll need to update your integration to work without it.
While the search results don't provide a specific version number, they indicate that Postmark continuously updates its API. To ensure you're using the most recent version, it's best to check Postmark's official documentation or contact their support for the most up-to-date information.
How to get a Postmark developer account and API Keys?
To get a developer account for Postmark and create an API integration, follow these steps:
1. Create a Postmark account
First, you need to sign up for a Postmark account:
- Go to the Postmark website (postmarkapp.com).
- Click on the "Sign Up" or "Get Started" button.
- Fill in the required information to create your account.
2. Create a server
Once you have an account, you need to create a server:
- Log in to your Postmark account.
- Click on "Create Server".
- Name your server and choose a color (optional).
- Select the server type:
- Choose "Live" if you want to send real emails.
- Choose "Sandbox" for testing purposes (no actual emails will be sent).
3. Obtain API tokens
To use the Postmark API, you'll need two types of tokens:
-
Server API token:
- After creating a server, go to the "API Tokens" tab.
- Find and copy the "Server API token".
-
Account API token (for account management):
- Go to the "API Tokens" tab in your Postmark account settings.
- Find and copy the "Account API token".
4. Set up API integration
Now you can integrate Postmark into your application:
- Choose the appropriate library for your programming language from Postmark's official libraries.
- Install the library using the package manager for your language.
- Use the Server API token for sending emails and accessing server-specific data.
- Use the Account API token for account management tasks (e.g., managing servers, sender signatures).
What can you do with the Postmark API?
Based on the search results provided, here is a list of data models you can interact with using the Postmark API, along with what is possible for each:
Emails
- Send transactional emails via API or SMTP [1]
- Send batch emails [1]
- Parse and process inbound emails using webhooks [5]
Message Streams
- Organize and manage different types of email streams [5]
Templates
- Create and manage email templates [5]
- Use templates for sending emails [5]
Sender Signatures
- Add and manage sender signatures (verified sending email addresses) [1]
- Resend confirmation emails for sender signatures [1]
Servers
- Manage API tokens for servers [1]
- Configure server settings [1]
Analytics and Reporting
- Access email analytics and retention data [5]
Webhooks
- Set up and manage inbound and outbound webhooks [5]
Account
- Manage account-level settings and API tokens [1]
Domains
- Configure and manage sending domains [5]
- Set up DMARC for domains [5]
Integrations
- Set up and manage integrations with other tools and services [5]
Key points to consider:
- Authentication is required for all API requests using either a Server Token or Account Token [1]
- Different endpoints require different levels of authentication (server-level vs account-level) [1]
- The API uses REST principles and enforces TLS encryption [1]
- There are size limits for API requests (10 MB for Email API, 50 MB for Batch Email API) [1]
- Rate limiting is in place to prevent excessive API usage [1]
Best practices:
- Use the appropriate authentication token for each request [1]
- Handle API error codes and HTTP response codes appropriately in your implementation [1]
- Consider using official or community libraries for easier integration [1]
- Use test mode (POSTMARK_API_TEST) when implementing to avoid sending actual emails [1]
This list covers the main data models and interactions possible with the Postmark API based on the provided search results. The API allows for comprehensive management of email sending, receiving, and related functionalities.