# Get traces — GET /v1/o11y/sentinel/traces/{id}

URL: https://docs.hanzo.ai/docs/openapi/o11y/get-o11y-sentinel-traces-by-id

> Returns one trace's captured errors for a project — every error event that carried the trace id, in the order the events plane holds them.

`GET /v1/o11y/sentinel/traces/{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/sentinel/traces/{id}` |
| **Method**    | `GET`                                               |
| **Operation** | `get_o11y_sentinel_traces_by_id`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`              |

Returns one trace's captured errors for a project — every error event
that carried the trace id, in the order the events plane holds them.

## Request

2 fields.

| Field     | In    | Type   | Required | Description                                          |
| --------- | ----- | ------ | -------- | ---------------------------------------------------- |
| `id`      | path  | string | yes      | ID is the trace id.                                  |
| `project` | query | string | yes      | Project is the project the trace's errors belong to. |

## Response

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

`200` body — 35 fields.

| Field                             | In   | Type                 | Always | Description                                                                                           |
| --------------------------------- | ---- | -------------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| `data`                            | body | o11y.O11yTraceDetail | —      |                                                                                                       |
| `data.events`                     | body | o11y.O11yEvent\[]    | —      | Events are the error events carrying the trace id.                                                    |
| `data.events[].culprit`           | body | string               | —      | Culprit is where it came from — the function or route blamed for it.                                  |
| `data.events[].environment`       | body | string               | —      | Environment is the deployment it happened in.                                                         |
| `data.events[].eventId`           | body | string               | —      | EventID is its own id.                                                                                |
| `data.events[].fingerprint`       | body | string               | —      | Fingerprint is the grouping key that puts like errors in one issue.                                   |
| `data.events[].frames`            | body | o11y.O11yFrame\[]    | —      | Frames are the stack, innermost first.                                                                |
| `data.events[].frames[].column`   | body | integer (uint32)     | —      | Column is the column number.                                                                          |
| `data.events[].frames[].file`     | body | string               | —      | File is the file it is in.                                                                            |
| `data.events[].frames[].function` | body | string               | —      | Function is the function the frame is in.                                                             |
| `data.events[].frames[].line`     | body | integer (uint32)     | —      | Line is the line number.                                                                              |
| `data.events[].frames[].own`      | body | boolean              | —      | Own marks a frame in the reporting application's own code rather than in a dependency or the runtime. |
| `data.events[].handled`           | body | boolean              | —      | Handled says whether the application caught it.                                                       |
| `data.events[].level`             | body | string               | —      | Level is its severity, e.g. error, warning, info.                                                     |
| `data.events[].message`           | body | string               | —      | Message is the human-readable message.                                                                |
| `data.events[].orgId`             | body | string               | —      | OrgID is the org that owns it.                                                                        |
| `data.events[].platform`          | body | string               | —      | Platform is the reporting runtime, e.g. go, python, javascript.                                       |
| `data.events[].projectId`         | body | string               | —      | ProjectID is the project it was captured for.                                                         |
| `data.events[].receivedAt`        | body | string (date-time)   | —      | ReceivedAt is when it arrived here.                                                                   |
| `data.events[].release`           | body | string               | —      | Release is the version that produced it.                                                              |
| `data.events[].serverName`        | body | string               | —      | ServerName is the host that reported it.                                                              |
| `data.events[].serviceName`       | body | string               | —      | ServiceName is the service that reported it.                                                          |
| `data.events[].spanId`            | body | string               | —      | SpanID is the span it belonged to.                                                                    |
| `data.events[].tags`              | body | object               | —      | Tags are the reporter's own key/value labels.                                                         |
| `data.events[].tags.*`            | body | string               | —      |                                                                                                       |
| `data.events[].timestamp`         | body | string (date-time)   | —      | Timestamp is when the error happened, as the reporter recorded it.                                    |
| `data.events[].traceId`           | body | string               | —      | TraceID is the trace it belonged to.                                                                  |
| `data.events[].transaction`       | body | string               | —      | Transaction is the operation it happened in.                                                          |
| `data.events[].type`              | body | string               | —      | Type is the exception type.                                                                           |
| `data.events[].userEmail`         | body | string               | —      | UserEmail is that user's email, when attached.                                                        |
| `data.events[].userId`            | body | string               | —      | UserID identifies the affected end user, when the reporter attached one.                              |
| `data.events[].userIp`            | body | string               | —      | UserIP is that user's address, when attached.                                                         |
| `data.events[].value`             | body | string               | —      | Value is the exception value.                                                                         |
| `data.traceId`                    | body | string               | —      | TraceID is the trace that was read.                                                                   |
| `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 sentinel traces get <id> --project <project>
```

**SDK**

**.ts**

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

const api = new O11yApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getO11ySentinelTracesById({ id: 'id', project: 'project' });
```

**.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_o11y_sentinel_traces_by_id(id='id', project='project')
```

**.go**

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

resp, _, err := client.O11yAPI.GetO11ySentinelTracesById(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_o11y_sentinel_traces_by_id(&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).getO11ySentinelTracesById();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/o11y/sentinel/traces/<id>?project=%3Cproject%3E \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **o11y** through the `o11y` tool, which names its 307 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_o11y_autocomplete_aggregate_attributes"
         }
       }
     }'
```

---

[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)
