# Mark Received Email Read or Unread

> PATCH /emails/receiving/:id — mark a received email as read or unread.

`PATCH /emails/receiving/:id`

Set the read state of a received email. The dashboard Inbox marks a message read when you open it and shows unread messages — and the domains and inboxes holding them — in bold, exactly like a mail client; use this endpoint to drive the same state from your own tooling (for example, mark a message read once your ticketing system has ingested it, or unread to surface it again). Requires a **write-scoped** API key.

> **Note:** Reading a message through [GET /emails/receiving/:id](https://www.mailblastr.com/docs/api/emails-received-get) never changes its read state. An integration polling for content is not the account owner reading their inbox.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The id of the received email. |

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `read` | boolean | Yes | `true` marks the email read, `false` marks it unread. Marking an already-read email read again is a no-op that keeps the original `read_at`. |

**Node.js**

```js
const res = await fetch('https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer mb_xxxxxxxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ "read": true }),
});
const data = await res.json();
console.log(data);
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Patch.new(uri)
req['Authorization'] = 'Bearer mb_xxxxxxxxx'
req['Content-Type'] = 'application/json'
req.body = <<~JSON
{ "read": true }
JSON
res = http.request(req)
puts res.body
```

**PHP**

```php
<?php
$ch = curl_init('https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer mb_xxxxxxxxx',
        'User-Agent: my-app/1.0',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
{ "read": true }
JSON,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Python**

```python
import requests

res = requests.patch(
    "https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
    headers={"Authorization": "Bearer mb_xxxxxxxxx", "Content-Type": "application/json"},
    json={ "read": true },
)
print(res.json())
```

**Go**

```go
package main

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

func main() {
    req, _ := http.NewRequest("PATCH", "https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c", strings.NewReader(`{ "read": true }`))
    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()
        .patch("https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .header("User-Agent", "my-app/1.0")
        .header("Content-Type", "application/json")
        .body(r#"{ "read": true }"#)
        .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://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .header("User-Agent", "my-app/1.0")
    .header("Content-Type", "application/json")
    .method("PATCH", HttpRequest.BodyPublishers.ofString("""
{ "read": true }
"""))
    .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.Patch, "https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
request.Headers.Add("User-Agent", "my-app/1.0");
request.Content = new StringContent(@"{ ""read"": true }", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

```bash
curl -X PATCH 'https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c' \
  -H 'Authorization: Bearer mb_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{ "read": true }'
```

## Response

The updated [received-email object](https://www.mailblastr.com/docs/api/emails-received-get), with `read` and `read_at` reflecting the new state.

```json
{
  "object": "received_email",
  "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
  "to": ["delivered@yourdomain.com"],
  "from": "onboarding@example.com",
  "subject": "Hello World",
  "read": true,
  "read_at": "2026-06-24T09:02:17.113Z",
  "created_at": "2026-06-23T22:13:42.674Z"
}
```

## Errors

Returns `validation_error` (422) when the body is not a JSON object with a boolean `read`, and `not_found` (404) if no received email with that id exists for your account. See the [error reference](https://www.mailblastr.com/docs/api/errors).
