Skip to main content

Ontiver Python SDK

Official Python SDK for integrating Ontiver verification, screening, proofs, and webhooks into enterprise backends.

The dashboard remains the control plane for API keys, scopes, billing, team roles, webhooks, and audit logs. The SDK is the integration layer for Django, Flask, FastAPI, workers, and internal services.

Install Locally

From this repository:

cd sdks/python
python -m pip install -e ".[test]"

After publication:

python -m pip install ontiver

Configuration

Create an API key from the Ontiver enterprise dashboard and store it in your secret manager.

ONTIVER_API_KEY=prod_xxx
ONTIVER_API_SECRET=sec_xxx
ONTIVER_BASE_URL=https://api.ontiver.com
ONTIVER_ENVIRONMENT=production
ONTIVER_WEBHOOK_SECRET=whsec_xxx
ONTIVER_APP_ID=app_xxx

Use sandbox keys in non-production environments:

ONTIVER_API_KEY=sb_xxx
ONTIVER_API_SECRET=sec_xxx
ONTIVER_ENVIRONMENT=sandbox

Dashboard-created API keys include a one-time API secret. Store both values; authenticated requests send the key as Authorization: Bearer ... and the secret as X-Ontiver-API-Secret.

Quickstart

from ontiver import OntiverClient

client = OntiverClient.from_env()

startup_check = client.validate_api_key()
print(startup_check["valid"])

Validate credentials without making mutating production calls:

ontiver-smoke

Async services can use the async client with the same resources:

from ontiver import AsyncOntiverClient

async with AsyncOntiverClient.from_env() as client:
    startup_check = await client.validate_api_key()
    webhooks = await client.webhooks.list()

High-Risk Request Options

Mutating enterprise actions that are nonce-protected or step-up protected accept the same security options:

import time
import uuid

client.api_keys.revoke(
    "key_123",
    idempotency_key="revoke-key-123",
    nonce=str(uuid.uuid4()),
    timestamp=int(time.time()),
)

Supported options include idempotency_key, nonce, timestamp, admin_step_up_token, and impersonation_token.

Verification

SDK v1 routes flexible verification payloads to:

POST /api/v1/banking/kyc/individual/verify
GET  /api/v1/banking/kyc/individual/{verificationId}
result = client.verifications.create(
    {
        "customerId": "cust_123",
        "firstName": "Ada",
        "lastName": "Okafor",
        "country": "NG",
        "idDocumentType": "passport",
        "idDocumentNumber": "A12345678",
    },
    idempotency_key="verify-cust-123",
)

status = client.verifications.get(result["verificationId"])

Phone Verification

Use the dedicated phone-verification resource for signup, login, account recovery, or phone changes. The API returns only the last four digits; OTP values and full phone numbers must not be logged or persisted outside the intended identity workflow.

challenge = client.phone_verifications.create(
    "+2348012345678",
    country="NG",
    purpose="signup",
    user_id="user_123",
    device_id="device_123",
    idempotency_key="phone-signup-user-123",
)

verified = client.phone_verifications.verify(
    challenge["verificationId"],
    "123456",
    idempotency_key="phone-confirm-user-123",
)

Use get(verification_id) to poll status and resend(verification_id, idempotency_key=...) after resendAfter.

Verification Requests

Ask a person to verify with consent. Ontiver emails them their own link, reuses what they have already verified, and reminds them 3 days and 1 day before the deadline. A person at your business makes the final decision.

request = client.workflows.create(
    "ng-financial-onboarding",
    "Loan application LOAN-2026-0193",
    subject_email="ada@example.com",
    subject_reference="LOAN-2026-0193",
    respond_by_days=14,
)

flagged = client.workflows.list(status="review_required", assigned="unassigned")
client.workflows.review(request["caseId"], "approved", "Identity and address confirmed")
pdf_bytes = client.workflows.record_pdf(request["caseId"])

Send to many people with create_bulk, manage groups with cancel_batch and resend_unopened, and bring existing customers in with import_customers and send_customer_wave. At sign-in, customer_status(reference) says whether the customer still needs to verify and whether it is required yet.

Screening

screening = client.screening.sanctions_check(
    first_name="Ada",
    last_name="Okafor",
    nationality="NG",
    idempotency_key="sanctions-cust-123",
)

Supported methods:

  • client.screening.pep_check(...)
  • client.screening.sanctions_check(...)
  • client.screening.adverse_media_check(first_name, last_name, ...)

Proofs

proof = client.proofs.get_for_verification("ver_123")

verified = client.proofs.verify(
    proof_id=proof["proofId"],
    proof=proof.get("proof"),
)

Supported methods:

  • client.proofs.generate(...)
  • client.proofs.get_for_verification(verification_id)
  • client.proofs.verify(proof_id, proof=None)
  • client.proofs.disclose(proof_id, fields=[...])
  • client.proofs.circuits()
  • client.proofs.noir_toolchain()
  • client.proofs.generate_noir(...)
  • client.proofs.verify_noir(...)

Enterprise Disclosure Requests

import time
import uuid

request = client.disclosure_requests.create(
    user_email="customer@example.com",
    verification_type="bvn",
    requested_fields=["verified_status", "full_name", "date_of_birth"],
    purpose="Account onboarding",
    audience="Ontiver demo",
    challenge="customer-session-123",
    ttl_minutes=60,
    nonce=str(uuid.uuid4()),
    timestamp=int(time.time()),
)

proof = client.disclosure_requests.get_proof(request["requestId"])
verified = client.disclosure_requests.verify_proof(proof["proof"]["proofToken"])

Supported methods:

  • client.disclosure_requests.list(...)
  • client.disclosure_requests.create(...)
  • client.disclosure_requests.get(request_id)
  • client.disclosure_requests.get_proof(request_id)
  • client.disclosure_requests.verify_proof(proof_token)
  • client.disclosure_requests.list_templates()
  • client.disclosure_requests.create_template(...)
  • client.disclosure_requests.delete_template(template_id)

Registered Applications And Verify With Ontiver

Partner-facing Verify with Ontiver integrations should be attached to a registered application. Use the dashboard for normal onboarding, or the SDK from a trusted backend service.

app = client.enterprise_applications.create(
    name="Example Bank",
    display_name="Example Bank",
    website_url="https://example.com",
    environment="sandbox",
    verification_types=["bvn", "nin", "passport"],
    redirect_urls=["https://example.com/onboarding/ontiver/return"],
    callback_urls=["https://api.example.com/webhooks/ontiver"],
)

client.enterprise_applications.update(
    app["applicationId"],
    default_requested_fields=["verified_status", "verified_at", "assurance_level"],
)

usage = client.enterprise_applications.usage(app["applicationId"])

Logo upload is available for approved app branding:

client.enterprise_applications.upload_logo(app["applicationId"], "logo.png", content_type="image/png")

Create a signed verification session:

import os

session = client.verify_with_ontiver.create_session(
    app_id=os.environ["ONTIVER_APP_ID"],
    api_secret=os.environ["ONTIVER_API_SECRET"],
    partner_user_id="partner-user-001",
    user_email="customer@example.com",
    verification_type="bvn",
    requested_fields=["verified_status", "verified_at", "bvn_last4"],
    purpose="Account onboarding",
    audience="Example Bank",
    callback_url="https://api.example.com/webhooks/ontiver",
    return_url="https://example.com/onboarding/ontiver/return",
)

proof = client.verify_with_ontiver.get_proof(
    session["sessionId"],
    app_id=os.environ["ONTIVER_APP_ID"],
    api_secret=os.environ["ONTIVER_API_SECRET"],
)
verified = client.verify_with_ontiver.verify_proof(
    proof["proofToken"],
    app_id=os.environ["ONTIVER_APP_ID"],
    api_secret=os.environ["ONTIVER_API_SECRET"],
)

Existing partner KYC imports start as partner attestations, not Ontiver credentials:

client.enterprise_applications.import_partner_kyc(
    app["applicationId"],
    [{
        "externalUserId": "partner-user-001",
        "email": "customer@example.com",
        "verificationType": "bvn",
        "provider": "ExistingKycProvider",
        "providerReference": "prov-ref-001",
        "verifiedAt": "2026-06-01T00:00:00Z",
        "evidenceHash": "sha256:...",
        "consentBasis": "Existing partner onboarding consent",
    }],
)

Supported methods:

  • client.enterprise_applications.list()
  • client.enterprise_applications.get(app_id)
  • client.enterprise_applications.create(...)
  • client.enterprise_applications.update(app_id, ...)
  • client.enterprise_applications.upload_logo(app_id, file, ...)
  • client.enterprise_applications.usage(app_id)
  • client.enterprise_applications.import_partner_kyc(app_id, records, ...)
  • client.enterprise_applications.get_kyc_import(app_id, batch_id)
  • client.enterprise_applications.list_kyc_imports(app_id)
  • client.verify_with_ontiver.create_session(...)
  • client.verify_with_ontiver.get_proof(session_id, ...)
  • client.verify_with_ontiver.verify_proof(proof_token, ...)
  • client.verify_with_ontiver.import_partner_kyc(...)

Compliance, AML, And Approvals

overview = client.compliance.overview()
packet = client.compliance.packet("req_123")

aml = client.aml.create_smile_check(
    {"customerId": "cust_123", "fullName": "Ada Okafor", "countries": ["NG"]}
)

approvals = client.enterprise_approvals.list(status="pending")

Supported resources:

  • client.compliance.overview(), case(request_id), packet(request_id)
  • client.aml.create_smile_check(...), get_smile_check(check_id), create_smile_news(...), get_smile_news(news_id), risk_score(...), transaction_monitoring(...)
  • client.ongoing.enable(...), disable(...), status(customer_id), changes(customer_id), due_reviews(...)
  • client.enterprise_approvals.list(...), approve(...), reject(...), cancel(...)
  • client.diagnostics.list(...), retry(request_id, ...), cancel(request_id, ...)
  • client.api_settings.get(), update(...)
  • client.api_keys.list(...), create(...), revoke(...), validate_current()

Use the generic paginator for cursor-based list endpoints:

for item in client.paginate("/diagnostics/requests", limit=100):
    print(item)

Webhooks

Register a webhook:

Webhook write calls generate a nonce and timestamp automatically. You can pass your own values when your infrastructure needs to correlate or pre-sign a request.

import time
import uuid

webhook = client.webhooks.register(
    "https://example.com/webhooks/ontiver",
    ["verification.completed", "proof.issued"],
    nonce=str(uuid.uuid4()),
    timestamp=int(time.time()),
)

# Store this once. It will not be returned by list endpoints.
secret = webhook["secret"]

Webhook delivery retries are available through:

retries = client.webhooks.retries()
deliveries = client.webhooks.deliveries(webhook_id="wh_123", status="failed")

Verify webhook signatures using the raw request body, then parse a typed payload:

from ontiver.webhooks import parse_webhook_payload, verify_webhook_signature

is_valid = verify_webhook_signature(raw_body, request.headers["X-Ontiver-Signature"], secret)
event = parse_webhook_payload(raw_body)

Header format:

X-Ontiver-Signature: sha256=<hex_digest>

Raw Request Escape Hatch

Use raw_request() for routes that do not have first-class wrappers yet:

result = client.raw_request(
    "POST",
    "/aml/smile-checks",
    json={"fullName": "Ada Okafor", "countries": ["NG"]},
    idempotency_key="aml-cust-123",
)

Errors

Catch specific exceptions:

from ontiver import AuthenticationError, PermissionDeniedError, RateLimitError, ValidationError

try:
    client.validate_api_key()
except AuthenticationError:
    ...
except PermissionDeniedError:
    ...
except RateLimitError:
    ...
except ValidationError:
    ...

The SDK redacts API keys, bearer tokens, webhook secrets, and secret prefixes from exception messages.

Security Notes

  • Never commit API keys or webhook secrets.
  • Store production secrets in a secret manager.
  • Use least-privilege API key scopes.
  • Use sandbox keys outside production.
  • Verify webhook signatures over the raw body bytes before parsing JSON.
  • Do not log raw identity documents, ID numbers, biometric payloads, or full provider payloads.

Build And Publish

Build locally:

cd sdks/python
python -m pip install -e ".[test]"
pytest
python -m pip install ".[build]"
python -m build
python -m twine check dist/*

Publish first to TestPyPI:

python -m twine upload --repository testpypi dist/*

Install from TestPyPI in a clean environment:

python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple ontiver

Publish to PyPI after TestPyPI install passes:

python -m twine upload dist/*

Target package name: ontiver.

Metadata

Release files for ontiver 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ontiver 0.2.1
File Size Uploaded Provenance Actions
ontiver-0.2.1.tar.gz 33.3 kB With provenance Details for ontiver-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ontiver 0.2.1
File Interpreter ABI Platform Actions
ontiver-0.2.1-py3-none-any.whl Python 3 none any Details for ontiver-0.2.1-py3-none-any.whl

Total release size: 70.7 kB

Release files / ontiver-0.2.1.tar.gz

Download URL ontiver-0.2.1.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f3ce93eeedab074d253176a8d6eaa2f251e2fb6eb5038617afe60fb7e1ad36a0
BLAKE2b-256 checksum
How to use checksums
7bbcba08b7c090df612425972f05c9b7fdaa1bebeeb07e216298de908a3d44f2
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 Nov 12, 2026.

Transparency log

Release files / ontiver-0.2.1-py3-none-any.whl

Download URL ontiver-0.2.1-py3-none-any.whl
Size 37.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02b4b057d0df1c60c09a620d859d8b907b39aabc2162658d9ccdee5f63c4cde6
BLAKE2b-256 checksum
How to use checksums
eb0042d3b7ff308dc7a1f64fcc2656915063e67362fa4998a73a2e311eae97f9
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 Nov 12, 2026.

Transparency log

Security for ontiver 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ontiver-0.2.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 Nov 12, 2026.

Transparency log

A 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.

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