# Claim Domain

> POST /domains/claim — claim a domain that is already verified by another account.

`POST /domains/claim`

Claims a domain that is already verified by **another MailBlastr account**. Use this when [creating a domain](https://www.mailblastr.com/docs/api/domains-create) fails because the domain is already in use elsewhere. MailBlastr creates a placeholder domain on your account and returns a `domain_claim` object with a single TXT `record` to publish at your DNS provider. After publishing it, call [Verify Domain Claim](https://www.mailblastr.com/docs/api/domains-verify-claim) and poll [Get Domain Claim](https://www.mailblastr.com/docs/api/domains-get-claim) to follow the `status`.

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | The name of the domain you want to claim, e.g. `yourdomain.com`. |
| `region` | string | No | Optional, for compatibility. The claim is always pinned to MailBlastr’s configured region. See [Choosing a region](https://www.mailblastr.com/docs/domains/region). |

**Node.js**

```js
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.domains.claim({
  "name": "yourdomain.com"
});
console.log({ data, error });
```

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

Mailblastr::Domains.claim({
  "name": "yourdomain.com"
})
```

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

$mailblastr->domains->claim([
  'name' => "yourdomain.com"
]);
```

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

mailblastr.Domains.claim({
  "name": "yourdomain.com"
})
```

**Go**

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    req, _ := http.NewRequest("POST", "https://api.mailblastr.com/domains/claim", strings.NewReader(`{
  "name": "yourdomain.com"
}`))
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    req.Header.Set("Content-Type", "application/json")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    out, _ := io.ReadAll(res.Body)
    fmt.Println(string(out))
}
```

**Rust**

```rust
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = Client::new()
        .post("https://api.mailblastr.com/domains/claim")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .header("Content-Type", "application/json")
        .body(r#"{
  "name": "yourdomain.com"
}"#)
        .send()
        .await?;
    println!("{}", res.text().await?);
    Ok(())
}
```

**Java**

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.mailblastr.com/domains/claim"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "name": "yourdomain.com"
}
"""))
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

**.NET**

```csharp
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.mailblastr.com/domains/claim");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
request.Content = new StringContent(@"{
  ""name"": ""yourdomain.com""
}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

```bash
curl -X POST 'https://api.mailblastr.com/domains/claim' \
  -H 'Authorization: Bearer mb_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "yourdomain.com"
}'
```

**CLI**

```bash
mailblastr domains claim start yourdomain.com
```

### Response

The `domain_claim` object. The `domain_id` is the placeholder domain id — use it for the get and verify calls below.

```json
{
  "object": "domain_claim",
  "id": "dacf4072-4119-4d88-932f-6c6126d3a9d1",
  "name": "yourdomain.com",
  "status": "pending",
  "domain_id": "d91cd9bd-1176-453e-8fc1-35364d380206",
  "region": "us-east-1",
  "record": {
    "type": "TXT",
    "name": "yourdomain.com",
    "value": "mailblastr-domain-verification=3f8a1c2d4e5b6a7f8091a2b3c4d5e6f7",
    "ttl": "Auto"
  },
  "blocked_reason": null,
  "failure_reason": null,
  "created_at": "2026-06-16T17:12:02.059Z",
  "expires_at": "2026-06-23T17:12:02.059Z"
}
```

> **Note:** The claim `expires_at` roughly a week after creation. Publish the TXT record and verify before then, or start a new claim.
