Sessions

Stop the agent without closing the session

Changed on

Halts the current run. The session survives, the project stays open, and the conversation so far is kept — so you can send a new prompt afterwards without starting over. Use deleteSession when you actually want to finish.

Stopping when nothing is running is not an error; stopped is false and the status is whatever it already was. That makes this safe to call defensively, for instance when abandoning a run you may or may not have started.

post/api/v2/projects/{projectId}/sessions/{sessionId}/stop

Request

  • Base URL
    https://davinci-app.com
  • Auth
    HTTP bearer

Response

The run was halted, or there was none to halt.

sessionIdstring uuid required
taskIdstring required
stoppedboolean required

False when there was no run to stop, which is not a failure — you asked for a state you already had.

status'no_session' | 'project_not_running' | 'idle' | 'starting' | 'running' | 'paused' | 'completed' | 'failed' | 'unknown' required
  • no_session — the machine has no record of this session; it lapsed or the project restarted. Create a new one.
  • project_not_running — the session is known but its project has unloaded.
  • idle — the session is live and no run has been started.
  • starting — a run is being set up.
  • running — a run is in progress.
  • paused — a run was stopped and can be continued with a new prompt.
  • completed — the run finished.
  • failed — the run ended in an error. agent.error says why, as does the transcript.
  • unknown — the machine could not be reached for this field. Retry; anything else in the same response is still valid.

paused, completed, and failed are terminal for a run.

Changes

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      endpoint added