---
title: "Purchase pre-warmed domains"
method: POST
path: "/domains/pre-warmed"
tags: ["Domains"]
---

# Purchase pre-warmed domains

`POST /domains/pre-warmed`

## Request

- Base URL: `https://api.mailforge.ai/public`
- URL: `https://api.mailforge.ai/public/domains/pre-warmed`
- Auth: API key in header `Authorization`

Purchase pre-warmed domains (and their bundled mailboxes) and attach them to the workspace. Charges the account directly (no checkout redirect) and requires an active subscription. Returns the attached domains, mailboxes, setup and the resulting invoice.

## Request body

- ApiExternalPurchasePreWarmedDomainsRequest
  - `dmarcEmail` string
  - `domainIds` string[]
  - `forwardToDomain` string
  - `workspaceId` string

## Response `200`

OK

- ApiExternalBuyPreWarmedDomainsResponse
  - `domains` MailforgeExternalApiDeliveryApiDomainResponse[]
    - `autoRenewFailedReason` string
    - `autoRenewLastProcessedExpiration` string
    - `autoRenewProcessedAt` string
    - `autoRenewStatus` 'disabled' | 'enabled' | 'failed'
    - `createdAt` string
    - `dmarcEmail` string
    - `expiresAt` string
    - `failedReason` string
    - `forwardToDomain` string
    - `id` string
    - `isTransferred` boolean
    - `mailDeletionAt` string
    - `mailServerId` integer
    - `nameservers` string[]
    - `priceCents` integer
    - `setupId` string
    - `sld` string
    - `status` 'draft' | 'active' | 'pending' | 'failed' | 'expired' | 'warning' | 'scheduled_for_deletion' | 'not_paid'
    - `tld` string
    - `type` 'v2'
    - `updatedAt` string
    - `workspaceId` string
  - `invoice` ApiPurchaseInvoiceResponse
    - `amountPaid` integer
    - `creditsApplied` integer
    - `id` string
    - `paidAt` string
    - `subTotal` integer
    - `total` integer
  - `mailboxes` MailforgeExternalApiDeliveryApiMailboxResponse[]
    - `createdAt` string
    - `credentials` ApiMailboxCredentials
      - `imapHost` string
      - `imapPassword` string
      - `imapPort` integer
      - `imapUsername` string
      - `smtpHost` string
      - `smtpPassword` string
      - `smtpPort` integer
      - `smtpUsername` string
    - `domain` string
    - `domainId` string
    - `email` string
    - `failedReason` string
    - `firstName` string
    - `forwardingEmail` string
    - `forwardingStatus` 'pending' | 'active' | 'failed'
    - `id` string
    - `isPrewarmed` boolean
    - `isTransferred` boolean
    - `lastName` string
    - `nameservers` string[]
    - `signature` string
    - `status` 'draft' | 'active' | 'pending' | 'processing' | 'failed' | 'scheduled_for_deletion' | 'deleting'
    - `updatedAt` string
    - `username` string
    - `workspaceId` string
  - `setup` ApiExternalSetupResponse
    - `dmarcEmail` string
    - `forwardToDomain` string
    - `id` string
    - `status` string
    - `workspaceId` string
  - `workspaceId` string

## Other responses

- `400`: Invalid request or no active subscription
- `404`: Workspace or domains not found
- `409`: Unpaid Mailforge subscription balance; code: unpaid_subscription_balance. Settle outstanding invoices before subscribing again.

---

[API](https://skmtc.dev/mailforge/apis/mailforge-api.md) - [All operations](https://skmtc.dev/mailforge/apis/mailforge-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mailforge/apis/mailforge-api/revisions/7d2c137f9fc3?raw)
