Logs: Reading

Get Logs

Read up to 50 logs by email ID, the `id` you get back when you send. Add `include_content` to get the HTML that was delivered.

POSThttps://g.sendcorex.com/v1/logscommand: get_logs
i

Needs the logs:read scope on your API key.

i

An ID costs the same to look up no matter how many emails you send: there is no scan behind it.

Arguments

  • idsstring[]optional

    Up to 50 email IDs (UUIDs). Repeated ids count once.

    e.g. ["3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f"]

  • idstringoptional

    A single email ID. Use this or ids.

    e.g. "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f"

  • include_contentbooleanoptional

    Also return the HTML of each email. With it, the limit is 10 ids per command.

    e.g. true

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/logs',
  {
    commands: [
      {
        command: "get_logs",
        args: {
          ids: [
            "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f",
            "00000000-0000-4000-8000-000000000000"
          ]
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Response

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "get_logs",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 18,
      "data": {
        "logs": [
          {
            "id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f",
            "to": "ana@acme.com",
            "from": "noreply@yourdomain.com",
            "domain": "acme.com",
            "from_domain": "yourdomain.com",
            "subject": "Your order #1042 has shipped",
            "status": "delivered",
            "status_code": 2,
            "response": "250 2.0.0 OK 1760684401 a1si123456",
            "message": null,
            "blocked": false,
            "block_reason": null,
            "retries": 0,
            "tracking_id": "7CK-JDL-Y1L-20261017",
            "sent_at": "2026-10-17T06:00:01.204Z",
            "updated_at": "2026-10-17T06:00:02.913Z"
          }
        ],
        "not_found": [
          "00000000-0000-4000-8000-000000000000"
        ]
      }
    }
  ]
}

Response fields

  • logs

    The logs that were found, in the order you asked for them.

  • not_found

    The ids that do not exist in your account, are older than 60 days, or belong to warm-up emails.

  • logs[].id

    The email ID (a UUID). It is the id you get back when you send, and what you pass to Get Logs.

  • logs[].to / logs[].domain

    The recipient and the recipient's domain.

  • logs[].from_domain

    The sender's domain (the part after @ in from).

  • logs[].from

    The sender address.

  • logs[].subject

    The subject line.

  • logs[].status

    delivered, bounced, spam, rate_limited or not_sent. status_code is the same thing as a number.

  • logs[].response

    What the recipient server answered, for example 250 2.0.0 OK or the 550 bounce reason.

  • logs[].message

    Extra detail from Sendcorex about the delivery, when there is any.

  • logs[].blocked / logs[].block_reason

    true when Sendcorex did not send to this recipient (suppressed or restricted), and why.

  • logs[].retries

    How many times the delivery was retried.

  • logs[].tracking_id

    The internal delivery id. Bounce and complaint webhooks carry the same value.

  • logs[].sent_at / logs[].updated_at

    When the email was sent, and when its status last changed. ISO 8601, UTC.

  • logs[].content.html

    The HTML that was delivered. Only with include_content: true; null when the body was not stored.

Reading the body

The body is the heaviest part of a log, so it only comes back when you ask. It is the HTML as it was delivered: if tracking was on, it can include the tracking pixel and rewritten links.

Request body

{
  "commands": [
    {
      "command": "get_logs",
      "args": {
        "id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f",
        "include_content": true
      }
    }
  ]
}
!

Rendering that HTML can load the tracking pixel and count as an open. Show it in a sandboxed iframe with remote images blocked, the way the dashboard does.

Details for a page of List Logs

Chain the two commands with $ref: the ids from the list go straight into Get Logs, in one request.

Request body

{
  "commands": [
    {
      "command": "list_logs",
      "id": "bounces",
      "args": {
        "status": "bounced",
        "limit": 10
      }
    },
    {
      "command": "get_logs",
      "args": {
        "ids": {
          "$ref": "bounces",
          "path": "logs/*/id"
        },
        "include_content": true
      }
    }
  ]
}

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401INVALID_API_KEY

    The API key does not exist, was revoked or was disabled in the dashboard.

  • 429RATE_LIMITED

    More than 15 requests/s or 15 in flight for the same IP + API key. Wait the number of seconds in Retry-After.

  • CMDMISSING_SCOPE

    The API key does not have `logs:read`.

  • CMDINVALID_ARGS

    An argument is invalid: unknown status, recipient that is not a full email, limit out of range, id that is not a UUID, after later than before…

  • CMDINTERNAL

    Server error. The detail is only written to the server log.