Skip to main content

Models

The Python SDK uses Pydantic for data validation and modeling.

CDPConfig​

Configuration for the CDPClient.

FieldTypeDefaultDescription
cdp_api_keystrRequiredYour OpenCDP API Key.
cdp_endpointstr(Cloud URL)The base URL for the API.
timeout_msint10000Per-host gateway wait in milliseconds (10 seconds).
send_to_customer_ioboolFalseEnable dual-write functionality.
customer_ioCustomerIoConfigNoneConfiguration for Customer.io.
debugboolFalseEnable 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:

  1. https://api.opencdp.io/gateway/data-gateway
  2. https://api.open-cdp.com/gateway/data-gateway
  3. https://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.

FieldTypeDescription
idOptional[str]Unique system user ID.
emailOptional[str]User's email address.
cdp_idOptional[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.