Reply to a ticket
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
Send JSON for a text-only reply, or multipart/form-data to attach
files. See TicketAttachmentUpload for what may be attached.
With multipart/form-data, message may be empty as long as at least
one file is attached; with JSON it is required. Replies are only
accepted while the ticket is open.
Path parameters
- idintegerrequiredpath
Request body
Content type: application/json · required
- messagestringrequired
Content type: multipart/form-data · required
- messagestring
- filesarray of string (binary)
Up to 8 files per message.
Responses
200The created message.
Content type: application/json
- idinteger
- ticket_idinteger
- author_user_idinteger
- authorobject
The message author.
- bodystring
- is_staffboolean
True when written by support staff.
- attachmentsarray of TicketAttachment
Item fields
- idinteger
- message_idinteger
- original_namestring
- content_typestring
- size_bytesinteger
- urlstring
Where to download the attachment.
- created_atstring (date-time)
- edited_atstring (date-time)
When the message was last edited. Absent on a message that has never been edited — render the "edited" marker off this field, not off
updated_at. - edited_by_user_idinteger
Who made the last edit. Absent on a message that has never been edited.
- edit_countinteger
How many times the message has been edited.
0for an untouched message.
{
"id": 0,
"ticket_id": 0,
"author_user_id": 0,
"author": {},
"body": "string",
"is_staff": true,
"attachments": [
{
"id": 0,
"message_id": 0,
"original_name": "string",
"content_type": "string",
"size_bytes": 0,
"url": "string"
}
],
"created_at": "2026-01-01T00:00:00Z",
"edited_at": "2026-01-01T00:00:00Z",
"edited_by_user_id": 0,
"edit_count": 0
}400Invalid id, invalid body, an empty/oversized message, a closed ticket, or a rejected attachment — wrong type, over its size cap, more than eight files, or contents that do not match the extension.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "ticket is closed"
}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 is read-only and this endpoint is a write. Read-only keys may
only issue GET, HEAD and OPTIONS.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No such ticket on this account.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}429The key exceeded its request budget (300 requests per minute by default).
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "rate limit exceeded"
}Example request
curl -X POST "https://api.nsin.ir/tickets/0/messages" \
-H "Authorization: Bearer $NSIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "string"
}'