Menu
Accedi Crea account
REST API

APIs for programmatic sending.

REST /v1/messages endpoint with Bearer auth, idempotency keys and transparent rate limiting.

Authentication

Every request requires an Authorization: Bearer tg_live_xxxxx header. Keys are generated from the panel (the API keys section), they're permanent until you revoke them and can be scoped (e.g. send-only or read-only).

Send a message

curl -X POST https://api.targetsmtp.it/v1/messages \
  -H "Authorization: Bearer $TARGET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "from":    "noreply@yoursite.com",
    "to":      ["user@example.com"],
    "subject": "Order #1024 confirmed",
    "html":    "<p>Thanks!</p>",
    "tags":    ["order-confirmation"]
  }'

Idempotency

Pass an Idempotency-Key header (UUID v4 recommended): if you retry the same request after a network timeout, we guarantee the message won't be sent twice. The key is valid for 24 hours.

Rate limits

Responses include the headers X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. When you hit the limit you get an HTTP 429 with Retry-After. The hourly limit depends on your plan (see pricing).

Errors

All errors return JSON with error.code, error.message, and error.field where useful. HTTP status codes are semantic: 400 validation, 401 auth, 402 quota exhausted, 422 unprocessable entity, 429 rate limit, 5xx server.

Features