API Reference

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

idstringrequired

The log id.

Response fields

objectstringoptional

Always log.

idstringoptional

The log id.

created_atstringoptional

When the request was made.

endpointstringoptional

The request path.

methodstringoptional

The HTTP method.

response_statusnumberoptional

The HTTP status code returned.

user_agentstringoptional

The User-Agent of the caller.

request_bodyobjectoptional

The captured request body. Shape varies by the logged request.

response_bodyobjectoptional

The captured response body. Shape varies by the logged request.

Request

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 });

Response

{
  "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.