---
title: "Capture Test Api"
method: POST
path: "/api/capture/test"
---

# Capture Test Api

`POST /api/capture/test`

## Request body

- TestCapturePayload
  - `id` string, nullable
  - `timestamp` string, date-time, nullable
  - `app` string
  - `session` string
  - `hierarchy` EventHierarchyInput — Runtime correlation and grouping context captured with one event.
    - `runtime` RuntimeCorrelation — Runtime identity owned or referenced by one captured event.
      - `trace_id` string, required
      - `span_id` string, required
      - `parent_span_id` string, nullable
      - `role` 'operation' | 'annotation', required
      - `origin` 'smello' | 'otel'
    - `group_memberships` union[]
      - union
        - PytestGroupMembership — Position in pytest's collection hierarchy.
          - `kind` 'pytest'
          - `test_directory` GroupReference — Stable group identity and its display label.
            - `id` string, required
            - `label` string, required
          - `test_file` GroupReference, required — Stable group identity and its display label.
            - `id` string, required
            - `label` string, required
          - `test_class` GroupReference — Stable group identity and its display label.
            - `id` string, required
            - `label` string, required
          - `test_case` GroupReference, required — Stable group identity and its display label.
            - `id` string, required
            - `label` string, required
        - HttpRequestGroupMembership — Position in the outgoing HTTP target hierarchy.
          - `kind` 'http_request'
          - `hostname` GroupReference, required — Stable group identity and its display label.
            - `id` string, required
            - `label` string, required
  - `data` TestData, required
    - `framework` string
    - `framework_version` string
    - `python_version` string
    - `smello_version` string
    - `run_id` string, required
    - `worker_id` string
    - `test_id` string, required
    - `parameter_id` string, nullable
    - `name` string, required
    - `path` string, required
    - `line` integer, nullable
    - `status` 'passed' | 'failed' | 'error' | 'skipped' | 'xfailed' | 'xpassed', required
    - `duration_ms` number, required
    - `setup_duration_ms` number
    - `call_duration_ms` number
    - `teardown_duration_ms` number
    - `fixtures` string[]
    - `failures` TestFailure[]
      - `phase` 'setup' | 'call' | 'teardown', required
      - `exception_type` string, nullable
      - `message` string
      - `traceback_text` string

## Response `201`

Successful Response

- CaptureResponse
  - `status` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/smelloscope/apis/smello.md) · [All operations](https://skmtc.net/smelloscope/apis/smello/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smelloscope/smello/versions/71ae1afbca8d/schema)
