---
# @generated by sylphx-gen. Do not edit.
title: "Write a wide event"
description: "`observability.wide_events.write` (POST /v1/{parent}/wide_events:write): Atomically admits a batch of scrubbed wide events."
type: reference
product: monitoring
summary: "Atomically admits a batch of scrubbed wide events."
nav: false
---

Atomically admits a batch of scrubbed wide events. An existing causal identity with a different payload is a conflict, not a second event.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/wide_events:write`
- **Scope** `observability:ingest`
- **Effect** `write` — a successful call changes state.
- **Collection** [wide_events](/docs/api/wide_events)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `parent` | `string` | Resource name of the environment that owns the evidence. Required. |
| `wide_events` | `WideEvent[]` | Canonical wide event records. Required. |

### WideEvent

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | Resource name, assigned by Observe. |
| `schema` | `string` | Exactly sylphx.wide_event.v1. Required. |
| `ts_utc` | `timestamp` | Time the unit of work completed. Required. |
| `trace_id` | `string` | Nonzero lowercase W3C hex identifiers. The parent is empty for a root. Required. |
| `span_id` | `string` | W3C identifier of this span, or this downstream leg. Required. |
| `parent_span_id` | `string` | Parent W3C span; empty at the root. |
| `request_id` | `string` | The opaque request correlation ID. Required. |
| `service` | `string` | Emitting service. Required. |
| `env_id` | `string` | Tenant IDs come from the verified grant; supplied values must agree. |
| `release_sha` | `string` | Full hexadecimal Git revision of the emitting release. Required. |
| `org_id` | `string` | Organization whose verified grant owns the evidence. |
| `project_id` | `string` | Project whose verified grant owns the evidence. |
| `actor_id` | `string` | Opaque actor ID; never contact data or credentials. |
| `weight` | `float` | Inverse probability of inclusion; one for unsampled or forced-kept rows. Required. |
| `host` | `string` | Effective hostname without scheme, path, userinfo, or port. |
| `http_method` | `string` | HTTP method, when this work serves a request. |
| `route_template` | `string` | Matched router template, never a concrete URL or its query. |
| `status_code` | `int32` | HTTP response status for the unit of work. |
| `error_code` | `string` | Machine-readable failure class. |
| `error_reason` | `string` | Bounded, scrubbed diagnostic context for the failure. |
| `latency_ms` | `double` | Elapsed work or leg time in milliseconds. |
| `upstream_status` | `int32` | HTTP status from the upstream dependency, if available. |
| `pool_wait_ms` | `double` | Time waiting for pooled capacity in milliseconds. |
| `downstream_legs` | `WideEventLeg[]` | Bounded list of observed downstream calls. |
| `ai_provider` | `string` | AI provider used by the request. |
| `ai_model` | `string` | Model the provider served. |
| `ttft_ms` | `double` | Time to first token in milliseconds. |
| `tokens_in` | `uint64` | Input token count. |
| `tokens_out` | `uint64` | Output token count. |
| `stream_stall_ms` | `double` | Observed stream stall duration in milliseconds. |
| `tool_fail_code` | `string` | Machine-readable AI tool failure code. |
| `fallback_triggered` | `bool` | Whether a fallback execution path ran. |
| `locale` | `string` | Locale selected for the interaction. |
| `cwv_lcp_ms` | `double` | Largest Contentful Paint in milliseconds. |
| `cwv_cls` | `double` | Unitless cumulative layout shift. |
| `cwv_inp_ms` | `double` | Interaction to Next Paint in milliseconds. |
| `hydration_drift` | `bool` | Whether the server and browser hydration diverged. |
| `app_slug` | `string` | Application slug used to join commercial or UX evidence. |
| `money_intent_id` | `string` | Opaque Money intent identifier. |
| `checkout_session_id` | `string` | Opaque checkout session identifier. |
| `amount_minor` | `int64` | Monetary amount in the currency's minor unit. |
| `currency` | `string` | Three-letter ISO 4217 currency code. |
| `experiment_id` | `string` | Opaque experiment identifier. |
| `attribution_id` | `string` | Opaque attribution join ID, not raw click or customer data. |
| `metered_cash_burn_usd` | `double` | Measured cash burn in US dollars. |
| `prepaid_pool_headroom` | `double` | Remaining prepaid capacity in the source meter's units. |
| `vendor_wallet_usd` | `double` | Observed vendor wallet balance in US dollars. |
| `root_cause_span_id` | `string` | W3C span identified by causal analysis. |
| `top_divergent_dims` | `WideEventDimension[]` | Bounded ranked dimension evidence reported with this event. |
| `actuator_action` | `string` | Action taken for the anomaly, when applicable. |
| `flight_recorder_tail` | `WideEventLeg[]` | Bounded causal prefix accompanying a failed unit of work. |

### WideEventLeg

| Field | Type | What it is |
| --- | --- | --- |
| `service` | `string` | Service that emitted the evidence or handled the downstream call. Required. |
| `span_id` | `string` | W3C identifier of this span, or this downstream leg. |
| `request_id` | `string` | Opaque request correlation identifier; not an idempotency key. |
| `latency_ms` | `double` | Elapsed work or leg time in milliseconds. |
| `upstream_status` | `int32` | HTTP status from the upstream dependency, if available. |

### WideEventDimension

| Field | Type | What it is |
| --- | --- | --- |
| `dim_id` | `uint32` | Stable numeric dimension identifier used by the diff engine. Required. |
| `val_id` | `uint64` | Stable unsigned value identifier within that dimension. Required. |
| `dimension` | `string` | Readable name of the dimension, when available. |
| `value` | `string` | Scrubbed readable value, when available. |
| `js_divergence` | `double` | Jensen–Shannon divergence between the cohorts. |
| `lift` | `double` | Anomalous share divided by baseline share, when defined. |
| `e_value` | `double` | Anytime-valid evidence from the statistical engine, when available. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `admitted_count` | `int32` | Number of records acknowledged, including identical replays. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`IDEMPOTENCY_KEY_REUSED`](/docs/api/errors/IDEMPOTENCY_KEY_REUSED) — An Idempotency-Key was reused with another body.
- [`IDEMPOTENCY_IN_PROGRESS`](/docs/api/errors/IDEMPOTENCY_IN_PROGRESS) — The first call with this Idempotency-Key is still running.
- [`UNAVAILABLE`](/docs/api/errors/UNAVAILABLE) — The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/wide_events:write" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"wide_events":[{"release_sha":"…","request_id":"…","schema":"…","service":"…","span_id":"…","trace_id":"…","ts_utc":{},"weight":1}]}'
```

**TypeScript**

```ts
const response = await sylphx.observability.wideEvents.write({ parent: 'orgs/acme/projects/shop/envs/production', wideEvents: [{ releaseSha: '…', requestId: '…', schema: '…', service: '…', spanId: '…', traceId: '…', tsUtc: {}, weight: 1 }] })
```

**Rust**

```rust
let mut req = sylphx::observability::WriteWideEventsRequest::default();
req.parent = "orgs/acme/projects/shop/envs/production".to_string();
req.wide_events = vec![Default::default()];
let response = sx.observability().wide_events().write(req).await?;
```

**CLI**

```bash
sylphx observability wide-events write orgs/acme/projects/shop/envs/production
```

**MCP**

```json
{ "method_id": "observability.wide_events.write", "args": {"parent":"orgs/acme/projects/shop/envs/production","wide_events":[{"release_sha":"…","request_id":"…","schema":"…","service":"…","span_id":"…","trace_id":"…","ts_utc":{},"weight":1}]} }
```
