Skip to content

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

Merged
gmtuca merged 3 commits into
mainfrom
api-client-sync/2026-07-31
Aug 4, 2026
Merged

[api-sync 2026-07-31] gradientlabs-java: split outbound conversation start into chat/email/phone#35
gmtuca merged 3 commits into
mainfrom
api-client-sync/2026-07-31

Conversation

@gmtuca

@gmtuca gmtuca commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Syncs the Java SDK to the public API change that removed POST /outbound/conversations and replaced it with three channel-specific endpoints.

Outbound conversation start split per channel

GradientLabsClient.startOutboundConversation(...) and StartOutboundConversationRequest (including its nested CustomerSource / SupportPlatform constant classes) have been removed. There is no deprecation window — the underlying endpoint no longer exists.

New methods, each with its own request type:

Old New Endpoint
startOutboundConversation(...) with channel = "web" startOutboundChatConversation(StartOutboundChatConversationRequest) POST /outbound/conversations/chat
startOutboundConversation(...) with channel = "email" startOutboundEmailConversation(StartOutboundEmailConversationRequest) POST /outbound/conversations/email
startOutboundConversation(...) with channel = "voice" startOutboundPhoneConversation(StartOutboundPhoneConversationRequest) POST /outbound/conversations/phone

All three return the existing StartOutboundConversationResponse (conversation_id).

Migration

Old field New
channel Pick the matching method: voice → phone, email → email, web → chat. Phone has no channel or support-platform field at all.
customerSource No replacement. customerId is now always your own customer ID — the one echoed back in tool and webhook payloads.
third-party platform IDs customerSupportPlatformIdentifiers (the existing CustomerSupportPlatformIdentifier type already used by startConversation), keyed by platform. Zendesk requires subtype zendesk_support_user; Salesforce requires salesforce_contact_id.
supportPlatform Now required on chat and email — the API no longer auto-selects the highest-priority connected platform. Valid values: chat intercom, public-api; email intercom, zendesk, salesforce, public-api (exposed as constants on each request class).
subject / body Email only, and required together — setting just one now throws IllegalArgumentException at build time, mirroring server-side validation. Chat takes body alone; phone takes neither.
Phone adds required toPhoneNumber and fromPhoneNumber (E.164; the from-number must already be provisioned for your company).

Version

1.0.1-SNAPSHOT1.0.2 (patch — the removed endpoint has no known users, so this does not warrant a major bump); non--SNAPSHOT so it is releasable. Bumped in the root pom, both module poms, the example app's dependency pin, and the install snippets in both READMEs.

The client jar now stamps Implementation-Version into its manifest, so the User-Agent reports Gradient-Labs-Java/1.0.2 instead of the dev fallback it has been sending since 1.0.0.

Verification

mvn verify from the repo root: BUILD SUCCESS, Tests run: 15, Failures: 0, Errors: 0, Skipped: 0. Eight new tests cover serialization of all three payloads, omission of unset optionals, the required-field checks, and the email subject/body pairing rule.

🤖 Generated with Claude Code

Release workflow fix

.github/workflows/release.yml set up JDK 11 while the poms compile with source/target 17, so mvn deploy would have failed at compilation with invalid target release: 17 on the first tag push. Now 17, matching CI.

The READMEs also claimed "Java 11 or higher" in four places, wrong since the move to 17: class files are version 61, so an 11 runtime fails with UnsupportedClassVersionError after resolving the dependency rather than at build time. Now 17.

Verified with mvn verify (BUILD SUCCESS, 15 tests) and mvn -P release package -DskipTests -Dgpg.skip=true (BUILD SUCCESS).

POST /outbound/conversations has been removed from the public API and
replaced by /outbound/conversations/{chat,email,phone}.

startOutboundConversation is replaced by startOutboundChatConversation,
startOutboundEmailConversation and startOutboundPhoneConversation, each
with its own request type. 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 has no channel or support platform field.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gmtuca
gmtuca force-pushed the api-client-sync/2026-07-31 branch 2 times, most recently from 2453b48 to ab7857a Compare August 4, 2026 14:51
gmtuca added 2 commits August 4, 2026 16:24
The release workflow set up JDK 11 while the poms compile with source/target
17, so mvn deploy would have failed at compilation with "invalid target
release: 17" on the first tag push. CI already uses 17.

The READMEs claimed Java 11, which has been wrong since the move to 17: class
files are version 61, so an 11 runtime fails with UnsupportedClassVersionError
after resolving the dependency rather than at build time.
@gmtuca
gmtuca force-pushed the api-client-sync/2026-07-31 branch from c586491 to b2e8b40 Compare August 4, 2026 15:25

gmtuca commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Aug 4, 3:46 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 4, 3:46 PM UTC: @gmtuca merged this pull request with Graphite.

@gmtuca
gmtuca merged commit 6245e3b into main Aug 4, 2026
1 check passed
@gmtuca
gmtuca deleted the api-client-sync/2026-07-31 branch August 4, 2026 15:46
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.

2 participants