tasks

Answer a request the task is waiting on [write]

Changed on

Sends the caller's answer to the session that asked, as its next turn, in the same form a click in the app produces. Pass option_id for one of the request's options, or text where the request accepts free text. A spend request is applied before anything is sent: confirming remembers the price and, when the task itself was waiting to start, holds the fee and starts it with what it was given (402 insufficient_credits when the caller's credit does not cover the fee; the request stays open). Declining such a start closes the request and the task never runs. A spend request that asks to raise a member's monthly limit in a workspace is answered by an owner or admin of that workspace with option_id raise or decline (403 request_not_yours for anyone else, the member included): raising sets the limit the request offered and sends on what the member's waiting tasks were given. An optional note is sent to the agent after the answer, in the same turn, and is not part of the answer: a surface other than the app uses it to say where the answer came from and how to reply there. 404 when the task has no open request with that id, 403 request_not_yours when it is addressed to someone else, 400 when the answer is not one the request accepts, 409 session_busy while the turn that asked is still running (retry once the session is idle).

post/tasks/{id}/requests/{request_id}/answer

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/tasks/{id}/requests/{request_id}/answer
  • Auth
    HTTP bearer

Path parameters

idstring required

The task id: the id of its root session (sess_…)

request_idstring required

The request's id from the task's requests

Request body

OR

Response

OK

session_idstring required

The session that asked

message_idstring nullable required

The answer's message; read the session's events from it to follow the turn. Null when a spend request was declined, or confirmed for a task that was given nothing to start with.

Changes