Ticket comments and ticket documents are separate sub-resources in the API. Comments use JSON, while file uploads use multipart form data. This guide covers the common read and write operations for both.
The main required field is comment_text. The schema also supports is_internal, is_resolution, and time_spent when you need them.
curl -X POST "https://algapsa.com/api/v1/tickets/$TICKET_ID/comments" \
-H "Content-Type: application/json" \
-H "X-API-Key: $ALGA_API_KEY" \
-d '{
"comment_text": "We reproduced the issue and are collecting logs now.",
"is_internal": false
}'By default, posting a comment notifies the ticket contacts and assigned technicians. To skip those notifications for a single operation, add either or both silent-update flags to the request body:
suppressContactNotifications — suppresses customer-facing email and portal notifications.suppressInternalNotifications — additionally suppresses agent, watcher, in-app, and push notifications. Only valid when suppressContactNotifications is also true.curl -X POST "https://algapsa.com/api/v1/tickets/$TICKET_ID/comments" \
-H "Content-Type: application/json" \
-H "X-API-Key: $ALGA_API_KEY" \
-d '{
"comment_text": "Internal escalation note — do not notify customer.",
"is_internal": true,
"suppressContactNotifications": true,
"suppressInternalNotifications": true
}'Silent updates still produce audit records, activity entries, workflow triggers, and webhook deliveries. The same flags apply to all other ticket mutation endpoints too — see the Tickets API reference for the full list.
curl -X GET "https://algapsa.com/api/v1/tickets/$TICKET_ID/comments" \
-H "X-API-Key: $ALGA_API_KEY"File uploads use multipart/form-data. The controller expects a file field named file.
curl -X POST "https://algapsa.com/api/v1/tickets/$TICKET_ID/documents" \
-H "X-API-Key: $ALGA_API_KEY" \
-F "file=@./incident-screenshot.png"const formData = new FormData();
formData.append('file', fileInput.files![0]);
const response = await fetch(
'https://algapsa.com/api/v1/tickets/' + ticketId + '/documents',
{
method: 'POST',
headers: {
'X-API-Key': process.env.ALGA_API_KEY!,
},
body: formData,
},
);
const result = await response.json();
if (!response.ok) {
throw new Error(result.error?.message ?? 'Upload failed');
}curl -X GET "https://algapsa.com/api/v1/tickets/$TICKET_ID/documents" \
-H "X-API-Key: $ALGA_API_KEY"
curl -X GET "https://algapsa.com/api/v1/tickets/$TICKET_ID/documents/$DOCUMENT_ID" \
-H "X-API-Key: $ALGA_API_KEY" \
-o downloaded-file.bin