---
# @generated by sylphx-gen 0.1.0 from contracts@e145cc7cf1bc9605f2b27439e5e17ed76a1a2fd7e7021906a013f7565e4a0cd5. Do not edit.
title: "Capture an error group"
description: "`observability.error_groups.capture` (POST /v1/{parent}/error_groups:capture): Captures one error occurrence."
type: reference
product: monitoring
summary: "Captures one error occurrence."
updated: 2026-09-28
nav: false
---

Captures one error occurrence. It is grouped by `fingerprint` when the caller sets one, else by exception type and the symbolicated in-app stack; release is never part of the group. A new occurrence reopens a resolved group. Secrets and personal data are scrubbed by the environment's Scrubbing Policy before storage. A fingerprint-equal replay bills no second new-error unit. Under quota pressure the response says what to sample. Browsers call it with a publishable key that holds `observability:ingest` (CORS allowed, rate-limited per environment).

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

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `parent` | `string` | The parent the method acts in. Required. |
| `error_event` | `ErrorEvent` | The occurrence; only record fields are read. Required. |

### ErrorEvent

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | `orgs/{org}/projects/{project}/envs/{env}/error_groups/{error_group}/error_events/{error_event}`. |
| `meta` | `ResourceMeta` | Resource metadata. |
| `event_time` | `timestamp` | When it happened. Required. |
| `exception_type` | `string` | The exception type. Required. |
| `message` | `string` | The exception message. |
| `stack_frames` | `StackFrame[]` | Stack frames, innermost last. |
| `service_name` | `string` | The emitting service. |
| `release` | `string` | The release the emitter ran. |
| `breadcrumbs` | `Breadcrumb[]` | Breadcrumbs before the error, oldest first, at most 100. |
| `tags` | `map<string, string>` | Typed tags, at most 64. |
| `fingerprint` | `string` | Override the grouping fingerprint. |
| `trace_id` | `string` | W3C trace id (32 hex). |
| `span_id` | `string` | W3C span id (16 hex). |
| `stack` | `string` | The stack as the runtime printed it (JavaScript `Error.stack`), at most 64 KiB. When `stack_frames` is empty, V8 (`at fn (file:line:col)`) and Gecko/WebKit (`fn@file:line:col`) lines are parsed into `stack_frames`, innermost last; when `stack_frames` is set, it wins and `stack` is kept as sent. Either way the frames are then mapped through the source maps uploaded for `release` before grouping. Scrubbed before storage. |

### ResourceMeta

| Field | Type | What it is |
| --- | --- | --- |
| `labels` | `map<string, string>` | Caller-writable, indexed labels (AIP-122 label rules). |
| `annotations` | `map<string, string>` | Caller-writable, unindexed annotations. |
| `display_name` | `string` | Caller-writable human-readable name. |

### StackFrame

| Field | Type | What it is |
| --- | --- | --- |
| `function_name` | `string` | The function. |
| `file_path` | `string` | The file or module. |
| `line` | `int32` | The line, from 1. |
| `column` | `int32` | The column, from 1. |
| `app_frame` | `bool` | Whether the frame is the customer's own code. |

### Breadcrumb

| Field | Type | What it is |
| --- | --- | --- |
| `event_time` | `timestamp` | When it happened. Required. |
| `category` | `string` | A category, for example `http` or `navigation`. |
| `message` | `string` | The message. |
| `severity` | `LogSeverity` | The severity. One of `trace`, `debug`, `info`, `warn`, `error`, `fatal`. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `error_event` | `ErrorEvent` | The stored occurrence. |
| `sample_rate` | `double` | Keep this fraction of later occurrences, 0 to 1; 1 when no pressure. |

### ErrorEvent

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | `orgs/{org}/projects/{project}/envs/{env}/error_groups/{error_group}/error_events/{error_event}`. |
| `uid` | `string` | `err_<cell><ulid>`; never reused. Output only. |
| `meta` | `ResourceMeta` | Resource metadata. |
| `event_time` | `timestamp` | When it happened. Required. |
| `exception_type` | `string` | The exception type. Required. |
| `message` | `string` | The exception message. |
| `stack_frames` | `StackFrame[]` | Stack frames, innermost last. |
| `service_name` | `string` | The emitting service. |
| `release` | `string` | The release the emitter ran. |
| `breadcrumbs` | `Breadcrumb[]` | Breadcrumbs before the error, oldest first, at most 100. |
| `tags` | `map<string, string>` | Typed tags, at most 64. |
| `fingerprint` | `string` | Override the grouping fingerprint. |
| `trace_id` | `string` | W3C trace id (32 hex). |
| `span_id` | `string` | W3C span id (16 hex). |
| `stack` | `string` | The stack as the runtime printed it (JavaScript `Error.stack`), at most 64 KiB. When `stack_frames` is empty, V8 (`at fn (file:line:col)`) and Gecko/WebKit (`fn@file:line:col`) lines are parsed into `stack_frames`, innermost last; when `stack_frames` is set, it wins and `stack` is kept as sent. Either way the frames are then mapped through the source maps uploaded for `release` before grouping. Scrubbed before storage. |

### ResourceMeta

| Field | Type | What it is |
| --- | --- | --- |
| `generation` | `int64` | Increases by one on every change to `spec`. Output only. |
| `etag` | `string` | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as `If-Match` or `etag` to make Update and Delete conditional; a mismatch fails with ABORTED / 409 `ETAG_MISMATCH`. Output only. |
| `create_time` | `timestamp` | When the Resource was created. Output only. |
| `update_time` | `timestamp` | When the Resource last changed. Output only. |
| `delete_time` | `timestamp` | Set while the Resource is being deleted. Output only. |
| `labels` | `map<string, string>` | Caller-writable, indexed labels (AIP-122 label rules). |
| `annotations` | `map<string, string>` | Caller-writable, unindexed annotations. |
| `display_name` | `string` | Caller-writable human-readable name. |
| `creator` | `string` | The principal that created the Resource. Output only. |

### StackFrame

| Field | Type | What it is |
| --- | --- | --- |
| `function_name` | `string` | The function. |
| `file_path` | `string` | The file or module. |
| `line` | `int32` | The line, from 1. |
| `column` | `int32` | The column, from 1. |
| `app_frame` | `bool` | Whether the frame is the customer's own code. |

### Breadcrumb

| Field | Type | What it is |
| --- | --- | --- |
| `event_time` | `timestamp` | When it happened. Required. |
| `category` | `string` | A category, for example `http` or `navigation`. |
| `message` | `string` | The message. |
| `severity` | `LogSeverity` | The severity. One of `trace`, `debug`, `info`, `warn`, `error`, `fatal`. |

## 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.
- [`RATE_LIMITED`](/docs/api/errors/RATE_LIMITED) — The rate limit is reached; see Retry-After.
- [`SPEND_LIMIT_REACHED`](/docs/api/errors/SPEND_LIMIT_REACHED) — The org's spend limit is reached.

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/error_groups:capture" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"error_event":{"event_time":{},"exception_type":"…"}}'
```

**TypeScript**

```ts
const response = await sylphx.observability.errorGroups.capture({ errorEvent: { eventTime: {}, exceptionType: '…' }, parent: 'orgs/acme/projects/shop/envs/production' })
```

**Rust**

```rust
let mut req = sylphx::observability::CaptureErrorRequest::default();
req.error_event = Some(sylphx::observability::ErrorEvent {
    event_time: Some(Default::default()),
    exception_type: "…".to_string(),
    ..Default::default()
});
req.parent = "orgs/acme/projects/shop/envs/production".to_string();
let response = sx.observability().error_groups().capture(req).await?;
```

**CLI**

```bash
sylphx observability error-groups capture orgs/acme/projects/shop/envs/production
```

**MCP**

```json
{ "method_id": "observability.error_groups.capture", "args": {"error_event":{"event_time":{},"exception_type":"…"},"parent":"orgs/acme/projects/shop/envs/production"} }
```
