Skip to main content

aztea-sdk — AgentWeb Python client

A small, dependency-free Python client for the AgentWeb API. Stdlib only (urllib, hmac) — nothing to install transitively. Use it on your backend; the API key is a server secret and must never reach a browser.

pip install aztea-sdk   # or: uv add aztea-sdk

Use it

from agentweb_sdk import AgentWeb

aw = AgentWeb(api_key="sk_live_...")  # or base_url=... for a private deployment

# Render only integrations that work in this customer surface.
integrations = aw.integrations.list(host_context="web")

# 1. Mint a single-use sign-in link and send it to your user.
link = aw.connections.create(
    end_user_id="user_42",                     # your own id for the person
    integration_id="amazon",
    return_url="https://app.example.com/connected",
)
print(link["connect_url"])

# 2. After the connection.created webhook fires, act as that user.
result = aw.execute(
    end_user_id="user_42",
    integration_id="amazon",
    operation="orders.list",
    arguments={"limit": 5},
    idempotency_key="orders-list-user42-0001",  # reuse on retry for writes
)
print(result["data"])

# List / revoke
aw.connections.list("user_42")
aw.connections.revoke("user_42", "amazon")

Calendar, Contacts, Messages, Notes, and Reminders are returned as device capabilities. They do not have hosted connect URLs. Callers should check compatible_with_host and connect_url_supported before rendering a connect control.

Every method returns the wire payload verbatim (snake_case, exactly what curl shows). Failures raise AgentWebError carrying the service's own code and kind — match on code, never on the message:

from agentweb_sdk import AgentWebError

try:
    aw.execute(end_user_id="user_42", integration_id="amazon",
               operation="orders.list", arguments={})
except AgentWebError as err:
    if err.code == "connection_needs_reauth":
        ...  # send the user a fresh connect link
    print(err.code, err.kind, err.status, err.retryable)

Verify webhooks

Pass the raw request body bytes (the signature is over the exact bytes sent), the X-AgentWeb-Signature header, and your webhook secret. Constant-time.

from agentweb_sdk import verify_webhook

# FastAPI
@app.post("/webhooks/agentweb")
async def hook(request: Request):
    raw = await request.body()
    sig = request.headers.get("X-AgentWeb-Signature", "")
    if not verify_webhook(raw, sig, WEBHOOK_SECRET):
        raise HTTPException(401)
    event = json.loads(raw)          # {"type": "connection.created", ...}

A fully generated client

This SDK is a hand-written, ergonomic surface over the common calls. If you want a client covering every endpoint, generate one from the live OpenAPI spec:

python sdk/python/scripts/dump_openapi.py > openapi.json
openapi-python-client generate --path openapi.json

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aztea_sdk-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aztea_sdk-0.2.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file aztea_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: aztea_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aztea_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4ca63e568d42992571d24083b6b417b5cdb566fd06560a4be1da5c6b6a471fd5
MD5 c3ccb3b848af29f0540471d02711ba51
BLAKE2b-256 e6753583c4bfdb632742b7e9ef7fe1bfd71523b245f49e3528c08efde313aaaa

See more details on using hashes here.

File details

Details for the file aztea_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aztea_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aztea_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eca98ea3416b9adf921fe1685d33de6fd18069f7f1eb0b97438bde9558d5b5b2
MD5 6b3fb7d45c375ca2ede1cbe4737c1ab3
BLAKE2b-256 ba2bd8b5e89e18fcc3abf661f9d73849549fb9d706f2e8d33fbff63e6153beeb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page