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
}'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