---
title: "Snap Write"
method: POST
path: "/snap_write"
---

# Snap Write

`POST /snap_write`

Write snapshot to database. The snapshot refers to input state and output filter state for a query. With this data, we can recreate input + output for a query of interest.

This way, users can save and share results simply by passing around a unique link containing the {snapshot_id} (in combination with functionality provided by the frontend API)

## Request body

- QueryInput
  - `snapquery_id` string
  - `query_id` integer
  - `query_type` 'exact' | 'substructure', required
  - `transform_order` 'first_order' | 'second_order', required
  - `sketched_content` SketchedContent, required
    - `mol1_molfile` string
    - `mol1_variable_atoms` string
    - `mol1_variable_bonds` string
    - `mol1_environment_atoms` string
    - `mol1_environment_bonds` string
    - `mol2_molfile` string
    - `mol2_variable_atoms` string
    - `mol2_variable_bonds` string
    - `mol2_environment_atoms` string
    - `mol2_environment_bonds` string
  - `REQUIRED_properties` string
  - `OPTIONAL_properties` string
  - `advanced_options` AdvancedOptions
    - `variable_min_heavies` integer
    - `variable_max_heavies` integer
    - `compound_min_heavies` integer
    - `compound_max_heavies` integer
    - `aggregation_type` 'individual_transforms' | 'group_by_fragment'
  - `snapfilter_id` string
  - `snapfilter_string` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/merck/apis/matcher-backend.md) · [All operations](https://skmtc.dev/merck/apis/matcher-backend/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/merck/matcher-backend/revisions/59028f512f31/schema)
