Skip to content

Commit d04d479

Browse files
authored
Add POST /fin/csat and the csat_requested event (#612)
1 parent 090b035 commit d04d479

4 files changed

Lines changed: 999 additions & 19 deletions

File tree

‎descriptions/0/api.intercom.io.yaml‎

Lines changed: 249 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24802,7 +24802,7 @@ paths:
2480224802
sse_subscription_url:
2480324803
type: string
2480424804
description: |
24805-
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to complete status.
24805+
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to complete status. When CSAT is enabled and a survey will follow the resolution, `complete` revocation is deferred until the `csat_requested` event is delivered or the token expires.
2480624806
example: 'https://primary-realtime.intercom-messenger.com/event-stream?channels=fin_agent_api:app123:ext-123&accessToken=eyJhbG...&rewind=2m'
2480724807
'400':
2480824808
description: Bad Request
@@ -24977,7 +24977,7 @@ paths:
2497724977
sse_subscription_url:
2497824978
type: string
2497924979
description: |
24980-
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to awaiting_user_reply or complete status.
24980+
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to awaiting_user_reply or complete status. When CSAT is enabled and a survey will follow the resolution, `complete` revocation is deferred until the `csat_requested` event is delivered or the token expires.
2498124981
example: 'https://primary-realtime.intercom-messenger.com/event-stream?channels=fin_agent_api:app123:ext-123&accessToken=eyJhbG...'
2498224982
'400':
2498324983
description: Bad Request
@@ -25162,7 +25162,7 @@ paths:
2516225162
sse_subscription_url:
2516325163
type: string
2516425164
description: |
25165-
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to awaiting_user_reply or complete status.
25165+
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to awaiting_user_reply or complete status. When CSAT is enabled and a survey will follow the resolution, `complete` revocation is deferred until the `csat_requested` event is delivered or the token expires.
2516625166
example: 'https://primary-realtime.intercom-messenger.com/event-stream?channels=fin_agent_api:app123:ext-123&accessToken=eyJhbG...&rewind=2m'
2516725167
'400':
2516825168
description: Bad Request
@@ -25354,7 +25354,7 @@ paths:
2535425354
sse_subscription_url:
2535525355
type: string
2535625356
description: |
25357-
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to complete status. Includes a `rewind` window so a subscriber that connects after the escalation is processed can still receive the `escalated` and `complete` events.
25357+
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to complete status. When CSAT is enabled and a survey will follow the resolution, `complete` revocation is deferred until the `csat_requested` event is delivered or the token expires. Includes a `rewind` window so a subscriber that connects after the escalation is processed can still receive the `escalated` and `complete` events.
2535825358
example: 'https://primary-realtime.intercom-messenger.com/event-stream?channels=fin_agent_api:app123:ext-123&accessToken=eyJhbG...&rewind=2m'
2535925359
status:
2536025360
type: string
@@ -25437,6 +25437,156 @@ paths:
2543725437
name: John Doe
2543825438
email: john.doe@example.com
2543925439
message: I need help with my billing issue
25440+
"/fin/csat":
25441+
post:
25442+
summary: Submit a CSAT rating
25443+
parameters:
25444+
- name: Intercom-Version
25445+
in: header
25446+
schema:
25447+
"$ref": "#/components/schemas/intercom_version"
25448+
tags:
25449+
- Fin Agent
25450+
operationId: submitFinCsat
25451+
description: |
25452+
Record a customer's satisfaction rating for a conversation, with an optional free-text
25453+
remark.
25454+
25455+
Fin decides *when* to ask for a rating — this reuses the CSAT settings on your Fin
25456+
workflow, not this API. When Fin asks, it fires a `csat_requested` event over webhooks or
25457+
SSE carrying the rating options to show the user. Present those options, then submit the
25458+
user's choice here.
25459+
25460+
Submitting the same rating again, with no new remark, is a no-op and stays successful,
25461+
so an at-least-once client can safely retry. Submitting a *different* rating updates the
25462+
stored rating while the update window is still open, and a first remark can be added to
25463+
an already-rated survey. Once a remark has been recorded the rating is locked and can no
25464+
longer be changed.
25465+
responses:
25466+
'200':
25467+
description: Rating recorded successfully
25468+
content:
25469+
application/json:
25470+
examples:
25471+
Successful response:
25472+
value:
25473+
conversation_id: ext-123
25474+
rating: amazing
25475+
status: rated
25476+
schema:
25477+
type: object
25478+
properties:
25479+
conversation_id:
25480+
type: string
25481+
description: The external ID of the rated conversation.
25482+
example: ext-123
25483+
rating:
25484+
type: string
25485+
enum:
25486+
- terrible
25487+
- bad
25488+
- ok
25489+
- good
25490+
- amazing
25491+
description: The rating now recorded on the conversation.
25492+
example: amazing
25493+
status:
25494+
type: string
25495+
enum:
25496+
- rated
25497+
description: The result of the submission.
25498+
example: rated
25499+
'401':
25500+
description: Unauthorized
25501+
content:
25502+
application/json:
25503+
examples:
25504+
Unauthorized:
25505+
value:
25506+
type: error.list
25507+
request_id: b68959ea-6328-4f70-83cb-e7913dba1542
25508+
errors:
25509+
- code: unauthorized
25510+
message: Access Token Invalid
25511+
schema:
25512+
"$ref": "#/components/schemas/error"
25513+
'422':
25514+
description: |
25515+
The rating could not be recorded. Common causes: no conversation exists for the given
25516+
`conversation_id`, Fin never requested a rating for it, the rating window has closed,
25517+
the rating is locked because a remark was already submitted, or `rating` is not one of
25518+
the supported values.
25519+
content:
25520+
application/json:
25521+
examples:
25522+
Conversation not found:
25523+
value:
25524+
errors:
25525+
external_conversation_id: Conversation not found for the given external_conversation_id
25526+
No rating requested:
25527+
value:
25528+
errors:
25529+
base: No rating survey found for this conversation
25530+
Rating window closed:
25531+
value:
25532+
errors:
25533+
base: The rating window for this conversation has closed
25534+
Rating locked by a remark:
25535+
value:
25536+
errors:
25537+
base: This rating can no longer be changed because a remark has already been submitted
25538+
Invalid rating:
25539+
value:
25540+
errors:
25541+
rating: Rating isn't an option
25542+
schema:
25543+
type: object
25544+
properties:
25545+
errors:
25546+
type: object
25547+
description: Validation messages keyed by the field they apply to, or `base` for conversation-level failures.
25548+
example:
25549+
base: The rating window for this conversation has closed
25550+
additionalProperties:
25551+
type: string
25552+
requestBody:
25553+
required: true
25554+
content:
25555+
application/json:
25556+
schema:
25557+
type: object
25558+
properties:
25559+
conversation_id:
25560+
type: string
25561+
description: Your external conversation ID — the same ID you started the conversation with, and the one echoed on the `csat_requested` event.
25562+
example: ext-123
25563+
rating:
25564+
type: string
25565+
enum:
25566+
- terrible
25567+
- bad
25568+
- ok
25569+
- good
25570+
- amazing
25571+
description: The rating the user selected — one of the `key` values from the `csat_requested` event's options.
25572+
example: amazing
25573+
remark:
25574+
type: string
25575+
description: Optional free-text comment the user left alongside the rating. Can be added to an already-rated survey, but only once — the rating locks after a remark is recorded.
25576+
example: Fin solved my problem in seconds.
25577+
required:
25578+
- conversation_id
25579+
- rating
25580+
examples:
25581+
Submit a rating:
25582+
value:
25583+
conversation_id: ext-123
25584+
rating: amazing
25585+
Submit a rating with a remark:
25586+
value:
25587+
conversation_id: ext-123
25588+
rating: amazing
25589+
remark: Fin solved my problem in seconds.
2544025590
"/fin/start":
2544125591
post:
2544225592
summary: Start a conversation with Fin
@@ -25525,7 +25675,7 @@ paths:
2552525675
sse_subscription_url:
2552625676
type: string
2552725677
description: |
25528-
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to awaiting_user_reply or complete status.
25678+
Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to awaiting_user_reply or complete status. When CSAT is enabled and a survey will follow the resolution, `complete` revocation is deferred until the `csat_requested` event is delivered or the token expires.
2552925679
example: 'https://primary-realtime.intercom-messenger.com/event-stream?channels=fin_agent_api:app123:ext-123&accessToken=eyJhbG...&rewind=2m'
2553025680
'400':
2553125681
description: Bad Request
@@ -36165,7 +36315,7 @@ components:
3616536315
- awaiting_user_reply: Fin has finished replying and is waiting for the user to respond
3616636316
- escalated: The conversation has been escalated to a human
3616736317
- resolved: The user's query has been resolved
36168-
- complete: Fin has completed its workflow
36318+
- complete: Fin has completed its workflow. When CSAT is enabled a csat_requested event may follow, in which case the SSE stream is held open past complete until it is delivered or the token expires
3616936319
example: escalated
3617036320
reason:
3617136321
type: string
@@ -36327,6 +36477,97 @@ components:
3632736477
- chunk_index
3632836478
- chunk_text
3632936479
- created_at_ms
36480+
fin_agent_csat_requested_event:
36481+
title: Fin Agent CSAT Requested Event
36482+
type: object
36483+
description: |
36484+
Event fired when Fin asks the user to rate the conversation.
36485+
Delivered via webhooks or SSE. Carries the rating options to present to the user; submit
36486+
the user's choice with POST /fin/csat. Unlike the reply events it has no message — a
36487+
rating survey is a set of options to choose from, not readable text.
36488+
Over SSE this event arrives after Fin reaches 'complete'. Because a survey is expected,
36489+
'complete' does not close the stream: the connection is held open so this event can be
36490+
delivered, and the token is revoked once it is sent.
36491+
x-tags:
36492+
- Fin Agent
36493+
properties:
36494+
event_name:
36495+
type: string
36496+
enum:
36497+
- csat_requested
36498+
description: The name of the event.
36499+
example: csat_requested
36500+
conversation_id:
36501+
type: string
36502+
description: The ID of the conversation.
36503+
example: '123456'
36504+
user_id:
36505+
type: string
36506+
description: The ID of the user.
36507+
example: '7891'
36508+
csat:
36509+
type: object
36510+
description: The rating survey to present to the user.
36511+
example:
36512+
options:
36513+
- key: good
36514+
emoji: "😃"
36515+
label: Great
36516+
- key: amazing
36517+
emoji: "🤩"
36518+
label: Amazing
36519+
properties:
36520+
options:
36521+
type: array
36522+
description: The ordered rating options to show the user.
36523+
example:
36524+
- key: good
36525+
emoji: "😃"
36526+
label: Great
36527+
- key: amazing
36528+
emoji: "🤩"
36529+
label: Amazing
36530+
items:
36531+
type: object
36532+
properties:
36533+
key:
36534+
type: string
36535+
enum:
36536+
- terrible
36537+
- bad
36538+
- ok
36539+
- good
36540+
- amazing
36541+
description: The stable key to send back as 'rating' on POST /fin/csat.
36542+
example: amazing
36543+
emoji:
36544+
type: string
36545+
description: The emoji representing this rating.
36546+
example: "🤩"
36547+
label:
36548+
type: string
36549+
description: |
36550+
The human-readable label for this rating, localised to the conversation's
36551+
detected language. Distinct from 'key' — display the label, but send back
36552+
the key.
36553+
example: Amazing
36554+
required:
36555+
- key
36556+
- emoji
36557+
- label
36558+
required:
36559+
- options
36560+
created_at_ms:
36561+
type: string
36562+
format: date-time
36563+
description: The timestamp the event was created at, with millisecond precision.
36564+
example: '2025-01-24T10:00:00.123Z'
36565+
required:
36566+
- event_name
36567+
- conversation_id
36568+
- user_id
36569+
- csat
36570+
- created_at_ms
3633036571
file_attribute:
3633136572
title: File
3633236573
type: object
@@ -40763,7 +41004,7 @@ tags:
4076341004

4076441005
 
4076541006

40766-
Orchestrate Fin from your own agent: discover what Fin can do with `/fin/capabilities`, ask a one-shot question with `/fin/ask`, run a specific procedure with `/fin/procedures/{procedure_id}/run`, continue a conversation with `/fin/reply`, and escalate to a human with `/fin/escalate`. Fin notifies your application of its status and responses through a set of events, delivered via webhooks or Server-Sent Events (SSE).
41007+
Orchestrate Fin from your own agent: discover what Fin can do with `/fin/capabilities`, ask a one-shot question with `/fin/ask`, run a specific procedure with `/fin/procedures/{procedure_id}/run`, continue a conversation with `/fin/reply`, escalate to a human with `/fin/escalate`, and record a satisfaction rating with `/fin/csat`. Fin notifies your application of its status and responses through a set of events, delivered via webhooks or Server-Sent Events (SSE).
4076741008

4076841009
 
4076941010

@@ -40778,6 +41019,7 @@ tags:
4077841019
- `fin_status_updated` - Fired when Fin's status changes (awaiting_user_reply, escalated, resolved, complete)
4077941020
- `fin_replied` - Fired when Fin sends a reply to the user
4078041021
- `fin_reply_chunk` - SSE-only streaming event fired during reply generation (requires streaming enabled)
41022+
- `csat_requested` - Fired when Fin asks the user to rate the conversation (submit the choice with `POST /fin/csat`)
4078141023

4078241024
All webhook requests include an `X-Fin-Agent-API-Webhook-Signature` header for request validation.
4078341025
- name: Help Center

0 commit comments

Comments
 (0)