NevTan Mail Help

Integrations

Mail API reference

Send feedback

The Mail API lets your own code read, search, send and reply to mail, and lets an admin manage the mailboxes on a domain. It is a plain JSON API over HTTPS — no SDK is required, and anything that can make an HTTP request can use it.

Base URL and authentication

  • Base URL — https://nevtanemailapi.nevtan.com:5008/api/v1
  • Authentication — an API key on every request, as Authorization: Bearer nvt_live_… or X-API-Key: nvt_live_…
  • Request bodies — JSON, with Content-Type: application/json
  • Responses — JSON. Field names use lower case with underscores, and timestamps are ISO 8601.

Keys belong on the server

Anyone who can read your key can read and send your mail. Call the API from a server you control, never from a browser, a mobile app or anywhere else the key would ship to the people using it.

Your first request

Start with /me. It confirms the key works and tells you which account and role it carries:

curl https://nevtanemailapi.nevtan.com:5008/api/v1/me \
  -H "Authorization: Bearer nvt_live_xxxxxxxx…"
{
  "id": 1042,
  "email": "priya@yourcompany.com",
  "name": "Priya Singh",
  "role": "admin"
}

The role field tells you whether the key may use the admin-only endpoints below.

Endpoints

Every path below is relative to the base URL.

EndpointWhat it doesNotes
GET /meThe account the key belongs to.Use it to check a key.
GET /emailsNewest messages in a folder.Accepts folder (inbox or sent, default inbox) and limit.
GET /emails/searchMessages matching a query.Accepts q and limit.
GET /emails/{id}One message in full, including its body.
POST /emails/sendSend a message.Body: to, cc, bcc, subject, body, is_html.
POST /emails/{id}/replyReply to a message, keeping it in its thread.Body: body, is_html, reply_all.
POST /draftsSave a message as a draft without sending it.Same body as send.
GET /mailboxesMailboxes in the workspace.Admin key only.
POST /mailboxesCreate a mailbox.Admin key only. Body: username, domain, name, password.
GET /hooksWebhook subscriptions on this account.See Webhooks.
POST /hooksSubscribe a URL to an event.Body: event, target_url.
DELETE /hooks/{id}Remove a subscription.

Sending a message takes a single address or a list, whichever suits your code:

curl -X POST https://nevtanemailapi.nevtan.com:5008/api/v1/emails/send \
  -H "Authorization: Bearer nvt_live_xxxxxxxx…" \
  -H "Content-Type: application/json" \
  -d '{
        "to": ["customer@example.com"],
        "subject": "Your order has shipped",
        "body": "<p>It is on its way.</p>",
        "is_html": true
      }'

The email object

Returned by the message endpoints, and delivered by the email.received and email.sent webhooks:

FieldTypeWhat it holds
idnumberThe message's identifier, used in the single-message and reply endpoints.
eventstringWhich event produced this object.
mailboxstringThe mailbox the message belongs to.
message_idstringThe internet message ID, for matching against other mail systems.
thread_idstringGroups a message with its replies.
fromstringSender address.
from_namestringSender display name, where one was supplied.
toarrayRecipient addresses.
ccarrayCopied addresses.
subjectstringSubject line.
snippetstringThe first 200 characters of the plain-text body, for list views.
body_textstringPlain-text body.
body_htmlstringHTML body, or null when the message was plain text.
received_atstringWhen it arrived, ISO 8601.
sent_atstringWhen it was sent, ISO 8601.
has_attachmentsbooleanWhether anything is attached.
attachment_countnumberHow many attachments.
is_readbooleanWhether the message has been opened.
directionstringWhether the message came in or went out.

Long bodies are shortened

A body over 100,000 characters is cut at that point. If you are processing newsletters or long threads, treat the body as possibly truncated rather than assuming it is complete.

The mailbox object

Returned by the mailbox endpoints, and delivered by the mailbox.created webhook:

FieldTypeWhat it holds
idnumberThe mailbox's identifier.
eventstringWhich event produced this object.
emailstringThe full address.
namestringThe person's display name.
domainstringThe domain the mailbox sits on.
activebooleanWhether the mailbox is in use.
created_atstringWhen it was created, ISO 8601.

Limits

LimitValue
Requests120 per minute, per key.
Messages per response10 by default, 50 at most. Ask for more with limit; anything higher is treated as 50.
Body length100,000 characters, after which the body is cut.
Snippet length200 characters.
Webhook subscriptions50 per account.

Read mail in batches, not in bulk

The API returns the newest messages rather than a complete archive, so it suits keeping an application up to date rather than exporting a mailbox. To move mail wholesale, connect an email app over IMAP instead — see Connect an email app.

Errors

An error returns the matching HTTP status and a JSON body with a single error field describing what went wrong:

{ "error": "Not found" }
StatusWhat it meansWhat to do
401The key is missing, wrong, or has been revoked.Check the header spelling, then confirm the key is still listed on the Integrations screen.
403The key is valid but not allowed to do this.Mailbox endpoints need a key created by an admin.
404No such message, mailbox or subscription — or it belongs to another account.Check the identifier came from this same account.
409The request conflicts with something that already exists.Creating a mailbox that is already taken, for instance.
429More than 120 requests in a minute.Slow down and retry after the minute rolls over.
400The request itself was not usable.The error field names the problem — usually a missing or malformed value.