{"id":8639,"library":"sib-api-v3-sdk","title":"Brevo (formerly Sendinblue) API Python SDK","description":"The `sib-api-v3-sdk` is the official Python client library for the Brevo (formerly Sendinblue) API v3. It provides a wrapper around the RESTful API, enabling developers to programmatically manage email campaigns, transactional emails, SMS, contacts, and retrieve statistics. The library is currently at version 7.6.0 and is actively maintained, with updates typically released as needed for bug fixes and new features.","status":"active","version":"7.6.0","language":"en","source_language":"en","source_url":"https://github.com/sendinblue/APIv3-python-library","tags":["email","transactional","marketing","sms","api","brevo","sendinblue"],"install":[{"cmd":"pip install sib-api-v3-sdk","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"HTTP client for API requests","package":"urllib3","optional":false},{"reason":"Date/time parsing for API responses","package":"python-dateutil","optional":false},{"reason":"SSL certificate validation","package":"certifi","optional":false},{"reason":"Python 2 and 3 compatibility utilities (often a transitive dependency)","package":"six","optional":false}],"imports":[{"symbol":"sib_api_v3_sdk","correct":"import sib_api_v3_sdk"},{"note":"Configuration is a class within the main package, not a submodule.","wrong":"import sib_api_v3_sdk.Configuration","symbol":"Configuration","correct":"from sib_api_v3_sdk import Configuration"},{"note":"API classes are typically found within the `sib_api_v3_sdk.api` submodule, and their names are often snake_case in the import path.","wrong":"from sib_api_v3_sdk import TransactionalEmailsApi","symbol":"TransactionalEmailsApi","correct":"from sib_api_v3_sdk.api import transactional_emails_api"},{"note":"Model classes representing API payloads are usually located in the `sib_api_v3_sdk.model` submodule.","wrong":"from sib_api_v3_sdk import SendSmtpEmail","symbol":"SendSmtpEmail","correct":"from sib_api_v3_sdk.model.send_smtp_email import SendSmtpEmail"}],"quickstart":{"code":"import sib_api_v3_sdk\nfrom sib_api_v3_sdk.api import transactional_emails_api\nfrom sib_api_v3_sdk.model.send_smtp_email import SendSmtpEmail\nimport os\n\n# Configure API key authorization: api-key\nconfiguration = sib_api_v3_sdk.Configuration()\nconfiguration.api_key['api-key'] = os.environ.get('BREVO_API_KEY', 'YOUR_API_KEY')\n\n# Create an instance of the API class\napi_instance = transactional_emails_api.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(configuration))\n\n# Define the email to be sent\nsender = {\"name\":\"Sender Name\", \"email\":\"sender@example.com\"}\nto = [{\"email\":\"recipient@example.com\", \"name\":\"Recipient Name\"}]\n\nsend_smtp_email = SendSmtpEmail(\n    sender=sender,\n    to=to,\n    subject=\"My Test Subject\",\n    html_content=\"<html><body><h1>This is a test email from Brevo!</h1></body></html>\"\n)\n\ntry:\n    # Send a transactional email\n    api_response = api_instance.send_transac_email(send_smtp_email)\n    print(f\"API called successfully. Returned data: {api_response}\")\nexcept sib_api_v3_sdk.rest.ApiException as e:\n    print(f\"Exception when calling TransactionalEmailsApi->send_transac_email: {e}\")","lang":"python","description":"This quickstart demonstrates how to configure the Brevo Python SDK using an API key and send a basic transactional email. Ensure your `BREVO_API_KEY` environment variable is set or replace 'YOUR_API_KEY' with your actual API key."},"warnings":[{"fix":"Be aware that 'Sendinblue' and 'Brevo' refer to the same service. Prioritize official Brevo documentation and use 'Brevo API' in searches. The SDK code remains functional under the new branding.","message":"Sendinblue rebranded to Brevo in 2023. While the Python SDK package name `sib-api-v3-sdk` remains the same, documentation, branding, and some concepts now refer to 'Brevo'. This can cause confusion when searching for resources or matching old Sendinblue terminology to new Brevo contexts.","severity":"breaking","affected_versions":"All versions post-rebranding (e.g., from 7.x.x onwards)."},{"fix":"Always store your API key securely, preferably in environment variables (e.g., `os.environ.get('BREVO_API_KEY')`), a secrets management service, or a configuration file that is not committed to version control.","message":"API keys are sensitive credentials. Hardcoding them directly in your source code is a security risk. Exposure can lead to unauthorized access to your Brevo account.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Refer closely to the official documentation and the SDK's source code on GitHub to understand the exact module structure and method definitions. Pay attention to snake_case vs. CamelCase in generated code.","message":"The SDK is auto-generated from an OpenAPI specification (Swagger Codegen). This means class structures and method names might not always follow typical Pythonic conventions, which can occasionally lead to unexpected import paths or method signatures.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure your system has necessary build tools (e.g., `build-essential` on Debian/Ubuntu, Xcode Command Line Tools on macOS) and that your `pip` is up-to-date (`pip install --upgrade pip`). If using a virtual environment, ensure it's active. Sometimes, `pip install --no-binary :all: sib-api-v3-sdk` or installing `wheel` first (`pip install wheel`) can help.","cause":"This often indicates missing C/C++ compilers or other build tools required by one of the SDK's transitive dependencies (e.g., `cryptography` for `urllib3` if an older system Python is used), or issues with permissions.","error":"ERROR: Command errored out with exit status 1: ... Running setup.py install for sib-api-v3-sdk ... error"},{"fix":"API client classes are usually in `sib_api_v3_sdk.api` and model classes in `sib_api_v3_sdk.model`. For example, use `from sib_api_v3_sdk.api import transactional_emails_api` and `from sib_api_v3_sdk.model.send_smtp_email import SendSmtpEmail`.","cause":"This error occurs when trying to access API client classes or model classes directly from the top-level `sib_api_v3_sdk` module, instead of their correct submodules.","error":"AttributeError: module 'sib_api_v3_sdk' has no attribute 'TransactionalEmailsApi'"},{"fix":"Verify that your API key is correct and active in your Brevo account. Ensure it has the necessary permissions for the API calls you are making (e.g., Transactional Emails permission for sending emails). Double-check for leading/trailing spaces or typos.","cause":"The provided API key is either incorrect, revoked, or has insufficient permissions for the attempted operation.","error":"sib_api_v3_sdk.rest.ApiException: (401)\nReason: Unauthorized\nHTTP response body: {'code': 'unauthorized', 'message': 'Invalid API Key'}"}]}