{"id":5515,"library":"telesign","title":"TeleSign SDK","description":"The TeleSign Python SDK simplifies integration with TeleSign's REST APIs for user verification, digital identity, and omnichannel communications, helping to secure onboarding, maintain account integrity, and prevent fraud. It wraps various TeleSign services, including Messaging, Verify, and Intelligence. The library is actively maintained, with version 4.0.1 being the latest release, receiving regular updates and patches.","status":"active","version":"4.0.1","language":"en","source_language":"en","source_url":"https://github.com/telesign/python_telesign","tags":["telecom","sms","voice","2fa","security","fraud-prevention","identity-verification"],"install":[{"cmd":"pip install telesign","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"MessagingClient","correct":"from telesign.messaging import MessagingClient"},{"note":"The `telesignenterprise` package is for 'Full-service' accounts and has different import paths for Verify services. For the 'telesign' (self-service) package, the older `telesign.api.Verify` is the correct import for basic verification methods, while `telesign.messaging.MessagingClient` is used for newer messaging features.","wrong":"from telesignenterprise.verify import VerifyClient","symbol":"Verify","correct":"from telesign.api import Verify"}],"quickstart":{"code":"import os\nfrom telesign.messaging import MessagingClient\n\nCUSTOMER_ID = os.environ.get('TELESIGN_CUSTOMER_ID', 'YOUR_CUSTOMER_ID')\nAPI_KEY = os.environ.get('TELESIGN_API_KEY', 'YOUR_API_KEY')\nPHONE_NUMBER = os.environ.get('TELESIGN_PHONE_NUMBER', '11234567890') # E.164 format\nMESSAGE = \"Your package has shipped!\"\nMESSAGE_TYPE = \"ARN\"\n\nif CUSTOMER_ID == 'YOUR_CUSTOMER_ID' or API_KEY == 'YOUR_API_KEY':\n    print(\"Please set TELESIGN_CUSTOMER_ID and TELESIGN_API_KEY environment variables or replace placeholders.\")\nelse:\n    try:\n        messaging_client = MessagingClient(CUSTOMER_ID, API_KEY)\n        response = messaging_client.message(PHONE_NUMBER, MESSAGE, MESSAGE_TYPE)\n\n        if response.ok:\n            print(f\"Message sent successfully: {response.json}\")\n        else:\n            print(f\"Error sending message: {response.json}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to send an SMS message using the `MessagingClient`. It retrieves TeleSign credentials and the recipient's phone number from environment variables, or uses placeholders if not set. After initializing the client, it attempts to send a message and prints the API response."},"warnings":[{"fix":"Review the TeleSign developer documentation for the latest Intelligence Cloud API and Verify API to re-implement functionality. The App Verify API SDK has been discontinued entirely.","message":"Version 4.0.0 and 3.0.0 removed all functionality and methods for the Legacy Intelligence Use Case API and the App Verify SDK. Users relying on these legacy APIs must migrate to newer services.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade to the latest SDK, ensure a `ScoreClient` instance is used, and replace calls to `PhoneIdClient` score methods with `ScoreClient` score methods. The Intelligence endpoint should be updated to `https://detect.telesign.com/intelligence/phone`, with the phone number submitted in the API request body.","message":"With TeleSign Python SDK v4.0.0 and the launch of Intelligence Cloud, legacy GET-based Intelligence methods (e.g., from `PhoneIdClient`) are no longer supported. Integrations using these methods must switch to POST-based methods (e.g., from `ScoreClient`).","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"If experiencing connection errors, instantiate the client with `pool_recycle` set to a value less than 499 (e.g., 300-480) to automatically refresh the HTTP session. Example: `MessagingClient(customer_id, api_key, pool_recycle=480)`.","message":"HTTP Keep-Alive connections can cause 'connection reset by peer' errors if idle for more than 499 seconds. While v2.3.1 added automatic HTTP session recycling, older integrations or specific network configurations might still encounter this.","severity":"gotcha","affected_versions":"<4.0.1"},{"fix":"Upgrade to version 4.0.1 or higher to resolve compatibility issues with `pkg_resources` and `setuptools`.","message":"Versions of the SDK prior to v4.0.1 and v3.0.1 may encounter issues with newer `setuptools` versions due to the removal of `pkg_resources`.","severity":"gotcha","affected_versions":"<3.0.1, >=3.0.1,<4.0.1"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}