---
title: "Recover Snippet"
method: POST
path: "/recover/snippet/{id}"
tags: ["snippet"]
---

# Recover Snippet

`POST /recover/snippet/{id}`

Used to undelete a snippet

## Path parameters

- `id` string, required

## Response `200`

The Snippet that was recovered

- Snippet — Fields necessary to execute a snippet in a test or flow
  - `invariant_id` string — Object ID for the parent type. Set by system.
  - `description` string — Summary of the Snippet
  - `name` string — The display name of the Snippet
  - `body` string — the base64 encoded body of the Snippet
  - `snippet_type` 'css' | 'javascript' | 'xpath' | 'sql' | 'postman'
  - `reusable` boolean — Indicates whether the snippet is reusable
  - `workspace_id` string — The ID of the workspace that this Snippet belongs to
  - `id` string — Object id. Set by system.
  - `is_latest` boolean — Indicates whether this was the latest variant when retrieved
  - `version` integer — The generation number of this variant
  - `previous_version` integer — The generation number of the variant that was edited to create this variant (if applicable)
  - `merged_version` integer — The generation number of the variant that was merged with the previous version to create this variant (if applicable)
  - `created_on_branch` string — Name of the branch the snippet's variant was created on
  - `change_description` string — Description of the change between this variant and the previous variant
  - `last_updated_time` integer — time the Snippet object was last updated
  - `last_updated_by_id` string — The ID of the user who last updated this Snippet
  - `variant_last_updated_time` integer — time the Snippet's variant was last updated
  - `variant_last_updated_by_id` string — The ID of the user who last updated this Snippet's variant
  - `created_time` integer — time the Snippet was created
  - `created_by_id` string — The ID of the user who created this Snippet
  - `labels` Label[] — User provided labels
    - `name` string, required — name
    - `color` string — color
  - `parameters` SnippetParameter[] — Snippet parameters supplied to the snippet
    - `id` string, required — The ID of the parameter
    - `name` string, required — The name of the parameter
    - `description` string — The description of the parameter
    - `default_value` string — The default value of the parameter
  - `revision_history` string — Graph describing the snippet's version history
  - `database_connection_id` string — If the snippet is a SQL snippet, the database connection id.

## Other responses

- `404` — Snippet not found
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
