# 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 — a numeric string (e.g. `48213`), as returned by [GET /logs](https://www.sendping.co/docs/api/logs-list). |

## Response fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | No | Always `log`. |
| `id` | string | No | The log id — a numeric string (e.g. `"48213"`), not a UUID. |
| `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 { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.logs.get('48213');
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Logs.get("48213")
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->logs->get('48213');
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Logs.get("48213")
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

entry, err := client.Logs.Get("48213")
```

**Rust**

```rust
use sendping::SendPing;

let mb = SendPing::new("mb_xxxxxxxxx");

let _entry = mb.logs.get("48213").await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.logs().get("48213");
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.LogRetrieveAsync("48213");
```

**cURL**

```bash
curl -X GET 'https://www.sendping.co/api/logs/48213' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
sendping logs get 48213
```

## Response

```json
{
  "object": "log",
  "id": "48213",
  "created_at": "2026-06-23T13:43:54.622Z",
  "endpoint": "/api/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.sendping.co/docs/api/errors).
