SDKs

Python

The avetrust SDK — a synchronous, typed client for the AveTrust API.

Install

pip install avetrust

Initialize

from avetrust import AveTrust

av = AveTrust("sk_test_…")   # sandbox inferred from the key prefix
print(av.is_test_mode)        # True

Create a verification

v = av.verifications.create(
    checks=["DOCUMENT", "LIVENESS", "FACE_MATCH"],
    external_user_id="user_42",
    callback_url="https://your-app.example/kyc/webhook",
)
print(v.id, v.token)
# hostedUrl is in the create response (white-label). Build the link from the
# token if needed: https://verify.avetrust.net/s/<token>

Read the result

result = av.verifications.result(v.id)
print(result.status)            # APPROVED | REJECTED | REVIEW
for c in result.checks:
    print(c.type, c.result, c.score)

Stream progress (SSE):

final = av.verifications.stream(v.token)
print(final.status)
link = f"https://verify.avetrust.net/s/{v.token}"
av.verifications.send_link(v.id, channel="EMAIL", to="client@example.com", link=link)
av.verifications.decide(v.id, "approved", note="Reviewed by agent")

event = av.webhooks.construct_event(raw_body, signature, secret)  # X-AveTrust-Signature
print(event.type, event.data.status)

Next steps

On this page