# Get trace funnels

URL: https://docs.hanzo.ai/docs/openapi/o11y/gettracefunnel

> Returns one funnel with its steps.

`GET /v1/o11y/trace-funnels/{funnel_id}`

> [O11y →](https://docs.hanzo.ai/docs/openapi/o11y) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                          |
| ------------- | -------------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/o11y/trace-funnels/{funnel_id}` |
| **Method**    | `GET`                                                    |
| **Operation** | `GetTraceFunnel`                                         |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                   |

Returns one funnel with its steps.

Callers need the viewer role; the runtime's own gate enforces it.

## Request

1 field.

| Field       | In   | Type   | Required | Description |
| ----------- | ---- | ------ | -------- | ----------- |
| `funnel_id` | path | string | yes      |             |

## Response

| Status    | Body               | Meaning           |
| --------- | ------------------ | ----------------- |
| `200`     | o11y.O11yFunnelOut | ok                |
| `202`     | Approval           | held for approval |
| `default` | problem-details    | refused           |

`200` body — 72 fields.

| Field                                              | In   | Type                | Always | Description          |
| -------------------------------------------------- | ---- | ------------------- | ------ | -------------------- |
| `data`                                             | body | o11y.GettableFunnel | —      |                      |
| `data.created_at`                                  | body | integer (int64)     | —      |                      |
| `data.created_by`                                  | body | string              | —      |                      |
| `data.description`                                 | body | string              | —      |                      |
| `data.funnel`                                      | body | o11y.StorableFunnel | —      |                      |
| `data.funnel.createdAt`                            | body | string (date-time)  | —      |                      |
| `data.funnel.createdBy`                            | body | string              | —      |                      |
| `data.funnel.description`                          | body | string              | —      |                      |
| `data.funnel.funnel_name`                          | body | string              | —      |                      |
| `data.funnel.id`                                   | body | any                 | —      |                      |
| `data.funnel.org_id`                               | body | any                 | —      |                      |
| `data.funnel.steps`                                | body | o11y.FunnelStep\[]  | —      |                      |
| `data.funnel.steps[].description`                  | body | string              | —      | step description     |
| `data.funnel.steps[].filters`                      | body | o11y.FilterSet      | —      |                      |
| `data.funnel.steps[].filters.items`                | body | o11y.FilterItem\[]  | —      |                      |
| `data.funnel.steps[].filters.items[].key`          | body | o11y.AttributeKey   | —      |                      |
| `data.funnel.steps[].filters.items[].key.dataType` | body | string              | —      |                      |
| `data.funnel.steps[].filters.items[].key.isColumn` | body | boolean             | —      |                      |
| `data.funnel.steps[].filters.items[].key.isJSON`   | body | boolean             | —      |                      |
| `data.funnel.steps[].filters.items[].key.key`      | body | string              | —      |                      |
| `data.funnel.steps[].filters.items[].key.type`     | body | string              | —      |                      |
| `data.funnel.steps[].filters.items[].op`           | body | string              | —      |                      |
| `data.funnel.steps[].filters.items[].value`        | body | any                 | —      |                      |
| `data.funnel.steps[].filters.op`                   | body | string              | —      |                      |
| `data.funnel.steps[].has_errors`                   | body | boolean             | —      |                      |
| `data.funnel.steps[].id`                           | body | any                 | —      |                      |
| `data.funnel.steps[].latency_pointer`              | body | string              | —      |                      |
| `data.funnel.steps[].latency_type`                 | body | string              | —      |                      |
| `data.funnel.steps[].name`                         | body | string              | —      | step name            |
| `data.funnel.steps[].service_name`                 | body | string              | —      |                      |
| `data.funnel.steps[].span_name`                    | body | string              | —      |                      |
| `data.funnel.steps[].step_order`                   | body | integer (int64)     | —      |                      |
| `data.funnel.tags`                                 | body | string              | —      |                      |
| `data.funnel.updatedAt`                            | body | string (date-time)  | —      |                      |
| `data.funnel.updatedBy`                            | body | string              | —      |                      |
| `data.funnel.user`                                 | body | o11y.User           | —      |                      |
| `data.funnel.user.createdAt`                       | body | string (date-time)  | —      |                      |
| `data.funnel.user.displayName`                     | body | string              | —      |                      |
| `data.funnel.user.email`                           | body | any                 | —      |                      |
| `data.funnel.user.id`                              | body | any                 | —      |                      |
| `data.funnel.user.isRoot`                          | body | boolean             | —      |                      |
| `data.funnel.user.orgId`                           | body | any                 | —      |                      |
| `data.funnel.user.status`                          | body | any                 | —      |                      |
| `data.funnel.user.updatedAt`                       | body | string (date-time)  | —      |                      |
| `data.funnel_id`                                   | body | string              | —      |                      |
| `data.funnel_name`                                 | body | string              | —      |                      |
| `data.org_id`                                      | body | string              | —      |                      |
| `data.steps`                                       | body | o11y.FunnelStep\[]  | —      |                      |
| `data.steps[].description`                         | body | string              | —      | step description     |
| `data.steps[].filters`                             | body | o11y.FilterSet      | —      |                      |
| `data.steps[].filters.items`                       | body | o11y.FilterItem\[]  | —      |                      |
| `data.steps[].filters.items[].key`                 | body | o11y.AttributeKey   | —      |                      |
| `data.steps[].filters.items[].key.dataType`        | body | string              | —      |                      |
| `data.steps[].filters.items[].key.isColumn`        | body | boolean             | —      |                      |
| `data.steps[].filters.items[].key.isJSON`          | body | boolean             | —      |                      |
| `data.steps[].filters.items[].key.key`             | body | string              | —      |                      |
| `data.steps[].filters.items[].key.type`            | body | string              | —      |                      |
| `data.steps[].filters.items[].op`                  | body | string              | —      |                      |
| `data.steps[].filters.items[].value`               | body | any                 | —      |                      |
| `data.steps[].filters.op`                          | body | string              | —      |                      |
| `data.steps[].has_errors`                          | body | boolean             | —      |                      |
| `data.steps[].id`                                  | body | any                 | —      |                      |
| `data.steps[].latency_pointer`                     | body | string              | —      |                      |
| `data.steps[].latency_type`                        | body | string              | —      |                      |
| `data.steps[].name`                                | body | string              | —      | step name            |
| `data.steps[].service_name`                        | body | string              | —      |                      |
| `data.steps[].span_name`                           | body | string              | —      |                      |
| `data.steps[].step_order`                          | body | integer (int64)     | —      |                      |
| `data.updated_at`                                  | body | integer (int64)     | —      |                      |
| `data.updated_by`                                  | body | string              | —      |                      |
| `data.user_email`                                  | body | string              | —      |                      |
| `status`                                           | body | string              | —      | Status is "success". |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo o11y trace-funnels get <funnel_id>
```

**SDK**

**.ts**

```ts
import { Configuration, O11yApi } from 'hanzoai';

const api = new O11yApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getTraceFunnel({ funnel_id: 'funnel_id' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import O11yApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = O11yApi(client).get_trace_funnel(funnel_id='funnel_id')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.O11yAPI.GetTraceFunnel(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, o11y_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = o11y_api::get_trace_funnel(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.O11yApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new O11yApi(client).getTraceFunnel();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/o11y/trace-funnels/<funnel_id> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `o11y`, op `GetTraceFunnel` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "o11y",
         "arguments": {
           "op": "GetTraceFunnel",
           "input": {
             "funnel_id": "<funnel_id>"
           }
         }
       }
     }'
```

---

[O11y API](https://docs.hanzo.ai/docs/openapi/o11y) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
