{"id":8052,"library":"cybrid-api-id-python","title":"Cybrid Identity API Python Client","description":"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.","status":"active","version":"0.128.106","language":"en","source_language":"en","source_url":"https://github.com/Cybrid-app/cybrid-api-id-python/","tags":["cryptocurrency","finance","api-client","identity","oauth","openapi-generated"],"install":[{"cmd":"pip install cybrid-api-id-python","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"HTTP client for API requests, common in OpenAPI generated clients.","package":"urllib3"},{"reason":"Date and time parsing, common in OpenAPI generated clients.","package":"python-dateutil"},{"reason":"Immutable dictionary implementation, often used for configuration in OpenAPI generated clients.","package":"frozendict"},{"reason":"Mozilla's collection of Root Certificates for validating the trustworthiness of SSL certificates.","package":"certifi"}],"imports":[{"note":"Used to configure API client with base URL and authentication.","symbol":"Configuration","correct":"from cybrid_api_id.configuration import Configuration"},{"note":"The core client for making API requests.","symbol":"ApiClient","correct":"from cybrid_api_id.api_client import ApiClient"},{"note":"Example API class for interacting with bank application endpoints.","symbol":"BankApplicationsApi","correct":"from cybrid_api_id.api.bank_applications_api import BankApplicationsApi"},{"note":"Example API class for generating customer access tokens.","symbol":"CustomerTokensApi","correct":"from cybrid_api_id.api.customer_tokens_api import CustomerTokensApi"},{"note":"Example API class for managing user resources.","symbol":"UsersApi","correct":"from cybrid_api_id.api.users_api import UsersApi"}],"quickstart":{"code":"import os\nfrom cybrid_api_id.configuration import Configuration\nfrom cybrid_api_id.api_client import ApiClient\nfrom cybrid_api_id.api.users_api import UsersApi\nfrom pprint import pprint\n\n# Retrieve Bearer Token from environment variable\n# Ensure you obtain a token from the Cybrid platform (Sandbox or Production)\n# using your Client ID and Client Secret.\n# Example cURL to get token:\n# 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\"}'\nCYBRID_BEARER_TOKEN = os.environ.get('CYBRID_BEARER_TOKEN', 'YOUR_BEARER_TOKEN')\n\nif CYBRID_BEARER_TOKEN == 'YOUR_BEARER_TOKEN':\n    print(\"WARNING: Please set the CYBRID_BEARER_TOKEN environment variable or replace 'YOUR_BEARER_TOKEN' with a valid token.\")\n    exit()\n\nconfiguration = Configuration(\n    host = \"https://id.sandbox.cybrid.app\", # Use https://id.production.cybrid.app for production\n    access_token = CYBRID_BEARER_TOKEN\n)\n\nwith ApiClient(configuration) as api_client:\n    api_instance = UsersApi(api_client)\n    \n    try:\n        # List users\n        # Requires 'users:read' scope\n        api_response = api_instance.list_users(page=1, per_page=10)\n        print(\"Successfully listed users:\")\n        pprint(api_response)\n    except Exception as e:\n        print(f\"Exception when calling UsersApi->list_users: {e}\")","lang":"python","description":"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."},"warnings":[{"fix":"Store Client ID and Secret in environment variables, a secure vault, or a secrets management service. Retrieve them at runtime and do not commit them to version control.","message":"Never expose your Client ID or Client Secret publicly or embed them directly in your source code repository. These credentials are used to obtain Bearer Tokens and should be treated as highly sensitive.","severity":"gotcha","affected_versions":"All"},{"fix":"Regularly review the Cybrid API changelog and client release notes. Pin exact library versions in your `requirements.txt` to prevent unexpected breaks and test updates thoroughly before deploying to production.","message":"As an auto-generated OpenAPI client, breaking changes in the underlying Cybrid API specification can lead to breaking changes in the Python client. While efforts are made to maintain backward compatibility, significant API changes may require client updates and code adjustments.","severity":"breaking","affected_versions":"All versions, especially with major API changes."},{"fix":"When generating tokens (e.g., using the OAuth Client Credential Grant flow), explicitly specify only the required scopes (e.g., `users:read` instead of full access).","message":"Default Bearer Tokens might have broad scopes. Follow the principle of least privilege by requesting and using tokens with the minimum necessary scopes required for your application's operations to limit potential damage from compromised tokens.","severity":"gotcha","affected_versions":"All"},{"fix":"Intercept API errors and map them to generic, user-friendly messages. Log detailed error information securely, filtering out any sensitive request or response data, focusing on `message_code` where available.","message":"Directly exposing raw API errors to end-users can leak sensitive internal information. Cybrid API error responses may contain internal identifiers or diagnostic data.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure you have obtained a current Bearer Token from the Cybrid Identity Provider and correctly set it in the `Configuration` object's `access_token` field. Verify that the token is not expired.","cause":"The API request was sent without a valid Bearer Token, or the provided token is expired or malformed.","error":"cybrid_api_id.exceptions.ApiException: (401) Reason: Unauthorized - Authentication failed"},{"fix":"Check the Cybrid API documentation for the specific endpoint to determine the required scopes. Generate a new Bearer Token that includes all necessary permissions for the intended API calls.","cause":"The Bearer Token used for the API request does not possess the necessary scopes (permissions) to perform the requested operation.","error":"cybrid_api_id.exceptions.ApiException: (403) Reason: Forbidden - Invalid scope"},{"fix":"Verify that the GUIDs or identifiers for resources are correct. Double-check the API endpoint path and ensure you're using the correct API class and method for the resource you're trying to access.","cause":"The requested resource (e.g., a user by GUID) does not exist, or the endpoint path is incorrect.","error":"cybrid_api_id.exceptions.ApiException: (404) Reason: Not Found"}]}