The Mailforge API allows you to automate common Mailforge infrastructure workflows, such as managing workspaces, checking domain availability, purchasing domains, creating mailboxes, reviewing DNS records, configuring forwarding, and managing mailbox data.
It is useful when your team wants to connect Mailforge to an internal system, CRM, client onboarding flow, RevOps workflow, or custom provisioning tool.
You can use the Mailforge API to automate infrastructure-related tasks, including:
Listing and creating workspaces
Checking domain availability
Checking domain availability in bulk
Purchasing domains
Listing domains
Reviewing domain DNS records
Updating DNS records
Creating mailboxes
Listing mailboxes
Updating mailbox details
Managing mailbox forwarding
Managing domain forwarding
Enabling or disabling domain auto-renewal
Deleting mailboxes or workspaces when needed
The API is designed for Mailforge infrastructure management. It does not run Salesforge sequences, send campaigns, manage Primebox replies, or control LinkedIn steps.
The Mailforge public API uses the following base URL:
https://api.mailforge.ai/publicAll public API requests should be made against this base URL, followed by the endpoint you want to use.
For example:
GET /workspacesbecomes:
https://api.mailforge.ai/public/workspacesTo create an API key:
Log in to your Mailforge account.
Go to Settings.
Open the API section.
Create a new API key.
Copy and store the key securely.
Make sure you are using a Mailforge API key. API keys from other Forge products, such as Salesforge or Warmforge, should not be used for Mailforge API requests.
For Mailforge public API requests, pass your Mailforge API key in the Authorization header.
Example:
curl --request GET \
--url "https://api.mailforge.ai/public/workspaces" \
--header "Authorization: YOUR_MAILFORGE_API_KEY" \
--header "Accept: application/json"A successful request will return the workspaces available to your account.
If this request fails, check that:
The API key was created in Mailforge
The key is being sent in the Authorization header
The request is using the correct base URL
The key has not been disabled or rotated
The key is not being exposed from frontend/browser-side code
The best first test is to list your workspaces.
Use:
GET /workspacesThis confirms that your API key is valid and that your integration can access your Mailforge account.
Example:
curl --request GET \
--url "https://api.mailforge.ai/public/workspaces" \
--header "Authorization: YOUR_MAILFORGE_API_KEY" \
--header "Accept: application/json"If the request succeeds, you can continue building the rest of your workflow.
Workspaces help organize Mailforge infrastructure by client, project, brand, or campaign setup.
Common workspace endpoints include:
GET /workspaces
POST /workspaces
DELETE /workspaces/{workspaceID}Use workspaces when you want to separate infrastructure for different clients or outbound projects.
When creating a workspace through the API, store the returned workspace ID. You will need it for downstream actions such as domain purchases.
Before purchasing domains, you can check whether domains are available.
Common endpoints include:
GET /check-domain-availability
POST /check-domain-availability-bulk
POST /domains/alternative-domainsUse these endpoints to:
Check if a domain is available
Check multiple domains at once
Find alternative domain options
Review availability before purchasing
Bulk domain availability checks are useful when you want to generate multiple domain options and only purchase the approved ones.
Domain endpoints allow you to purchase, list, review, and manage domains inside Mailforge.
Common endpoints include:
POST /domains
GET /domains
GET /domains/{domainID}/dns
PUT /domains/{domainID}/dns
PUT /domains/bulk-dns
PATCH /domains/forwards
PUT /domains/{domainID}/enable-autorenew
PUT /domains/{domainID}/disable-autorenewUse domain endpoints when you want to:
Purchase approved domains
View domains in your workspace
Check DNS records
Update DNS records
Apply DNS changes in bulk
Configure forwarding
Manage auto-renewal
Domain purchases and renewal changes can affect billing, so they should be handled carefully.
Mailbox endpoints allow you to create, list, update, forward, and delete mailboxes.
Common endpoints include:
POST /mailboxes
GET /mailboxes
PATCH /mailboxes/{mailboxID}
POST /mailboxes/bulk-forward
DELETE /mailboxes/{mailboxID}Use mailbox endpoints when you want to:
Create new mailboxes
View existing mailboxes
Update mailbox details
Manage forwarding
Retrieve mailbox information
Delete mailboxes when needed
Mailbox creation should usually happen after the required domains are active.
Mailbox endpoints may support retrieving credentials when needed.
Credentials can include sensitive mailbox access details such as SMTP and IMAP information.
Only retrieve credentials when required for your workflow, and never expose them in:
Frontend code
Browser-side scripts
Public logs
Shared spreadsheets
Screenshots
Slack messages
Unsecured internal tools
If you are using Salesforge, the recommended flow is usually to connect or export mailboxes into Salesforge rather than manually handling credentials.
Mailforge helps manage DNS for Mailforge-created infrastructure, including standard email authentication records.
You can use DNS endpoints to inspect or update DNS records when needed.
Common DNS actions include:
Viewing current DNS records
Adding custom records
Updating editable records
Applying DNS changes in bulk
Checking records before campaign activation
Before updating DNS through the API, always review the current records first.
Incorrect DNS changes can affect:
Email authentication
Mailbox sending
Mailbox receiving
Domain forwarding
Tracking setup
Deliverability
Forwarding endpoints help route replies and domain traffic correctly.
Mailforge supports both domain forwarding and mailbox forwarding workflows.
Common forwarding endpoints include:
PATCH /domains/forwards
POST /mailboxes/bulk-forwardUse forwarding when you want replies or domain traffic to be routed to a specific destination.
After making forwarding changes, confirm the forwarding status before relying on it in production workflows.
Your API workflow should check status before moving to the next step.
A domain or mailbox should not be treated as ready just because the creation request was submitted.
Common domain statuses can include:
Draft
Pending
Active
Failed
Expired
Scheduled for deletion
Not paid
Common mailbox statuses can include:
Draft
Pending
Processing
Active
Failed
Scheduled for deletion
Before using mailboxes in campaigns, check that the required domains and mailboxes are active.
The Mailforge API may return different response codes depending on the request.
Common examples include:
Code
Meaning
200 | Request succeeded |
201 | Resource created |
202 | Request accepted for processing |
204 | Request completed with no response body |
400 | Bad request |
401 | Unauthorized |
402 | Payment required |
404 | Resource not found |
A 202 Accepted response means the request has been accepted for processing. It does not always mean the operation is fully complete. For bulk or async actions, re-check the resource later to confirm the final status.
A common Mailforge API workflow looks like this:
Create or select the correct workspace.
Check domain availability.
Review and approve the domains to purchase.
Purchase the approved domains.
Store the returned domain IDs.
Wait for domains to become active.
Create mailboxes on the active domains.
Wait for mailboxes to become active.
Configure forwarding if needed.
Review DNS and mailbox status.
Connect the mailboxes to your sending workflow.
Start warm-up before live sending.
The API can automate the setup, but campaign sending should only begin once the infrastructure is ready.
Some API actions are low-risk and safe to automate early.
Examples:
Listing workspaces
Checking domain availability
Listing domains
Listing mailboxes
Reading DNS records
Other actions should have approval or additional checks before being automated.
Examples:
Purchasing domains
Updating DNS records
Bulk DNS updates
Changing forwarding
Enabling or disabling auto-renewal
Deleting mailboxes
Deleting workspaces
These actions can affect infrastructure, billing, or deliverability, so they should be protected with review steps.
When using the Mailforge API:
Store API keys securely
Keep API keys server-side only
Do not expose API keys in frontend code
Do not commit keys to GitHub
Use environment variables or a secrets manager
Rotate keys if they are exposed
Limit access to tools that can purchase, delete, or update DNS
Log actions without logging sensitive credentials
Add approval steps for financial or destructive actions
Treat your Mailforge API key as production infrastructure access.
The Mailforge API helps you automate email infrastructure workflows such as workspace creation, domain availability checks, domain purchases, mailbox creation, DNS management, forwarding, and mailbox management.
Use the API for infrastructure provisioning and management. Use Salesforge for campaign sending, sequencing, and reply management.
Start with read-only actions such as listing workspaces and checking domain availability. Then add guarded write actions such as workspace creation, approved domain purchases, mailbox creation, DNS updates, and forwarding changes.
Always store API keys securely, verify resource statuses, and avoid sending campaigns until the domains and mailboxes are active and properly warmed.