Search the docs
Menu
Updated Edit on GitHub

Console: tickets

Copy as Markdown

These routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.

The helpdesk: tickets, their comments and attachments. Reading needs device.view, changing device.edit. These routes answer errors as {"error": "..."}.

GET /api/tickets

List tickets. Filter with -q, like -q status=open.

A viewer gets only the tickets assigned to it, whatever assigned_to says. An account whose device scope is limited gets the tickets of its devices and those of no device. Newest first, 500 at most; there is no paging. Each filter is one text, compared with the column as it is.

Needs device.view. neodesk tickets list calls it.

Parameter In Type What it is
status query string, one of open, in_progress, resolved, closed
priority query string, one of low, medium, high, critical
category query string, one of general, hardware, software, network, access, other
assigned_to query string The user name of who handles it
device_id query string
source query string, one of staff, device device lists the tickets the computers opened
search query string Text in the title or the description

200: Done (application/json)

Field Type Required What it is
tickets array of Ticket yes
total integer yes The number of tickets in the list
Error When
400 A filter came twice or not as text
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

POST /api/tickets

Open a ticket.

The ticket is due by its priority: 4 hours for critical, 8 for high, 24 for medium, 72 for low. A device outside the account's device scope answers 403.

Needs device.edit. neodesk tickets create calls it.

Request body, application/json:

Field Type Required What it is
title string yes The title; spaces around it are trimmed
description string or null What is wrong
priority string, one of low, medium, high, critical default "medium"
category string, one of general, hardware, software, network, access, other default "general"
device_id string or null The device it is about
assigned_to string or null The user name of who handles it

201: Created (application/json)

Field Type Required
success true yes
ticket object yes
ticket.id integer
ticket.title string
Error When
400 No title, or a priority, category or text field that is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or the device is outside its device scope (then {"error": "..."})
429 Too many requests: wait for the seconds in Retry-After

GET /api/tickets/attachments/{aid}

Download an attachment (use --output).

Answers the file as a download under its stored name, with its stored media type (application/octet-stream when that is none). Range and conditional requests work.

Needs device.view. neodesk tickets attachment calls it.

Parameter In Type Required What it is
aid path integer yes The attachment number (see tickets attachments)

200: The file (application/octet-stream)

String (binary).

Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such attachment, its file is missing, or the account may not read its ticket
429 Too many requests: wait for the seconds in Retry-After

GET /api/tickets/stats

Count tickets by status and priority.

Counts the tickets the account may read: a viewer's counts take the tickets assigned to it, a limited account's those of its devices and of no device.

Needs device.view. neodesk tickets stats calls it.

200: Done (application/json)

Field Type Required
total integer yes
open integer yes
in_progress integer yes
resolved integer yes
closed integer yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

GET /api/tickets/{id}

Show a ticket.

Internal comments are left out for an account without device.edit.

Needs device.view. neodesk tickets get calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

200: Done (application/json)

Ticket and object.

Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such ticket, or the account may not read it

PATCH /api/tickets/{id}

Change a ticket: status, priority, who handles it.

Writes each field the body has. A status of resolved or closed also stores that time. When the status of a ticket the computer opened changes, the computer's chat gets the frame ticket.updated and the ticket counts as unread for it.

Needs device.edit. neodesk tickets update calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

Request body, application/json:

Field Type What it is
title string Not empty
description string or null
status string, one of open, in_progress, resolved, closed
priority string, one of low, medium, high, critical
category string, one of general, hardware, software, network, access, other
assigned_to string or null The user name of who handles it
device_id string or null The device it is about, 64 characters at most; empty or null for none; at most 64 characters
sla_due_at string or null (date-time) When it is due, as an RFC 3339 time; null for never

200: Done (application/json)

Field Type Required
success true yes
Error When
400 A field is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account may not do this, or the device is outside its device scope (then {"error": "..."})
404 There is no such ticket, or the account may not read it

DELETE /api/tickets/{id}

Delete a ticket.

Deletes the ticket with its comments, its attachments and their files.

Needs device.edit. neodesk tickets delete calls it. It cannot be undone.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

200: Done (application/json)

Field Type Required
success true yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such ticket, or the account may not read it
429 Too many requests: wait for the seconds in Retry-After

GET /api/tickets/{id}/attachments

List a ticket's attachments.

A ticket that does not exist or the account may not read answers an empty list.

Needs device.view. neodesk tickets attachments calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

200: Done (application/json)

Field Type Required
attachments array of TicketAttachment yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
429 Too many requests: wait for the seconds in Retry-After

POST /api/tickets/{id}/attachments

Attach a file to a ticket.

The file comes as base64 in JSON, 25 MB at most. Characters of the name other than letters, digits, dots, dashes and underscores become underscores. A mimetype that is no media type is stored as application/octet-stream.

Needs device.edit. neodesk tickets attach calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

Request body, application/json:

Field Type Required What it is
filename string yes
data string yes The file in base64
mimetype string or null The media type, like image/png

201: Created (application/json)

Field Type Required What it is
success true yes
attachment object yes
attachment.id integer
attachment.filename string The name as stored
attachment.size_bytes integer
Error When
400 No filename or data, data that is no base64, or a mimetype that is not text
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such ticket, or the account may not read it
413 The file is larger than 25 MB
429 Too many requests: wait for the seconds in Retry-After

GET /api/tickets/{id}/comments

List a ticket's comments.

Internal comments are left out for an account without device.edit. A ticket that does not exist or the account may not read answers an empty list.

Needs device.view. neodesk tickets comments calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

200: Done (application/json)

Field Type Required
comments array of TicketComment yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token

POST /api/tickets/{id}/comments

Add a comment to a ticket.

A viewer's comment is never internal. A public comment on a ticket the computer opened reaches the computer's chat as the frame ticket.updated and counts as unread for it.

Needs device.edit. neodesk tickets comment calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

Request body, application/json:

Field Type Required What it is
body string yes The text; spaces around it are trimmed
is_internal boolean Only accounts with device.edit see it; default false

201: Created (application/json)

Field Type Required
success true yes
comment object yes
comment.id integer yes
Error When
400 No text
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such ticket, or the account may not read it
429 Too many requests: wait for the seconds in Retry-After

PATCH /api/tickets/{id}/comments/{cid}

Change the text of a comment you wrote.

Whether the comment is internal stays as it is, and the old text is not kept. A public comment on a ticket the computer opened makes the computer's chat get the frame ticket.updated. Logs ticket_comment_edited in the audit log (without the text) and sends ticket.changed with the new text to the integrations.

Needs device.edit. neodesk tickets comment-edit calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)
cid path integer yes The comment ID (see tickets comments)

Request body, application/json:

Field Type Required What it is
body string yes The new text; spaces around it are trimmed, and it may not be empty

200: Done (application/json)

Field Type Required
success true yes
Error When
400 No text (Comment body is required)
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, a write from a browser came without a good CSRF token, or the comment is not the account's own (Only the author can change a comment): a computer's comment or another staff member's, also for an admin
404 There is no such ticket or the account may not read it (Ticket not found), or the comment is not there or belongs to another ticket (Comment not found)
429 Too many requests: wait for the seconds in Retry-After
500 Internal server error

DELETE /api/tickets/{id}/comments/{cid}

Delete a comment you wrote.

Its text is not kept. A public comment on a ticket the computer opened makes the computer's chat get the frame ticket.updated. Logs ticket_comment_deleted in the audit log and sends ticket.changed to the integrations.

Needs device.edit. neodesk tickets comment-delete calls it. It cannot be undone.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)
cid path integer yes The comment ID (see tickets comments)

200: Done (application/json)

Field Type Required
success true yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, a write from a browser came without a good CSRF token, or the comment is not the account's own (Only the author can change a comment): a computer's comment or another staff member's, also for an admin
404 There is no such ticket or the account may not read it (Ticket not found), or the comment is not there or belongs to another ticket (Comment not found)
429 Too many requests: wait for the seconds in Retry-After
500 Internal server error

POST /api/tickets/{id}/reopen

Open a resolved or closed ticket again.

The status goes back to open, without the times it was resolved and closed. For a ticket the computer opened, the computer's chat gets the frame ticket.updated. Logs ticket_reopened in the audit log and sends ticket.changed to the integrations.

Needs device.edit. neodesk tickets reopen calls it.

Parameter In Type Required What it is
id path integer yes The ticket number (see tickets list)

200: Done (application/json)

Field Type Required
success true yes
Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such ticket, or the account may not read it
409 The ticket is open or in progress (Ticket is not resolved or closed)
500 Internal server error

Type to search pages, sections, commands and settings.