> This page is part of EVVA for Developers (https://developers.evvahub.com), the documentation of the EVVA Partner API. The API is in developer preview and the SDK packages are not yet published: do not suggest installing them. Index: https://developers.evvahub.com/llms.txt

# Python SDK

## Requirements

| Requirement          | Detail                                                                        |
| -------------------- | ----------------------------------------------------------------------------- |
| Python               | **3.11 or later** — supported 3.11, 3.12, 3.13 and 3.14; **3.14 recommended** |
| Runtime dependencies | `httpx >=0.27,<1` and `websockets >=13,<18`                                   |
| Optional             | the `jwt` extra adds `cryptography >=42` for `private_key_jwt`                |

## Install

> **Info**
>
> Coming at general availability. Until then, this page shows the requirements and how the SDK is used.

## Configure

**`client.py`**

```python title="client.py"
import os
from evva_partner import ClientSecretBasic, EvvaPartnerClient

client = EvvaPartnerClient(
    base_url="https://api.evvahub.com",
    auth=ClientSecretBasic(os.environ["EVVA_CLIENT_ID"], os.environ["EVVA_CLIENT_SECRET"]),
)
```

`ClientSecretPost` sends the secret in the form body instead; `PrivateKeyJwt` signs a fresh assertion for every token
request (RS256 or ES256), so no shared secret leaves your infrastructure:

**`private_key_jwt`**

```python title="private_key_jwt"
from evva_partner import PrivateKeyJwt

auth = PrivateKeyJwt(os.environ["EVVA_CLIENT_ID"], private_key, key_id="key-2026-12", algorithm="ES256")
```

`AsyncEvvaPartnerClient` is the asyncio twin. Both are context managers.

## First calls

**`first_calls.py`**

```python title="first_calls.py"
with EvvaPartnerClient(base_url="https://api.evvahub.com", auth=auth) as client:
    print(client.app.me())
    for account in client.accounts.list():
        creator_id = account["creatorId"]
        for conversation in client.conversations.iter(creator_id, limit=50):
            print(creator_id, conversation["id"], conversation.get("lastMessageAt"))
```

`client.<resource>.list(...)` returns one page; `.iter(...)` walks every page. `client.operations` reaches every
operation of the [API reference](/api-reference).

## Receive events and reply

**`bot.py`**

```python title="bot.py"
import asyncio, os
from evva_partner import AsyncEvvaPartnerClient, ClientSecretBasic, PartnerEventStream, SQLiteStore

async def main() -> None:
    store = SQLiteStore("evva-state.db")  # durable checkpoint + dedup
    async with AsyncEvvaPartnerClient(
        base_url="https://api.evvahub.com",
        auth=ClientSecretBasic(os.environ["EVVA_CLIENT_ID"], os.environ["EVVA_CLIENT_SECRET"]),
    ) as client:
        async def on_event(event):
            if event.type == "message.received":
                await client.messages.send_text(event.creator_id, event.conversation_id, "Got it!")

        await PartnerEventStream(client, consumer_id="replier", handler=on_event,
                                 checkpoints=store, dedup=store).run()

asyncio.run(main())
```

| You want                | Use                                                         |
| ----------------------- | ----------------------------------------------------------- |
| Low latency and no loss | `PartnerEventStream` — realtime plus the feed, deduplicated |
| Batch, cron or replay   | `FeedConsumer` / `AsyncFeedConsumer`                        |
| Raw realtime            | `RealtimeClient`                                            |

The checkpoint is saved only after your handler returns, so a crash re-delivers rather than loses. Implement
`CheckpointStore` and `DedupStore` on your own database to share state across instances; `SQLiteStore` is durable on
one host, the in-memory stores are for tests.

## Errors

Each API error has `.status`, `.code`, `.message`, `.details` and `.request_id`.

| Error                                       | When                                                                                                              |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `BadRequestError`                           | `400`                                                                                                             |
| `AuthError`                                 | `401`                                                                                                             |
| `PermissionDeniedError`                     | `403`                                                                                                             |
| `NotFoundError`                             | `404`                                                                                                             |
| `ConflictError`, `IdempotencyConflictError` | `409`                                                                                                             |
| `CursorExpiredError`                        | `410 CURSOR_EXPIRED`                                                                                              |
| `RateLimitedError`                          | `429` — `.retry_after`                                                                                            |
| `ServerError`, `NetworkError`               | `5xx`, no response                                                                                                |
| `ApprovalRequiredError`                     | `202 APPROVAL_REQUIRED` — `.approval_id`. Re-send with `approval_id=` once approved; see [Approvals](/approvals). |

## Webhooks

**`webhooks.py`**

```python title="webhooks.py"
from evva_partner import WebhookHandler  # AsyncWebhookHandler for asyncio frameworks

webhooks = WebhookHandler([os.environ["EVVA_WEBHOOK_SECRET"]], on_event=enqueue, dedup=store)
result = webhooks.handle(raw_body_bytes, request.headers)
return result.status  # 204 handled/duplicate · 401 signature · 400 payload · 500 retry me
```

## Polling statuses that have no event

**`waiters.py`**

```python title="waiters.py"
client.waits.media_processing(creator_id, [asset_id])     # until ready / failed / unavailable
client.waits.scheduled_content(creator_id, content_id)    # until the post left its scheduled draft
```

## Next steps

#### [Quickstart](/quickstart)

Your first integration, end to end.

#### [Webhooks](/webhooks/overview)

Subscribe and verify.

#### [Event feed](/event-feed)

The durable record and consumer groups.

#### [API reference](/api-reference)

Every operation.