Models
The Python SDK uses Pydantic for data validation and modeling.
CDPConfig
Configuration for the CDPClient.
| Field | Type | Default | Description |
|---|---|---|---|
cdp_api_key | str | Required | Your OpenCDP API Key. |
cdp_endpoint | str | (Cloud URL) | The base URL for the API. |
timeout_ms | int | 10000 | Per-host gateway wait in milliseconds (10 seconds). |
send_to_customer_io | bool | False | Enable dual-write functionality. |
customer_io | CustomerIoConfig | None | Configuration for Customer.io. |
debug | bool | False | Enable debug logging. |
Gateway request timeout
timeout_ms is in milliseconds. The built-in default is 10000 (10 seconds). Leave it unset to keep that default.
The timeout is how long the SDK waits for one gateway host to answer a single request. On a timeout, a network error, or a non-success status, the SDK tries the next host immediately:
https://api.opencdp.io/gateway/data-gatewayhttps://api.open-cdp.com/gateway/data-gatewayhttps://api.open-cdp.xyz/gateway/data-gateway
To wait 5 seconds on each host:
CDPConfig(
cdp_api_key="YOUR_CDP_API_KEY",
timeout_ms=5000, # 5 seconds
)
Identifiers
User identifiers used in transactional payloads.
| Field | Type | Description |
|---|---|---|
id | Optional[str] | Unique system user ID. |
email | Optional[str] | User's email address. |
cdp_id | Optional[str] | Internal CDP record ID. |
EmailPayload
Refer to send_email for full field list.
PushPayload
Refer to send_push for full field list.
SmsPayload
Refer to send_sms for full field list.