The Document resource allows you to manage files and documents in ITSM-NG. You can upload files, associate them with other items (tickets, assets, etc.), and download them.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/itsmng/itsm-ng/llms.txt
Use this file to discover all available pages before exploring further.
Document Object
A document object contains these key fields:Unique document identifier
Document name/title
Actual filename on disk
Relative path to the file
Document category ID
MIME type of the file (e.g.,
application/pdf, image/png)Upload date
Last modification date
User who uploaded the document
SHA1 hash of the file for integrity verification
Whether the file extension is blacklisted
Optional tag for document organization
Get a Document
Retrieve document metadata (not the file itself).cURL
Response Example
Upload a Document
Upload a file to ITSM-NG using multipart/form-data.cURL
File uploads require the
multipart/form-data content type. The metadata must be sent in the uploadManifest parameter as a JSON string.Upload Parameters
JSON string containing document metadata
The actual file to upload (use
@filename syntax in curl)Response
Upload Multiple Files
You can upload multiple files in a single request:cURL
Download a Document
Download the actual file content of a document.cURL
To download a file, you must include the
Accept: application/octet-stream header, or add the alt=media query parameter.Alternative Download Method
You can also use thealt=media query parameter:
cURL
Link Document to Items
Associate a document with other items (tickets, computers, users, etc.).cURL
Link Parameters
Document ID to link
ID of the item to link to
Type of item (e.g.,
Ticket, Computer, User)Get Documents Linked to an Item
Retrieve all documents associated with an item.cURL
cURL
Update Document Metadata
Update document information (not the file itself).cURL
Delete a Document
Delete a document and its associated file.cURL
If
true, permanently delete the document and file. If false, move to trash.Common Use Cases
Upload document and attach to ticket
Upload document and attach to ticket
Download all documents from a ticket
Download all documents from a ticket
Search documents by category
Search documents by category
documentcategories_id=5.File Type Restrictions
ITSM-NG has security restrictions on file uploads:- Executable files (
.exe,.bat,.sh) are typically blacklisted - PHP files and scripts are blocked for security
- File types can be configured in Setup > Dropdowns > Document types
- Maximum file size is determined by PHP settings (
upload_max_filesize,post_max_size)
Check your document categories and allowed file extensions in the ITSM-NG interface under Setup > Dropdowns > Document types.
Best Practices
Use Categories
Organize documents with categories for easier management and search.
Meaningful Names
Use descriptive names for documents, not just filenames.
Link to Context
Always link documents to relevant items (tickets, assets) for context.
Regular Cleanup
Periodically review and remove obsolete documents to save storage.