nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Email Routing

Download one attachment

gethttps://api.nsin.ir/domains/{domain}/email-routing/inbox/{id}/attachments/{index}

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

One attachment as an application/octet-stream download. Treat it as untrusted: dangerous: true in the list marks executable types. Needs email:read and domain.view; same open limit and record as opening the message.

Path parameters

  • domainstringrequiredpath

    The domain name (for example example.com) — not a numeric id.

  • idintegerrequiredpath

    A stored message's id (from the inbox list or a mail.stored webhook).

  • indexintegerrequiredpath

    The attachment's index from the message's attachments list.

Responses

200The attachment.

Content type: application/octet-stream

401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
403The key has no email:read.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
404No such message or attachment.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
429Too many opens for this domain right now.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}

Example request

bash
curl -X GET "https://api.nsin.ir/domains/example.com/email-routing/inbox/0/attachments/0" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc