Skip to content

Add reason_code to Finish Conversation#12

Merged
Catchpowle merged 1 commit into
mainfrom
public-api-finish-reason-code
Jul 21, 2026
Merged

Add reason_code to Finish Conversation#12
Catchpowle merged 1 commit into
mainfrom
public-api-finish-reason-code

Conversation

@Catchpowle

Copy link
Copy Markdown
Contributor

Adds an optional reason_code field to FinishConversationParams, so callers of client.conversations.finish(id, ...) can categorise why a conversation finished (e.g. customer-ended-chat, customer-unresponsive) in addition to the existing free-text reason. The field is serialized verbatim into the request body under the exact JSON key reason_code, matching how the SDK already models snake_case wire fields (and the reason_code field on hand-off webhook events). It is optional, so existing calls compile and behave unchanged. Extends the finish HTTP test to assert both reason and reason_code are sent, and demonstrates the field in the conversations example.

Mirrors platform change gradientlabs-ai/wearegradient#30159 and docs gradientlabs-ai/docs#236.

🤖 Generated with Claude Code

The public API PUT /conversations/{id}/finish now accepts an optional
reason_code field alongside the existing free-text reason. Expose it on
FinishConversationParams so callers can categorise why a conversation
finished (e.g. customer-ended-chat, customer-unresponsive).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Catchpowle
Catchpowle requested review from a team as code owners July 21, 2026 13:14
@Catchpowle
Catchpowle merged commit 5850146 into main Jul 21, 2026
2 checks passed
@Catchpowle
Catchpowle deleted the public-api-finish-reason-code branch July 21, 2026 13:29
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