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_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
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.3.0
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 |
|---|---|---|---|---|
| ontiver-0.3.0.tar.gz | 33.5 kB | With provenance | Details for ontiver-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ontiver-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for ontiver-0.3.0-py3-none-any.whl |
Total release size: 70.9 kB
Release files / ontiver-0.3.0.tar.gz
| Download URL | ontiver-0.3.0.tar.gz |
|---|---|
| Size | 33.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94cee733ed646903d38eae2612c31a61e9d0c98fd1faf5dc74b0b5e974d88171
|
|
BLAKE2b-256 checksum How to use checksums |
55dd50adce35fb93ea7dcbdf1606e0cf44e7dcef9b99f6be1b53aebed3980021
|
| 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 13, 2026.
Transparency logRelease files / ontiver-0.3.0-py3-none-any.whl
| Download URL | ontiver-0.3.0-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9619507435948baf28e9d44352530ed431e45dda40d8d3e20efbc70df719d5ad
|
|
BLAKE2b-256 checksum How to use checksums |
105e1bc7da444dc1b924fdfefe9d8f892d7dc29e448968024046cb7361055215
|
| 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 13, 2026.
Transparency logSecurity for ontiver 0.3.0
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.
Attestation for ontiver-0.3.0.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 13, 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.