Ask the assistant to reply

.md

The website's /ai command, so the assistant writes one reply to the trader following your instruction.

Scopesadmin:write
Permissionview_ticketsmanage_tickets
POST/v1/admin/tickets/{ticket}/ai

The /ai command of the website's reply box: the assistant writes the next reply to the trader, following your instruction. The instruction itself stays behind as an internal note, so the team can see what was asked for, while the trader only ever sees the answer.

That note is what this answers with. The reply follows a few seconds later: it is written on the ticket's channel as text_delta, and lands in the conversation as a message from ai once it is done. See listen on a websocket.

The ticket stays with whoever holds it. The assistant does not take the conversation over, and the status moves to awaiting_trader like any other reply. It works on a ticket where the assistant is blocked: the block is about the trader calling it in, not about the team using it.

When the assistant cannot answer, because the firm's AI allowance is used up or the AI is down, a note with the event ai_command_failed follows instead, and nothing reaches the trader.

Every call is a reply written by the AI

It counts against the firm's AI allowance like any answer of the assistant. Retrying with the same Idempotency-Key asks once.

Needs a firm. Our own staff name one with the Propper-Workspace header.

Request

FieldDescription
instructionWhat the assistant should write, up to 2000 characters. Required
curl -X POST "https://api.proppertrading.com/v1/admin/tickets/tkt_rqfzx8upvc24x5sg/ai" \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Propper-Workspace: acme" \
  -H "Idempotency-Key: 9c1e3a5b-7d9f-4b2d-8e4a-6c8e0a2b4d6f" \
  -H "Content-Type: application/json" \
  -d '{"instruction": "Ask politely which device they trade from, in one sentence."}'

Response

201, with the note:

{
    "data": {
        "object": "ticket_message",
        "id": "tmsg_uhvtxfdk5kx28qmh",
        "ticket_id": "tkt_rqfzx8upvc24x5sg",
        "from": "admin",
        "author": "Ios Tester",
        "body": "/ai Ask politely which device they trade from, in one sentence.",
        "image_url": null,
        "image_name": null,
        "internal": true,
        "streaming": false,
        "via_email": false,
        "event": "ai_command",
        "read_at": null,
        "created_at": "2026-10-15T22:20:47+00:00"
    },
    "meta": {
        "request_id": "req_01m50sxk3v8q2r7hm4tn6wd9fa"
    }
}

Errors

StatusCodeMeaning
400workspace_requiredAsked by our own staff without naming a firm
400missing_idempotency_keyA POST without an Idempotency-Key header
401invalid_tokenNot a token, or the secret does not match
401revoked_tokenSigned out here or from another device
401expired_tokenNinety days without use, or a set expiry passed
403admin_access_requiredThis account no longer helps run the environment
403insufficient_scopeThis device does not hold admin:write
403workspace_not_permittedThe Propper-Workspace header names an environment this account cannot act in
403forbiddenWithout view_tickets and manage_tickets
404resource_not_foundNo ticket with that id in this firm
409ticket_endedThe ticket was resolved or closed
409assistant_unavailableThe firm switched the assistant off for its team. The ticket's can.ai says so in advance
422validation_failedNo instruction, or one longer than 2000 characters