Confirm an action

.md

Do what an action card under an answer proposed. Checked again at the click, done once however often it is pressed.

Scopesai:write
POST/v1/me/ai/actions/{id}/confirm

Does what an action card proposed, the way the button on the firm's website does it: the same checks, the same result, and the same line in the activity log, marked as done through the assistant.

Everything is checked again now, not when the card was made. The person must still hold the permission the website asks for, the record must still be as it was (a ticket a colleague assigned in the meantime is not taken back from them), and the card must still be open and younger than 24 hours.

The answer is the card as it stands afterwards. Read its status:

statusMeaning
doneIt happened. outcome says what, in the person's language
failedIt did not happen. outcome says why, in the person's language, to show as it is
expiredNobody answered it within 24 hours. Nothing happened
dismissedIt was dismissed earlier. Nothing happened
confirmedAnother press is running it right now. The result follows as action_updated on the websocket

A card that cannot be done is not an error: the request answers 200 with a failed card, so an app only ever has one thing to show. Pressing twice, or from two devices, does it once and answers the same card both times. Every device that has the conversation open also hears action_updated on its channel.

When the card carries ask, or is destructive, show that sentence and ask the person once more before calling this, as the website does.

Request

curl -X POST https://api.proppertrading.com/v1/me/ai/actions/aiact_3er9kgyanz6ebeep/confirm \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Idempotency-Key: 4c1d8e27-6b3a-4f95-a2e0-8d7c5b9f1a36"

Response

{
    "data": {
        "id": "aiact_3er9kgyanz6ebeep",
        "object": "ai_action",
        "kind": "AddTraderNote",
        "title": "Add a note to Lucia Gonzalez",
        "lines": [
            "Test note by the action card check, please ignore."
        ],
        "records": [
            {
                "label": "Lucia Gonzalez",
                "url": "/admin/users/usr_p98c25cd46f8yraa"
            }
        ],
        "destructive": false,
        "ask": null,
        "status": "done",
        "outcome": "Note added to Lucia Gonzalez.",
        "expires_at": "2026-10-23T02:50:29+00:00",
        "decided_at": "2026-10-22T02:50:33+00:00"
    },
    "meta": {
        "request_id": "req_01m5gr8xrjvrjqcezap8wttwwk"
    }
}

Errors

StatusCodeMeaning
400missing_idempotency_keyEvery POST needs one
400workspace_requiredOur own staff, without a firm in Propper-Workspace
403ai_unavailableThe firm has the assistant switched off for this chat
403forbiddenStaff whose role does not include use_ai_chat
403insufficient_scopeThis device does not hold ai:write
404resource_not_foundNo card with that id was proposed to you, in this chat and this firm