POST

Ticket.Reply

Append a staff message to ticket chat, same as dashboard tickets/insert_message (CHAT Send / Add chat). data_type public or normal (default) is customer-visible; only_member or internal is an internal note. Returns the new mapped chat row(s). List history with Ticket.Messages.

Permissions

  • User must be logged in with a valid bearer token.
  • The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Updates the requested Ticket record after validating permissions and input fields.

Push Service

Pushes event ticket.reply to users who should see this change.

Automation

No automation is run for this function.

Special Instructions

  • On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
  • Dashboard CHAT Send → data_type public/normal (customer-visible). Add chat → data_type=only_member (internal).
  • For green Send WhatsApp (Green API use_for_ticket) use Ticket.SendWhatsapp — do not pass data_type=whatsapp here.
  • message is required unless an attachment file is sent (image_upload / cop_paste_image / file).
  • After send, response data[] / messages[] are mapped UI rows (same shape as Ticket.Messages). Reload full history with Ticket.Messages or Ticket.Get data.chat.
  • Does not change Ticket.Get data.messages raw storage format for existing clients.

Required Parameters

NameTypeSampleExplanation
ticket_id
post
int900Ticket id. Aliases: id, data_id, t_id.

Optional Parameters

NameTypeSampleWhat it gives
message
post
stringWe are checking this now.Reply text. Aliases: messages. Required unless a file is attached.
data_type
post
stringpublicVisibility: public/normal (default, Send), only_member or internal (Add chat). Aliases: visibility, msg_type.
image_upload
file
fileOptional attachment. Aliases: image, file, files, cop_paste_image3, cop_paste_image, image_hidden (path string).

Authentication

Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Ticket.Reply",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "ticket_id": "900",
        "message": "We are checking this now.",
        "data_type": "public"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.Reply",
    "url_domain": "https:\/\/{domain}\/app\/Ticket.Reply"
}

Endpoint

POST /app/Ticket.Reply
POST https://{user}.bull36.com/app/Ticket.Reply
POST https://{domain}/app/Ticket.Reply

Sample Output

{
    "success": 1,
    "output": "1",
    "message": "Success",
    "ticket_id": 900,
    "msg_type": "public",
    "internal": 0,
    "count": 3,
    "data": [
        {
            "who": "agent",
            "name": "User",
            "role": "To customer",
            "time": "08.09.2026 14:10:00",
            "text": "We are checking this now.",
            "type": "normal",
            "file": "",
            "file_url": "",
            "user_id": 47,
            "image": ""
        }
    ],
    "socket_event": "ticket.reply"
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({ ticket_id: '900', message: 'We are checking this now.', data_type: 'public' });
const res = await fetch('/app/Ticket.Reply', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());

Error Example

{
    "success": 0,
    "message": "Missing required parameter: message"
}