Skip to content

[api-sync 2026-07-31] gradientlabs-python: split outbound conversation start into chat/email/phone - #136

Open
gmtuca wants to merge 2 commits into
mainfrom
api-client-sync/2026-07-31
Open

[api-sync 2026-07-31] gradientlabs-python: split outbound conversation start into chat/email/phone#136
gmtuca wants to merge 2 commits into
mainfrom
api-client-sync/2026-07-31

Conversation

@gmtuca

@gmtuca gmtuca commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

⚠️ Breaking change — version 0.13.0

POST /outbound/conversations has been removed from the Gradient Labs public API and replaced by three channel-specific endpoints. Client.start_outbound_conversation is gone; there is no deprecation shim, because the request shape changed too much to bridge.

Was Now
POST /outbound/conversations POST /outbound/conversations/chat
POST /outbound/conversations/email
POST /outbound/conversations/phone

Migration

Old (StartOutboundConversationParams) New
channel="web" client.start_outbound_chat_conversation(params=StartOutboundChatConversationParams(...))
channel="email" client.start_outbound_email_conversation(params=StartOutboundEmailConversationParams(...))
channel="voice" client.start_outbound_phone_conversation(params=StartOutboundPhoneConversationParams(...))
customer_source=... No replacement. customer_id is now always your own customer ID
third-party platform ID passed via customer_id + customer_source customer_support_platform_identifiers=[CustomerSupportPlatformIdentifier(...)] — the same type start_conversation already takes. Zendesk requires type="zendesk_support_user", Salesforce requires type="salesforce_contact_id"
support_platform optional (auto-selected the highest-priority connected platform) Required on chat and email. No auto-selection. Not accepted at all on phone — the API pins voice/LiveKit
subject / body loosely coupled Email: subject and body are required together and forbidden individually. Chat: body only. Phone: neither
n/a Phone requires to_phone_number and from_phone_number (E.164); from_phone_number must be provisioned for your workspace

All three return StartOutboundConversationResponse with a conversation_id.

Removed public API

  • Client.start_outbound_conversation
  • StartOutboundConversationParams
  • CustomerSourceconversation.CustomerSource no longer exists in the spec, and this enum existed solely for it
  • the outbound-only SupportPlatform enum, replaced by OutboundSupportPlatform (intercom, zendesk, salesforce, public-api) so it no longer collides with the identifier-scoped SupportPlatform

Also in this PR

  • The User-Agent header now carries the package version (Gradient Labs Python/0.13.0); it previously had none, so there was nothing keeping it in step with pyproject.toml.
  • uv.lock had drifted to 0.13.0 against a 0.12.1 pyproject.toml; bumping pyproject.toml to 0.13.0 makes the two agree, so uv.lock is unchanged by this PR.

Verification

uv run pytest tests — 21 passed, 4 failed. The 4 failures are all in tests/test_webhook.py (expired signature: hardcoded webhook timestamps outside the 5-minute leeway) and reproduce unchanged on main. Six new outbound tests added, all passing.

uv run ruff checkAll checks passed!
uvx ruff format --check114 files already formatted

Scope is deliberately narrow: only the outbound endpoints, plus the version bump.

🤖 Generated with Claude Code

gmtuca and others added 2 commits July 31, 2026 14:18
POST /outbound/conversations has been removed from the public API and
replaced by POST /outbound/conversations/{chat,email,phone}.

Replaces start_outbound_conversation with start_outbound_chat_conversation,
start_outbound_email_conversation and start_outbound_phone_conversation.
customer_source has no replacement: customer_id is now always your own
customer ID, and third-party platform IDs go in
customer_support_platform_identifiers. support_platform is required on chat
and email; phone takes to_phone_number/from_phone_number and no platform.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gmtuca
gmtuca force-pushed the api-client-sync/2026-07-31 branch from 6079435 to 604364a Compare July 31, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant