Skip to content

Incoming webhooks

An incoming webhook is an address another system can post to: a contact form, a monitoring alert, a CRM. Each call raises a ticket, or adds a reply to an existing one. The sender needs no WordPress account.

An incoming address can only raise tickets and add replies. It can’t read, assign, close or delete anything, and its answer never echoes back what it was sent.

API & Webhooks → Webhooks, the Coming in section.

  1. Under The switches, tick Accept messages from outside, set Inbound calls an hour if 60 is wrong for you, and click Save switches.

  2. Under Coming in, click Add one. The form is headed A new inbound endpoint.

  3. Fill in What it is:

    Field What it does
    Name Shown in the list. Name it after the sending system. Required.
    Raise tickets into The department new tickets go to, unless the call names one. Whatever the site does by default leaves it to your usual rules.
    In use Yes, or No — keep it, but do not use it.
  4. Under What their fields mean, map the sender’s field names onto yours (see below). Three empty rows are offered; save and edit again for more.

  5. Click Save. The form reopens showing Its address.

  6. Copy the address into the other system. It looks like:

    https://example.com/wp-admin/admin-ajax.php?action=jsst_inbound&id=3&token=whsec_…

An inbound endpoint called Contact form being edited: Raise tickets into Support, In use Yes, Its address with the token, and What their fields mean mapping their_email to Customer’s e-mail, topic to Subject and details to Message.

The token in the address is the endpoint’s only protection, so treat the whole address as a password and give it only to the system that needs it. If it leaks, tick Give it a new token, and stop the old address working and save; the old address stops working at once.

Each row says which of the sender’s field names means which of yours. Leave a row on — ignore it — to skip it.

Means our Becomes
Subject The ticket’s subject.
Message The message, or the reply.
Customer’s e-mail Whose ticket it is. Required: calls without a valid address are refused.
Customer’s name The name. The e-mail address is used if there is none.
Priority id A priority, by its id.
Department id A department, by its id. Overrides Raise tickets into.
Help topic id A help topic, by its id.
An existing ticket’s reference — reply to it instead of raising one If a ticket has this ticket ID, the message is added to it as a reply instead of raising a new ticket.

Once there is at least one mapping, only mapped fields are read. Anything else the sender includes is ignored.

With no mapping at all, the endpoint reads fields that already use your names (subject, message, email, name, priorityid, departmentid, helptopicid, reference), and also accepts title for the subject, body or text for the message, and from or sender for the e-mail address. That is enough for a first test.

Send JSON, or an ordinary form post, to the address with POST:

Terminal window
curl -X POST -H "Content-Type: application/json" \
-d '{"title":"Disk almost full on web-2","body":"92% used on /var.","from":"alerts@example.com"}' \
"https://example.com/wp-admin/admin-ajax.php?action=jsst_inbound&id=3&token=whsec_…"

If there’s no subject, the first eight words of the message are used. The message keeps its paragraphs.

Status Body Means
200 {"success":true,"data":{"ticket_id":12,"action":"created"}} A ticket was raised.
200 {"success":true,"data":{"ticket_id":4,"action":"replied"}} A reply was added to an existing ticket.
403 {"success":false,"data":{"error":"forbidden"}} Wrong id or token, or the endpoint is not in use.
404 {"success":false,"data":{"error":"not_found"}} Accept messages from outside is off.
422 nothing_to_do Neither a subject nor a message.
422 no_email No valid customer e-mail address.
429 too_many Over Inbound calls an hour for this endpoint.
500 create_failed or reply_failed The help desk couldn’t save it.

The list under Coming in shows each endpoint’s address, where it raises tickets and whether it is on.