Download one attachment
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 amail.storedwebhook). - indexintegerrequiredpath
The attachment's
indexfrom the message'sattachmentslist.
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.
{
"error": "invalid API key"
}403The key has no email:read.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No such message or attachment.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"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.
{
"error": "read-only API key"
}Example request
curl -X GET "https://api.nsin.ir/domains/example.com/email-routing/inbox/0/attachments/0" \
-H "Authorization: Bearer $NSIN_API_KEY"