Corsa Python SDK
Official Python SDK for Corsa, the agentic compliance OS for banks, financial institutions and fintechs.
Documentation: docs.corsa.finance
Auto-generated from the Corsa OpenAPI specification using openapi-python-client, with typed Pydantic v2 models and both sync/async httpx clients.
Installation
pip install corsa-sdk
Quick Start
Sync
from corsa_sdk import CorsaClient
from corsa_sdk.models.create_alert_dto import CreateAlertDto
client = CorsaClient(
base_url="https://api.corsa.finance",
token="your-api-token",
)
alert = client.alerts.create_alert(body=CreateAlertDto(
name="Suspicious activity",
description="Large transfer flagged",
))
client.close()
Async
from corsa_sdk import AsyncCorsaClient
from corsa_sdk.models.create_alert_dto import CreateAlertDto
async with AsyncCorsaClient(
base_url="https://api.corsa.finance",
token="your-api-token",
) as client:
alert = await client.alerts.create_alert(body=CreateAlertDto(
name="Suspicious activity",
description="Large transfer flagged",
))
Context Manager (sync)
with CorsaClient(base_url="https://api.corsa.finance", token="your-api-token") as client:
case = client.cases.get_case(case_id="abc-123")
API Namespaces
The client exposes each API tag as an attribute. Endpoint names match the generated module names.
| Namespace | Examples |
|---|---|
client.alerts |
create_alert, get_alert, update_alert, bulk_assign_alert |
client.cases |
create_case, get_case, update_case, bulk_update_case_status |
client.clients |
create_individual_client, create_corporate_client, get_individual_client |
client.transactions |
get_transaction_by_id, update_transaction, update_transaction_status |
client.blockchain_wallets |
create_blockchain_wallet, get_blockchain_wallet |
client.bank_accounts |
create_bank_account, get_bank_account |
client.rules |
create_rule, list_rules, activate_rule, disable_rule |
client.rule_templates |
list_rule_templates, get_rule_template, copy_rule_template |
client.deposits |
create_deposit, get_deposit |
client.withdrawals |
create_withdrawal, get_withdrawal |
client.trades |
create_trade, get_trade, add_transaction |
client.sessions |
create_session, get_session, get_client_sessions |
client.members |
create_individual_member, create_corporate_member |
client.attachments |
upload_attachments, get_attachments_by_entity |
client.checklists |
create_checklist_template, update_checklist_item |
client.evaluation |
evaluate, get_rule_evaluations |
client.platform |
get_encryption_configuration |
Advanced Usage
Direct module access
For full control over the response (status code, headers), use the generated modules directly:
from corsa_sdk import AuthenticatedClient
from corsa_sdk.api.alerts import create_alert
from corsa_sdk.models.create_alert_dto import CreateAlertDto
client = AuthenticatedClient(base_url="https://api.corsa.finance", token="your-api-token")
# Returns a Response object with status_code, headers, and parsed body
response = create_alert.sync_detailed(client=client, body=CreateAlertDto(...))
print(response.status_code, response.headers)
alert = response.parsed
Custom headers and timeout
client = CorsaClient(
base_url="https://api.corsa.finance",
token="your-api-token",
timeout=60.0,
headers={"X-Custom-Header": "value"},
)
Access the underlying httpx client
raw = client.raw_client.get_httpx_client()
Webhook Verification
Verify incoming webhook signatures using HMAC-SHA256:
from corsa_sdk import verify_webhook_signature, sign_webhook_payload
# Verify a webhook from Corsa
is_valid = verify_webhook_signature(
secret="your-webhook-secret",
event_payload=request.body,
signature=request.headers["X-Signature"],
)
# Sign a payload (for testing)
sig = sign_webhook_payload("your-webhook-secret", '{"event":"alert.created"}')
Error Handling
from corsa_sdk.errors import UnexpectedStatus
try:
alert = client.alerts.get_alert(alert_id="nonexistent")
except UnexpectedStatus as e:
print(f"HTTP {e.status_code}: {e.content}")
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Lint
ruff check .
# Type check
mypy corsa_sdk/
How the SDK is Generated
This SDK is auto-generated from the Corsa API Gateway OpenAPI specification:
- A GitHub Actions workflow runs hourly and fetches the latest
api-spec.jsonfrom staging openapi-python-clientgenerates typed Python models and API modules- Generated code is merged into the repo (preserving manual modules like
webhooks/andcorsa_client.py) - A PR is opened for review; on merge,
python-semantic-releasepublishes to PyPI
License
MIT
Metadata
Release files for corsa-sdk 1.11.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| corsa_sdk-1.11.1.tar.gz | 331.1 kB | With provenance | Details for corsa_sdk-1.11.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| corsa_sdk-1.11.1-py3-none-any.whl | Python 3 | none | any | Details for corsa_sdk-1.11.1-py3-none-any.whl |
Total release size: 1.2 MB
Release files / corsa_sdk-1.11.1.tar.gz
| Download URL | corsa_sdk-1.11.1.tar.gz |
|---|---|
| Size | 331.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe30be5db0396d958e770eef313c15f85885909413c92f276c6d4d0b8235705a
|
|
BLAKE2b-256 checksum How to use checksums |
082ba75c1b7a3631fa0957b115df04e14084087bddd0e33218160b3c19b81036
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / corsa_sdk-1.11.1-py3-none-any.whl
| Download URL | corsa_sdk-1.11.1-py3-none-any.whl |
|---|---|
| Size | 896.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba6393eb1a3b152520e9cf479790cd09b129ab3a80bf66221619f58167e551f8
|
|
BLAKE2b-256 checksum How to use checksums |
8c7a5aac8d254e7b925da509542ac04ef0e5c2fa3d69cb5e8cdd60cf20e19048
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for corsa-sdk 1.11.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for corsa_sdk-1.11.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.