API Reference
Retrieve Log
GET /logs/:id — fetch a single API request log with its request and response bodies.
GET
/logs/:idRetrieve 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
idstringrequiredThe log id.
Response fields
objectstringoptionalAlways log.
idstringoptionalThe log id.
created_atstringoptionalWhen the request was made.
endpointstringoptionalThe request path.
methodstringoptionalThe HTTP method.
response_statusnumberoptionalThe HTTP status code returned.
user_agentstringoptionalThe User-Agent of the caller.
request_bodyobjectoptionalThe captured request body. Shape varies by the logged request.
response_bodyobjectoptionalThe 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.