Python SDK
Create typed Actions, wait for decisions, report outcomes, and supervise Watches from Python services and workers.
The official Python package is named actionbox-sdk; the import is actionbox. It requires Python 3.11 or newer and must only be used in trusted server, worker, or CI environments.
Install
pip install actionbox-sdkimport os
from actionbox import Actionbox
with Actionbox(os.environ["ACTIONBOX_API_KEY"]) as client:
decision = client.ask(
title="Deploy to production?",
options=["Approve", "Reject"],
callback_url="https://ci.example.com/actionbox",
)
print(decision)Customer integrations use ActionBox's hosted API at https://api.actionbox.cloud.
Do not expose Source API keys or Watch capability URLs in browser code.
Typed interactions
Use create with typed interactions when a response is more than a single choice. Supported types include boolean, single choice, multiple choice, text, integer, number, rating, and form.
from actionbox import BooleanInteraction
action = client.create(
title="Deploy configuration",
interaction=BooleanInteraction(
type="boolean",
label="Deploy now?",
true_label="Deploy",
false_label="Hold",
),
)After executing an approved operation, report its real outcome from the resolved Action snapshot:
resolved.report_outcome("success", duration_ms=48_312, rollback=False)See Actions, interaction types, and decisions and outcomes for the underlying contract.