---
title: "Logs API"
slug: logs-api
description: "Access your API request logs from anywhere."
created_at: "2026-04-09"
updated_at: "2026-04-09"
image: https://cdn.resend.com/posts/logs-api.jpg
humans: ["felipe-freitag"]
---

When something goes wrong with an API request, the most important thing is visibility.

You've always had access to view your API logs in the Resend [dashboard](/logs). That works well for manual debugging, but it falls short when you need to equip an agent, build monitoring tools, or create custom tooling around your email sending.

Today, we're introducing two new endpoints that give you programmatic access to your API request logs.

<video
  src="https://cdn.resend.com/posts/api-logs-1.mp4"
  autoPlay
  loop
  muted
  playsInline
  className="extraWidth"
/>

## Retrieving logs
To use the Logs API, you can use the following endpoint.

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

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.logs.list();
```

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

$resend->logs->list();
```

```python
import resend

resend.api_key = "re_xxxxxxxxx"

resend.Logs.list()
```

```ruby
Resend.api_key = "re_xxxxxxxxx"

logs = Resend::Logs.list
puts logs
```

```go
package main

import (
	"context"

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

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

	logs, err := client.Logs.ListWithOptions(ctx, nil)
	if err != nil {
		panic(err)
	}

	if logs.HasMore {
		opts := &resend.ListOptions{
			After: &logs.Data[len(logs.Data)-1].Id,
		}
		client.Logs.ListWithOptions(ctx, opts)
	}
}
```

```rust
use resend_rs::{Resend, Result, list_opts::ListOptions};

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

  let _logs = resend
    .logs
    .list(ListOptions::default())
    .await?;

  Ok(())
}
```

```java
import com.resend.*;

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

        resend.logs().list();
    }
}
```

```dotnet
using Resend;
using System.Linq;

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

var resp = await resend.LogListAsync();
Console.WriteLine( "Count={0}", resp.Content.Data.Count );

if ( resp.Content.HasMore )
{
    var lastId = resp.Content.Data.Last().Id;
    await resend.LogListAsync( new PaginatedQuery()
    {
        After = lastId.ToString(),
    } );
}
```

```curl
curl -X GET 'https://api.resend.com/logs' \
     -H 'Authorization: Bearer re_xxxxxxxxx'
```

```cli
resend logs list
resend logs list --limit 25
```
</CodeTabs>

The returned list of logs includes details like:
- endpoint
- method
- status code
- user agent

## Drilling down

When you need the full picture, **retrieve a single log entry** to inspect the original request and response bodies.

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

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.logs.get(
  '37e4414c-5e25-4dbc-a071-43552a4bd53b',
);
```

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

$resend->logs->get('37e4414c-5e25-4dbc-a071-43552a4bd53b');
```

```python
import resend

resend.api_key = "re_xxxxxxxxx"

resend.Logs.get("37e4414c-5e25-4dbc-a071-43552a4bd53b")
```

```ruby
Resend.api_key = "re_xxxxxxxxx"

log = Resend::Logs.get("37e4414c-5e25-4dbc-a071-43552a4bd53b")
puts log
```

```go
package main

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

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

	client.Logs.Get("37e4414c-5e25-4dbc-a071-43552a4bd53b")
}
```

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

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

  let _logs = resend
    .logs
    .get("37e4414c-5e25-4dbc-a071-43552a4bd53b")
    .await?;

  Ok(())
}
```

```java
import com.resend.*;

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

        resend.logs().get("37e4414c-5e25-4dbc-a071-43552a4bd53b");
    }
}
```

```dotnet
using Resend;

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

var resp = await resend.LogRetrieveAsync( new Guid( "37e4414c-5e25-4dbc-a071-43552a4bd53b" ) );
Console.WriteLine( "Endpoint={0}", resp.Content.Endpoint );
```

```curl
curl -X GET 'https://api.resend.com/logs/37e4414c-5e25-4dbc-a071-43552a4bd53b' \
     -H 'Authorization: Bearer re_xxxxxxxxx'
```

```cli
resend logs get 37e4414c-5e25-4dbc-a071-43552a4bd53b
```
</CodeTabs>

For more details, check out the [Logs API reference](/docs/api-reference/logs/list-logs).

## Getting started

Retrieving and inspecting logs programmatically opens up new possibilities:

- Equip your agent with better debugging tools
- Build custom dashboards, reports, and monitoring tools
- Integrate with your existing infrastructure

The Logs API is available in all [official Resend SDKs](/docs/sdks). It's also integrated into the [Resend CLI](/changelog/cli) and [MCP Server](/changelog/mcp).

We hope these new endpoints help you get more visibility into your email events, enabling you to build with more confidence than ever before.
