---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/api-reference/security

API Reference

# Security

See why logins failed and unblock your IPs from your own code. One route, POST /v1/security, with the same command format as the other /v1 routes.

- POST /v1/security
- smtp:read
- smtp:create

## Authentication

smtp:read

Lists: `list_auth_errors` and `list_blocked_ips`.

smtp:create

Unblock: `unblock_ip`.

Send the API key as `Authorization: Bearer <key>`. The body is `{ "commands": [ { "command", "args", "id" } ] }`, like every /v1 route.

## Commands

`list_auth_errors` smtp:read

Failed SMTP, API and MCP logins of the last 30 days, newest first. Identical errors are merged into one row with a count.

**Arguments**
`cursor`, `limit` (1–200, default 50), `source` (`smtp`, `api`, `mcp`, `api_v1`), `reason`, `ip`. All optional.

**Returns**
`items` (`id`, `at`, `first_at`, `count`, `source`, `credential`, `ip`, `reason`, `message`) and `next_cursor`.

`credential` is the SMTP username or `api_key …ab12`: a password or a full key never appears. `message` is the exact reply the client received. An invalid cursor starts the list over.

Request

```
curl -s -X POST https://g.sendcorex.com/v1/security \
  -H "Authorization: Bearer $SENDCOREX_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"commands":[{"command":"list_auth_errors","args":{"source":"smtp","limit":50},"id":"1"}]}'
```

Response

```
{
  "type": "SUCCESS",
  "results": [{
    "command": "list_auth_errors", "id": "1", "type": "SUCCESS",
    "data": {
      "items": [{
        "id": "ae_01JE7Q…",
        "at": "2026-12-02T10:14:09Z",
        "first_at": "2026-12-02T09:58:41Z",
        "count": 7,
        "source": "smtp",
        "credential": "user-8f2k1",
        "ip": "203.0.113.24",
        "reason": "wrong_password",
        "message": "535 5.7.8 Authentication failed: wrong username or password. https://docs.sendcorex.com/errors#smtp_wrong_password"
      }],
      "next_cursor": "eyJ0IjoxNzMz…"
    }
  }]
}
```

`list_blocked_ips` smtp:read

The IPs blocked on your account right now, how many self-service unblocks you have left, and the thresholds.

**Arguments**
None.

**Returns**
`items` (`ip`, `reason`, `until`, `level`, `pair_blocked`, `wrong_password_count`, `can_unblock`), `quota` (`used`, `max`, `left`, `resets_at`) and `thresholds`.

`reason` is `wrong_password`, `daily_limit`, `too_many_connections` or `abuse`; only `abuse` has `can_unblock: false`. `level` goes from 1 to 5 (5 min, 10 min, 30 min, 1 h, 6 h). When the block is only for one username on that IP (`pair_blocked: true`), `level` and `until` are `null` and it lifts on its own within 1 hour.

Request

```
curl -s -X POST https://g.sendcorex.com/v1/security \
  -H "Authorization: Bearer $SENDCOREX_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"commands":[{"command":"list_blocked_ips","args":{},"id":"1"}]}'
```

Response

```
{
  "type": "SUCCESS",
  "results": [{
    "command": "list_blocked_ips", "id": "1", "type": "SUCCESS",
    "data": {
      "items": [{
        "ip": "203.0.113.24",
        "reason": "wrong_password",
        "until": "2026-12-02T10:44:09Z",
        "level": 3,
        "pair_blocked": false,
        "wrong_password_count": 5,
        "can_unblock": true
      }],
      "quota": { "used": 1, "max": 3, "left": 2, "resets_at": "2026-12-28T00:00:00Z" },
      "thresholds": {
        "wrong_password_per_ip": "…",
        "wrong_password_many_ips": "…",
        "failed_logins_progressive": "…",
        "self_unblocks_per_30_days": 3,
        "unblock_takes_effect_within": "10 seconds"
      }
    }
  }]
}
```

`unblock_ip` smtp:create

Unblocks one of your IPs.

**Arguments**
`ip` (required).

**Returns**
The same as `list_blocked_ips`, plus `message`.

Request

```
curl -s -X POST https://g.sendcorex.com/v1/security \
  -H "Authorization: Bearer $SENDCOREX_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"commands":[{"command":"unblock_ip","args":{"ip":"203.0.113.24"},"id":"1"}]}'
```

Response

```
{
  "type": "SUCCESS",
  "results": [{
    "command": "unblock_ip", "id": "1", "type": "ERROR",
    "code": "UNBLOCK_QUOTA",
    "message": "You already used 3 of 3 unblocks in the last 30 days.",
    "fix": "Wait until quota.resets_at, or contact support.",
    "docs_url": "https://docs.sendcorex.com/errors#unblock_quota",
    "retryable": false
  }]
}
```

## Unblock rules

1

Only blocks you caused

Wrong password, daily limit and too many connections can be unblocked here. Abuse blocks need support.

2

3 unblocks per 30 days

The limit is for the whole account, not per IP.

3

Works again in ~10 seconds

An unblock takes effect within about 10 seconds.

4

Fix the cause first

Update the password in every app before unblocking, or the IP gets locked again.

## When an IP or credential gets locked

Wrong password, one IP

5 wrong passwords from one IP for one username within 1 hour lock that IP.

Wrong password, many IPs

Wrong passwords from 5 different IPs within 1 hour lock the credential.

Failed logins, one IP

5 failed logins from one IP within 2 minutes block the IP, for longer each time.

## Reasons in list_auth_errors

| Reason | What to do |
| --- | --- |
| `wrong_password` Wrong password | Copy the password again from SMTP > Credentials, or reset it, and update your email client. |
| `invalid_username_format` Wrong username | Use the SMTP username (user-…), not your email address. |
| `ip_locked_after_failures` IP locked (5 wrong passwords) | Fix the password, then unblock the IP. |
| `credential_locked` Credential locked | Wrong passwords came from several IPs. Reset this credential's password. |
| `credential_temporarily_blocked` Temporarily blocked | Too many failed logins. Fix the password and wait a few minutes. |
| `ip_not_allowed` IP not allowed | Add this IP to the credential/key's Allowed IPs, or remove the restriction. |
| `account_blocked` Account suspended | Contact support. |
| `api_key_expired` API key expired | Create a new API key. |
| `api_key_missing_scope` Missing permission | Edit the API key and add the permission it needs. |
| `api_key_invalid` Invalid API key | Check the key or create a new one. |

## Errors

Each code links to its fix on the Errors page.

Before the command runs (HTTP status)

- [MISSING_AUTH_HEADER](https://docs.sendcorex.com/errors#missing_auth_header) 401
- [INVALID_API_KEY](https://docs.sendcorex.com/errors#invalid_api_key) 401
- [API_KEY_EXPIRED](https://docs.sendcorex.com/errors#api_key_expired) 401
- [ACCOUNT_BLOCKED](https://docs.sendcorex.com/errors#account_blocked) 403
- [IP_NOT_ALLOWED](https://docs.sendcorex.com/errors#ip_not_allowed) 403
- [MISSING_SCOPE](https://docs.sendcorex.com/errors#missing_scope) 403
- [RATE_LIMITED](https://docs.sendcorex.com/errors#rate_limited) 429
- [AUTH_UNAVAILABLE](https://docs.sendcorex.com/errors#auth_unavailable) 503

In the command result

- [MISSING_SCOPE](https://docs.sendcorex.com/errors#missing_scope)
- [INVALID_ARGS](https://docs.sendcorex.com/errors#invalid_args) `list_auth_errors`
- [NOT_BLOCKED](https://docs.sendcorex.com/errors#not_blocked) `unblock_ip`
- [NOT_SELF_SERVICE](https://docs.sendcorex.com/errors#not_self_service) `unblock_ip`
- [UNBLOCK_QUOTA](https://docs.sendcorex.com/errors#unblock_quota) `unblock_ip`
- [INTERNAL](https://docs.sendcorex.com/errors#internal)

## In AI apps (MCP)

The account MCP has the same commands as tools, with the same arguments and scopes:

`security_list_auth_errors`

= `list_auth_errors`

Lists failed SMTP, API and MCP logins of the last 30 days (newest first), with the reason and the exact reply; filter by source, reason or IP.

`security_list_blocked_ips`

= `list_blocked_ips`

Lists the account's blocked IPs with the reason and until when, plus the self-service unblocks left.

`security_unblock_ip`

= `unblock_ip`

Unblocks one of the account's IPs blocked for wrong passwords, daily limit or too many connections (3 per 30 days; abuse blocks need support).

[Account tools](https://docs.sendcorex.com/api-reference/mcp/account-tools)
