Trigger and control Kapso Agent runs.
Runs are asynchronous: poll get/2 (or the returned status_url) or
subscribe to the kapso_agent.run.* project webhooks. When a run is
waiting_for_approval, approve or reject the pending tool call.
Summary
Functions
Approves a pending tool call.
Cancels a run.
Creates a run.
Gets a run. Only runs created with the same API key are visible.
Pauses a run.
Rejects a pending tool call.
Resumes a paused run.
Types
@type result() :: {:ok, map()} | {:error, KapsoEx.Error.t()}
Functions
@spec approve(KapsoEx.Client.t(), String.t(), String.t()) :: result()
Approves a pending tool call.
@spec cancel(KapsoEx.Client.t(), String.t()) :: result()
Cancels a run.
@spec create(KapsoEx.Client.t(), map() | keyword()) :: result()
Creates a run.
Attributes: mode and input (%{prompt: ...} or %{finding_id: ...})
are required; pass conversation_id to continue a session (same API key
and mode), and metadata for your own references.
Built-in modes that accept API runs: "auto", "api", "workflows",
"findings", "findings-investigator", "meta-onboarding",
"whatsapp-templates" and "whatsapp-flow", plus custom modes with the
api surface. Other modes return 422.
Runs.create(client, %{mode: "api", input: %{prompt: "How many conversations failed today?"}})
@spec get(KapsoEx.Client.t(), String.t()) :: result()
Gets a run. Only runs created with the same API key are visible.
@spec pause(KapsoEx.Client.t(), String.t()) :: result()
Pauses a run.
@spec reject(KapsoEx.Client.t(), String.t(), String.t()) :: result()
Rejects a pending tool call.
@spec resume(KapsoEx.Client.t(), String.t()) :: result()
Resumes a paused run.