API

Agent Runs

Agent APIs are scoped to a workspace and cover the interaction lifecycle: create a session, submit a user message, monitor the queued run, and handle approvals or previews when they appear.

Session Flow

  • POST /v1/workspaces/{workspace_id}/agent/sessions creates a session.
  • GET /v1/workspaces/{workspace_id}/agent/sessions lists sessions.
  • POST /v1/workspaces/{workspace_id}/agent/sessions/{session_id}/messages submits a message and queues a run.
session, err := client.CreateSession(ctx, workspaceID, tactasai.CreateSessionRequest{
    Title: "Production triage",
})

response, err := client.SubmitMessage(ctx, workspaceID, session.ID, tactasai.SubmitMessageRequest{
    ContentText: "Prepare the next customer follow-up.",
})

Run Events

Runs move through statuses such as queued, running, waiting_approval, completed, failed, and canceled. Use stored run events for durable polling.

events, errs := client.WatchRunEvents(ctx, workspaceID, response.Run.ID, nil)
for event := range events {
    fmt.Println(event.Sequence, event.Type)
}

Approvals

Approval decisions use approved or denied status with an optional reason. The API endpoint is POST /v1/workspaces/{workspace_id}/agent/approvals/{approval_id}/decision.

Previews And Tools

Runs can expose previews with private, unlisted, or public visibility. Tool profiles define allowed tools, denied tools, MCP servers, approval rules, and sandbox policy for agent execution.