---
title: "Let your agent activate Forge"
slug: activate-forge-api
description: "Your agent can now move a domain to Resend Forge through the MCP server, the CLI, or the API."
created_at: "2026-12-03"
updated_at: "2026-12-03"
image: https://cdn.resend.com/posts/activate-the-forge-api.jpg
humans: ["lucas-costa", "lucas-vieira"]
---

In October, we launched [Resend Forge](/blog/announcing-resend-forge), the email infrastructure Resend runs on its own IPs, built for speed and deliverability. Until now, the only way to activate it was from the dashboard.

Today, **your agent can activate Resend Forge on a domain**. It works through the MCP server, the CLI, and the API, so you can also run it from your own code or scripts.

## Let your agent do it

Connect your agent to the [Resend MCP server](/docs/mcp-server), then paste this prompt. Replace `example.com` with your domain.

```text copy
Activate Resend Forge on my domain example.com.

1. Find the domain ID with list-domains.
2. Call enable-forge for that domain.
3. Show me the Forge CNAME record from the response, and the Receiving MX record if there is one, so I can add them at my DNS provider. Wait until I confirm.
4. Call verify-domain with scope ["forge"], then poll get-domain until the Forge CNAME record shows "verified". For a receive-only domain, there is no Forge CNAME, so poll until the Receiving MX record shows "verified".

If the API returns forge_unavailable, tell me the reason and stop.
```

Your agent can't edit your DNS, so you still add the records. Everything else is handled for you.

## How activation works

Activating a domain lets Resend move it to Forge with no code changes on your part. 

**Sending continues**

Sending keeps going through the current records while the Forge record verifies. After the record and DKIM show verified, the domain shows a **Ready** tag.

**Smart migration**

To keep your deliverability high, Resend slowly moves your sending over to Forge in the background. Once we've moved all of your sending over, the tag changes to **Active** once email routes through Forge.

How the domain moves depends on your setup:
- **If the domain also receives email**, receiving moves only once you replace your current `MX` record with the new value from the API response.
- **On a receive-only domain**, there's no sending to move, so activating moves only receiving. The response has the new `Receiving` `MX` record and no Forge `CNAME`, and `custom_return_path` is ignored.
- **Open and click tracking** aren't supported on Forge yet. You can activate a domain with tracking on, but its email keeps going through the current infrastructure until you turn tracking off.

## Activate Forge with the API

Call `POST /domains/:id/forge`. The response is the full domain. For a sending domain, `records` includes a new Forge `CNAME`. For a receive-only domain, there is no Forge `CNAME`, and the response has the new Receiving `MX` record instead. Calling the endpoint again returns the domain's current state.

Optionally pass `custom_return_path` to choose the Forge return path label. Leave it out and Resend picks a free label in your DNS.

<CodeTabs codeHeight={250}>
```nodejs
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.domains.forge.enable({
  id: 'd91cd9bd-1176-453e-8fc1-35364d380206',
});
```

```php
$resend = Resend::client('re_xxxxxxxxx');

$resend->domains->forge->enable('d91cd9bd-1176-453e-8fc1-35364d380206');
```

```python
import resend

resend.api_key = "re_xxxxxxxxx"

resend.Domains.Forge.enable({"id": "d91cd9bd-1176-453e-8fc1-35364d380206"})
```

```ruby
require "resend"

Resend.api_key = "re_xxxxxxxxx"

Resend::Domains::Forge.enable(id: "d91cd9bd-1176-453e-8fc1-35364d380206")
```

```go
package main

import "github.com/resend/resend-go/v4"

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	client.DomainForge.Enable("d91cd9bd-1176-453e-8fc1-35364d380206", nil)
}
```

```rust
use resend_rs::types::EnableForgeOptions;
use resend_rs::{Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  resend
    .domains
    .enable_forge("d91cd9bd-1176-453e-8fc1-35364d380206", EnableForgeOptions::new())
    .await?;

  Ok(())
}
```

```java
import com.resend.Resend;
import com.resend.core.exception.ResendException;
import com.resend.services.domains.model.Domain;

public class Main {
    public static void main(String[] args) throws ResendException {
        Resend resend = new Resend("re_xxxxxxxxx");

        Domain domain = resend.domains().forge().enable("d91cd9bd-1176-453e-8fc1-35364d380206");
    }
}
```

```dotnet
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI

var domainId = new Guid( "d91cd9bd-1176-453e-8fc1-35364d380206" );

var resp = await resend.DomainForgeEnableAsync( domainId );
```

```curl
curl -X POST 'https://api.resend.com/domains/d91cd9bd-1176-453e-8fc1-35364d380206/forge' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json'
```

```cli
resend domains forge enable d91cd9bd-1176-453e-8fc1-35364d380206
```
</CodeTabs>

## Add the DNS record

Create the `CNAME` at your DNS provider. Your existing records stay in place.

```json
{
  "record": "SPF",
  "name": "forge",
  "value": "send.forge.rmta.net",
  "type": "CNAME",
  "status": "pending",
  "ttl": "Auto"
}
```

If the domain also receives email, the response includes a `Receiving` `MX` record with a new value. Replace your current `MX` record with it when you're ready to move receiving.

## Verify the Forge record

Call `POST /domains/:id/verify` with `scope: ["forge"]`. Only the Forge record is checked, and already verified records stay verified.

<CodeTabs codeHeight={250}>
```nodejs
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.domains.verify('d91cd9bd-1176-453e-8fc1-35364d380206', {
  scope: ['forge'],
});
```

```php
$resend = Resend::client('re_xxxxxxxxx');

$resend->domains->verify('d91cd9bd-1176-453e-8fc1-35364d380206', [
  'scope' => ['forge'],
]);
```

```python
import resend

resend.api_key = "re_xxxxxxxxx"

resend.Domains.verify(
  domain_id="d91cd9bd-1176-453e-8fc1-35364d380206",
  params={"scope": ["forge"]},
)
```

```ruby
require "resend"

Resend.api_key = "re_xxxxxxxxx"

Resend::Domains.verify("d91cd9bd-1176-453e-8fc1-35364d380206", scope: ["forge"])
```

```go
package main

import (
	"context"

	"github.com/resend/resend-go/v4"
)

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	client.Domains.VerifyWithOptions(
		context.Background(),
		"d91cd9bd-1176-453e-8fc1-35364d380206",
		&resend.VerifyDomainOptions{
			Scope: []resend.VerifyDomainScope{resend.VerifyDomainScopeForge},
		},
	)
}
```

```rust
use resend_rs::types::{VerifyDomainOptions, VerifyDomainScope};
use resend_rs::{Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  resend
    .domains
    .verify(
      "d91cd9bd-1176-453e-8fc1-35364d380206",
      VerifyDomainOptions::new().with_scope([VerifyDomainScope::Forge]),
    )
    .await?;

  Ok(())
}
```

```java
import com.resend.Resend;
import com.resend.core.exception.ResendException;
import com.resend.services.domains.model.VerifyDomainOptions;
import com.resend.services.domains.model.VerifyDomainScope;
import java.util.List;

public class Main {
    public static void main(String[] args) throws ResendException {
        Resend resend = new Resend("re_xxxxxxxxx");

        resend.domains().verify(
            "d91cd9bd-1176-453e-8fc1-35364d380206",
            VerifyDomainOptions.builder().scope(List.of(VerifyDomainScope.FORGE)).build()
        );
    }
}
```

```dotnet
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI

var domainId = new Guid( "d91cd9bd-1176-453e-8fc1-35364d380206" );

await resend.DomainVerifyAsync( domainId, new[] { DomainVerificationScope.Forge } );
```

```curl
curl -X POST 'https://api.resend.com/domains/d91cd9bd-1176-453e-8fc1-35364d380206/verify' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d '{"scope": ["forge"]}'
```

```cli
resend domains verify d91cd9bd-1176-453e-8fc1-35364d380206 --scope forge
```
</CodeTabs>

## Wait for verification

Poll `GET /domains/:id` until the Forge record's `status` is `verified`. If receiving moved, wait for the `Receiving` `MX` record to show `verified` too.

Forge verification is complete when the Forge `CNAME` record in `records` shows `verified`:

```json
{
  "record": "SPF",
  "name": "forge",
  "value": "send.forge.rmta.net",
  "type": "CNAME",
  "status": "verified",
  "ttl": "Auto"
}
```

## Which domains can activate Forge

Any domain can activate Forge, including receive-only domains, with **no changes to your code, SMTP credentials, or webhooks**. A few domains get a `forge_unavailable` error instead:

- Domains on a **dedicated IP**
- Domains with **legacy DKIM**: domains verified with an older DKIM setup that Forge doesn't support. This is rare. Contact support if you need Forge on one.
- Domains **claimed by another team**, or registered on another team with a claim that hasn't completed

We're committed to a [headless dashboard](/blog/headless-dashboard-initiative) so that you can perform every key task programmatically. If you run an agency, a CMS, or otherwise manage DNS records for your customers, you can now activate Resend Forge on each of their domains from your own code.

To learn more, check out the [Activate Forge API reference](/docs/api-reference/domains/enable-forge) and the [Resend Forge documentation](/docs/forge).
