Receive Emails: Identity

Whoami

Returns which mailbox this credential belongs to and details about the credential itself, without reading any message. Use it to verify that a credential belongs to a specific mailbox.

POSThttps://g.sendcorex.com/v1command: whoami
i

Every field under token except type is only returned when the credential is a mailbox token (mailbox_token). OAuth access tokens return only token.type.

Arguments

This endpoint takes no arguments.

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "whoami"
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

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": "whoami",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "mailbox": {
          "email": "support@acme.com",
          "from_name": "Acme Support",
          "sender_ref": "snd_7Kq2Xr9P"
        },
        "token": {
          "type": "mailbox_token",
          "id": "mbt_3Fh8LwQ1",
          "name": "Helpdesk bot",
          "prefix": "scx_mb_4f9a",
          "created_at": "2026-10-02T09:14:00.000Z",
          "expires_at": null,
          "last_used_at": "2026-11-19T00:31:12.000Z"
        }
      }
    }
  ]
}

Response fields

  • mailbox.email

    The mailbox address this credential belongs to.

  • mailbox.from_name

    The display name used when sending from this mailbox.

  • mailbox.sender_ref

    The reference of the sender profile behind this mailbox.

  • token.type

    mailbox_token for a mailbox token, oauth for an OAuth access token.

  • token.id

    The token ID. Only for mailbox_token.

  • token.name

    The name given to the token. Only for mailbox_token.

  • token.prefix

    The first characters of the token, as shown in the dashboard. Only for mailbox_token.

  • token.created_at

    When the token was created. Only for mailbox_token.

  • token.expires_at

    When the token expires, or null if it never expires. Only for mailbox_token.

  • token.last_used_at

    The last time the token was used, or null. Only for mailbox_token.

Errors

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

  • 401TOKEN_EXPIRED

    The access token has expired. Call Refresh Token and repeat the request.

  • 401INVALID_TOKEN

    The token is malformed, unknown or revoked.

  • 429RATE_LIMITED

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

  • CMDINTERNAL

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