Skip to main content
    Ivy Biosciences Docs/Call the platform/API/Reference/Reference/Execution/POST /harness/sessions/{sessionId}/execute

    POST /harness/sessions/{sessionId}/execute

    Execute a turn

    Auth: required. Send an ivy_ API key (Authorization: Bearer ivy_… or X-Ivy-Api-Key), a Clerk session JWT (Authorization: Bearer …) or the Clerk __session cookie (browser sessions). See Authentication.

    Submit a user message and receive the agent's response.

    Streaming mode (stream: true, default): response is a Server-Sent Events stream. Each line is data: <JSON> where the JSON is a HarnessStreamEvent. The stream terminates with a sync.completed event.

    Batch mode (stream: false): response is a JSON object with events (array of all HarnessStreamEvents) and the final state.

    Request

    Path parameters

    sessionIdstring (uuid)

    Session UUID (UUIDv7 — time-ordered)

    Request body

    contentstring

    User message text

    clientIdstring

    Client identifier for version vector tracking

    streamboolean

    Stream response via SSE (true, default) or collect into a JSON batch (false)

    Responses

    200 OK

    Turn executed — SSE stream or JSON batch

    Response shape:

    successboolean
    eventsobject[]
    stateobject

    Full session state snapshot persisted in Supabase

    400 Bad Request

    Invalid request

    Response shape: object

    401 Unauthorized

    Authentication required

    Response shape: object

    404 Not Found

    Resource not found

    Response shape: object

    curl -X POST 'https://ivybiosciences.com/api/harness/sessions/{sessionId}/execute' \
      -H "Authorization: Bearer $IVY_API_KEY" \
      -H 'Content-Type: application/json' \
      -d '{
      "content": ""
    }'

    Was this page helpful?

    Loading...