# Retrieve Log

> GET /logs/:id — fetch a single API request log with its request and response bodies.

`GET /logs/:id`

Retrieve a single API request log by id, including the captured `request_body` and `response_body`. The shape of those two fields varies depending on the original request that was logged.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The log id. |

## Response fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | No | Always `log`. |
| `id` | string | No | The log id. |
| `created_at` | string | No | When the request was made. |
| `endpoint` | string | No | The request path. |
| `method` | string | No | The HTTP method. |
| `response_status` | number | No | The HTTP status code returned. |
| `user_agent` | string | No | The `User-Agent` of the caller. |
| `request_body` | object | No | The captured request body. Shape varies by the logged request. |
| `response_body` | object | No | The captured response body. Shape varies by the logged request. |

## Request

**Node.js**

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

const mb = new MailBlastr('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

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

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

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

**Go**

```go
package main

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

func main() {
    req, _ := http.NewRequest("GET", "https://api.mailblastr.com/logs/37e4414c-5e25-4dbc-a071-43552a4bd53b", nil)
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    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()
        .get("https://api.mailblastr.com/logs/37e4414c-5e25-4dbc-a071-43552a4bd53b")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .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/logs/37e4414c-5e25-4dbc-a071-43552a4bd53b"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .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.Get, "https://api.mailblastr.com/logs/37e4414c-5e25-4dbc-a071-43552a4bd53b");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

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

**CLI**

```bash
mailblastr logs get 37e4414c-5e25-4dbc-a071-43552a4bd53b
```

## Response

```json
{
  "object": "log",
  "id": "37e4414c-5e25-4dbc-a071-43552a4bd53b",
  "created_at": "2026-06-23T13:43:54.622Z",
  "endpoint": "/emails",
  "method": "POST",
  "response_status": 200,
  "user_agent": "curl/8.7.1",
  "request_body": {
    "from": "Acme <hello@yourdomain.com>",
    "to": ["delivered@example.com"],
    "subject": "Hello World"
  },
  "response_body": {
    "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
  }
}
```

## Errors

Returns `not_found` (404) if no log with that id exists for your account. See the [error reference](https://www.mailblastr.com/docs/api/errors).
