Cybrid Identity API Python Client

0.128.106 · active · verified Thu Apr 16

Cybrid-api-id-python is the official Python client for interacting with the Cybrid Identity APIs. Cybrid provides an all-in-one platform for compliant stablecoins and fiat payment infrastructure, offering crypto liquidity, secure wallet custody, and regulatory compliance. This library, currently at version 0.128.106, is actively maintained with frequent updates, reflecting ongoing development of the Cybrid platform.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the Cybrid Identity API client using an OAuth 2.0 Bearer Token and make a sample call to list users. You must first obtain a Bearer Token from the Cybrid Identity Provider using your Client ID and Client Secret, which are generated in the Cybrid dashboard. This token should be passed as the `access_token` to the `Configuration`. The example uses the sandbox environment.

import os
from cybrid_api_id.configuration import Configuration
from cybrid_api_id.api_client import ApiClient
from cybrid_api_id.api.users_api import UsersApi
from pprint import pprint

# Retrieve Bearer Token from environment variable
# Ensure you obtain a token from the Cybrid platform (Sandbox or Production)
# using your Client ID and Client Secret.
# Example cURL to get token:
# curl -X POST https://id.production.cybrid.app/oauth/token -d '{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET","grant_type":"client_credentials","scope":"users:read"}'
CYBRID_BEARER_TOKEN = os.environ.get('CYBRID_BEARER_TOKEN', 'YOUR_BEARER_TOKEN')

if CYBRID_BEARER_TOKEN == 'YOUR_BEARER_TOKEN':
    print("WARNING: Please set the CYBRID_BEARER_TOKEN environment variable or replace 'YOUR_BEARER_TOKEN' with a valid token.")
    exit()

configuration = Configuration(
    host = "https://id.sandbox.cybrid.app", # Use https://id.production.cybrid.app for production
    access_token = CYBRID_BEARER_TOKEN
)

with ApiClient(configuration) as api_client:
    api_instance = UsersApi(api_client)
    
    try:
        # List users
        # Requires 'users:read' scope
        api_response = api_instance.list_users(page=1, per_page=10)
        print("Successfully listed users:")
        pprint(api_response)
    except Exception as e:
        print(f"Exception when calling UsersApi->list_users: {e}")

view raw JSON →