You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/apis/api/openapi.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10172,6 +10172,10 @@
10172
10172
"metadata": {
10173
10173
"type": "object",
10174
10174
"description": "This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. https://langfuse.com/docs/tracing-features/metadata\nBy default it includes the call metadata, assistant metadata, and assistant overrides."
10175
+
},
10176
+
"traceName": {
10177
+
"type": "string",
10178
+
"description": "Custom name for the Langfuse trace. Supports Liquid templates with the following variables: {{ call.id }} (call UUID), {{ call.type }} (inboundPhoneCall, outboundPhoneCall, webCall), {{ assistant.name }} (assistant display name), {{ assistant.id }} (assistant UUID). Example: '{{ assistant.name }} - {{ call.type }}'. Defaults to the call ID if not provided or if template rendering fails."
1.**Custom Trace Names for Langfuse**: You can now customize Langfuse trace names using the new `traceName` field in [`LangfuseObservabilityPlan`](https://api.vapi.ai/api#:~:text=LangfuseObservabilityPlan). Instead of raw call IDs, use [Liquid templates](https://shopify.github.io/liquid/) with variables like `{{ assistant.name }}` and `{{ call.type }}` to create descriptive, filterable trace names. If `traceName` is not set or a template error occurs, traces fall back to the call ID. See the [Langfuse integration guide](/providers/observability/langfuse) for details.
By default, Langfuse traces are named using the raw call ID. You can customize trace names using the [`assistant.observabilityPlan.traceName`](/api-reference/assistants/create#request.body.observabilityPlan.traceName) field to make traces easier to identify and filter in your Langfuse dashboard.
119
+
120
+
The `traceName` field supports [Liquid templates](https://shopify.github.io/liquid/), allowing you to dynamically construct trace names from call and assistant data.
121
+
122
+
### Available Template Variables
123
+
124
+
| Variable | Description | Example Value |
125
+
| --- | --- | --- |
126
+
|`{{ call.id }}`| The unique call UUID |`3f4e5a6b-...`|
127
+
|`{{ call.type }}`| The type of call |`inboundPhoneCall`, `outboundPhoneCall`, `webCall`|
128
+
|`{{ assistant.name }}`| The assistant's display name |`Customer Support Bot`|
129
+
|`{{ assistant.id }}`| The assistant's unique ID |`a1b2c3d4-...`|
130
+
131
+
### Examples
132
+
133
+
**Simple assistant name prefix:**
134
+
```
135
+
{{ assistant.name }} - {{ call.type }}
136
+
```
137
+
Produces: `Customer Support Bot - inboundPhoneCall`
138
+
139
+
**Call type grouping:**
140
+
```
141
+
{{ call.type }}/{{ assistant.name }}
142
+
```
143
+
Produces: `outboundPhoneCall/Sales Assistant`
144
+
145
+
**Include call ID for uniqueness:**
146
+
```
147
+
{{ assistant.name }} ({{ call.id }})
148
+
```
149
+
Produces: `Customer Support Bot (3f4e5a6b-...)`
150
+
151
+
### API Configuration
152
+
153
+
You can set the `traceName` field when creating or updating an assistant:
If `traceName` is not provided, traces default to using the call ID. If a template rendering error occurs, the trace name also falls back safely to the call ID.
0 commit comments