Threads

Create a thread with an initial message and optionally wait for the agent response.

post/threads

Request

  • Base URL: https://api.sazabi.com/v1
  • URL: https://api.sazabi.com/v1/threads
  • Auth: none declared

Request body

projectIdstring uuid

Project to create the thread in. Auto-filled from CLI and SDK context when omitted.

requestIdstring uuid

Stable creation id for retrying an issue discussion. Reuse with the same first message.

sourceIssueIdstring uuid

Issue in this project to start a shared discussion about. Records a linked thread in the issue activity.

messagestring required

Initial user message that starts the thread.

waitboolean

Whether the server should wait for the agent run before responding.

timeoutSecondsinteger

Maximum seconds to wait when wait is true before handing off to polling.

automationIdstring uuid

Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run.

kind'support'

Purpose the thread is started for. support opens a conversation with Sazabi support: the agent answers from the docs first and can file a support ticket.

Response

OK

completedboolean required

Whether the run has reached a terminal status.

threadIdstring uuid required

Thread ID associated with the run.

runIdstring uuid required

Run ID for subsequent polling. For a queued follow-up this is the ID its run will start under once the thread's earlier run ends; polling it reports queued until then and never the earlier run's result.

messageIdstring uuid

ID of the user message that triggered this run.

status'queued' | 'processing' | 'completed' | 'aborted' | 'error' required

Current run lifecycle status. queued: the message is waiting behind the thread's run in flight and has not started; it starts after that run ends, whatever that run's outcome, unless the queued message is cancelled with runs.cancel.

responsestring nullable required

Assistant response text when the run has completed.

failureClass'billing_account_missing' | 'subscription_missing' | 'subscription_blocked' | 'credit_balance_missing' | 'credit_balance_depleted' | 'billing_admission_unavailable' | 'ambient_denied' | 'permission' | 'policy' | 'provider' | 'provider_rejected' | 'cancelled' | 'timeout' | 'rate_limit' | 'grpc_message_too_large' | 'sandbox_concurrency' | 'sandbox_missing' | 'sandbox_failed' | 'tool_failed' | 'workflow_start_failed' | 'workflow_died' | 'unknown' nullable required

Machine-readable reason the run ended in error. Null unless the run failed. A class this client does not recognize means an unclassified failure, not an error.

failureRetryableboolean nullable required

Whether retrying the identical request is worth attempting. Null when there is no answer: the run did not fail, or its failure is unclassified.

Changes

    • warning

      added the new queued enum value to the response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property