Skip to content

Commit 2bb9258

Browse files
Add live example to webhook-payload-snippet and align with endpoint-schema-snippet
(#5452) Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 34839f7 commit 2bb9258

3 files changed

Lines changed: 89 additions & 6 deletions

File tree

fern/apis/fai/openapi.json

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4423,7 +4423,7 @@
44234423
}
44244424
],
44254425
"title": "Previous Version",
4426-
"description": "The current published version before this change, e.g. '1.2.3'. Provided for context only not included in the commit message.",
4426+
"description": "The current published version before this change, e.g. '1.2.3'. Provided for context only \u2014 not included in the commit message.",
44274427
"default": null
44284428
},
44294429
"prior_changelog": {
@@ -7578,5 +7578,76 @@
75787578
"url": "http://localhost:8080",
75797579
"x-fern-server-name": "Local"
75807580
}
7581-
]
7582-
}
7581+
],
7582+
"webhooks": {
7583+
"conversation-completed": {
7584+
"post": {
7585+
"operationId": "on-conversation-completed",
7586+
"summary": "Conversation completed",
7587+
"description": "Sent when an Ask Fern conversation finishes. Use this to log analytics, sync transcripts, or trigger follow-up workflows.",
7588+
"tags": [
7589+
"Scribe webhooks"
7590+
],
7591+
"x-fern-audiences": [
7592+
"customers"
7593+
],
7594+
"requestBody": {
7595+
"description": "Payload describing the completed conversation.",
7596+
"content": {
7597+
"application/json": {
7598+
"schema": {
7599+
"type": "object",
7600+
"properties": {
7601+
"event": {
7602+
"type": "string",
7603+
"description": "The type of event.",
7604+
"example": "conversation.completed"
7605+
},
7606+
"conversationId": {
7607+
"type": "string",
7608+
"description": "Unique identifier for the conversation.",
7609+
"example": "conv_01HMT8X9PZ4QY6F7A2B3C4D5E6"
7610+
},
7611+
"domain": {
7612+
"type": "string",
7613+
"description": "The domain the conversation took place on.",
7614+
"example": "buildwithfern.com"
7615+
},
7616+
"messageCount": {
7617+
"type": "integer",
7618+
"description": "Total number of messages exchanged.",
7619+
"example": 6
7620+
},
7621+
"completedAt": {
7622+
"type": "string",
7623+
"format": "date-time",
7624+
"description": "Timestamp when the conversation completed.",
7625+
"example": "2026-05-11T14:23:07.000Z"
7626+
}
7627+
},
7628+
"required": [
7629+
"event",
7630+
"conversationId",
7631+
"domain",
7632+
"completedAt"
7633+
],
7634+
"example": {
7635+
"event": "conversation.completed",
7636+
"conversationId": "conv_01HMT8X9PZ4QY6F7A2B3C4D5E6",
7637+
"domain": "buildwithfern.com",
7638+
"messageCount": 6,
7639+
"completedAt": "2026-05-11T14:23:07.000Z"
7640+
}
7641+
}
7642+
}
7643+
}
7644+
},
7645+
"responses": {
7646+
"200": {
7647+
"description": "Return a 2xx status to acknowledge receipt."
7648+
}
7649+
}
7650+
}
7651+
}
7652+
}
7653+
}

fern/products/docs/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ navigation:
509509
hidden: true
510510
- website:
511511
hidden: true
512+
- scribeWebhooks:
513+
hidden: true
512514
# must be included to use the schema component
513515
- api: API reference
514516
api-name: docs-yml

fern/products/docs/pages/component-library/default-components/webhook-payload-snippet.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ description: Reference a webhook payload from your API Reference to display exam
44
---
55

66

7-
Use the `<WebhookPayloadSnippet>` component to reference a webhook payload from your API Reference.
7+
The `<WebhookPayloadSnippet>` component displays a webhook's request payload schema from your API Reference. It renders the same fields, types, and example values that appear on the webhook's full API Reference page, so readers can inspect the payload inline alongside your prose.
8+
9+
To display the schema for a regular HTTP endpoint, use the [`<EndpointSchemaSnippet>`](/learn/docs/writing-content/components/endpoint-schema-snippet) component.
810

911
## Usage
1012

13+
Reference a webhook by its `operationId`.
14+
15+
<div className="highlight-frame">
16+
<div className="highlight-frame-content">
17+
<WebhookPayloadSnippet webhook="on-conversation-completed" />
18+
</div>
19+
</div>
20+
1121
```jsx Markdown
12-
<WebhookPayloadSnippet webhook="on-order-created" />
22+
<WebhookPayloadSnippet webhook="on-conversation-completed" />
1323
```
1424

1525
## Properties
1626

1727
<ParamField path="webhook" type="string" required={true}>
18-
The operation ID of the webhook to display.
28+
The `operationId` of the webhook to display. If your API uses [namespaces](/learn/api-definitions/overview/project-structure#combined-sdks-from-multiple-apis), prefix with the namespace and `::` (e.g., `payments::on-payment-succeeded`).
1929
</ParamField>

0 commit comments

Comments
 (0)