Skip to content
nsin docs

Open a support ticket

POST
/tickets
curl --request POST \
--url https://api.nsin.ir/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "subject": "example", "message": "example" }'

Send JSON for a text-only ticket, 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.

object
subject
required
string
message
required
string
Example generated
{
"subject": "example",
"message": "example"
}

The created ticket and its first message.

Media type application/json
object
ticket
object
id
integer
user_id
integer
subject
string
status
string
Allowed values: open closed
closed_at
string format: date-time
closed_by_user_id
integer
closed_reason

Why the ticket is closed: staff when a person closed it, auto when it closed itself after ticket_auto_close_days without a new message. Absent while open. Posting a message to an auto closed ticket reopens it; a staff close is final.

string
user_last_read_message_id

The newest message you have read; replies after it are unread.

integer
staff_last_read_message_id

The newest message support has read.

integer
messages

The thread. Populated when fetching a single ticket.

Array<object>
object
id
integer
ticket_id
integer
author_user_id
integer
author

The message author.

object
key
additional properties
any
body
string
is_staff

True when written by support staff.

boolean
attachments
Array<object>
object
id
integer
message_id
integer
original_name
string
content_type
string
size_bytes
integer
url

Where to download the attachment.

string
created_at
string format: date-time
edited_at

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.

string format: date-time
edited_by_user_id

Who made the last edit. Absent on a message that has never been edited.

integer
edit_count

How many times the message has been edited. 0 for an untouched message.

integer
created_at
string format: date-time
updated_at
string format: date-time
first_message
object
id
integer
ticket_id
integer
author_user_id
integer
author

The message author.

object
key
additional properties
any
body
string
is_staff

True when written by support staff.

boolean
attachments
Array<object>
object
id
integer
message_id
integer
original_name
string
content_type
string
size_bytes
integer
url

Where to download the attachment.

string
created_at
string format: date-time
edited_at

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.

string format: date-time
edited_by_user_id

Who made the last edit. Absent on a message that has never been edited.

integer
edit_count

How many times the message has been edited. 0 for an untouched message.

integer
Example
{
"ticket": {
"status": "open"
}
}

Invalid body, a missing/oversized subject or message, or a rejected attachment — wrong type, over its size cap, more than eight files, or a file whose contents do not match its extension.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example badType
{
"error": "only JPEG, PNG, GIF, WebP images or .txt/.log/.json files are allowed (images up to 3 MB, text up to 1 MB)"
}

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

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

The key is read-only and this endpoint is a write. Read-only keys may only issue GET, HEAD and OPTIONS.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example readOnly
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}