---
title: "Get snippet detail"
method: GET
path: "/workspaces/{workspace_id}/snippets/{snippet_id}"
tags: ["Snippets"]
---

# Get snippet detail

`GET /workspaces/{workspace_id}/snippets/{snippet_id}`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/snippets/{snippet_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Get snippet detail with dependencies and history

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.
- `snippet_id` integer, required

## Response `200`

Get SnippetDetailResponse

- SnippetDetailResponse
  - `id` integer, required: Snippet ID
  - `name` string, required: Snippet name
  - `code` string, required: Snippet source code
  - `language` string, required: Snippet language
  - `description` string, nullable: Snippet description
  - `scope` string, required: Scope of the snippet
  - `group_id` integer, nullable: Parameter group ID
  - `group_name` string, nullable: Name of the parameter group
  - `pipeline_count` integer, required: Number of pipelines using this snippet
  - `stale_pipelines` integer[]: Dataview IDs of stale pipelines using this snippet
  - `referenced_parameters` string[], required: Names of parameters used in the snippet code
  - `created_by` integer, required: User ID who created the snippet
  - `created_at` string, required: Creation timestamp
  - `updated_by` integer, nullable: User ID who last updated the snippet
  - `updated_at` string, required: Last update timestamp
  - `dependencies` PipelineDependency[], required: Pipelines that use this snippet
    - `dataview_id` integer, required
    - `dataview_name` string, required
    - `is_stale` boolean
    - `task_ids` integer[], required
  - `history` SnippetHistoryEntry[], required: Change history for this snippet
    - `old_code` string, nullable: Previous snippet code
    - `new_code` string, required: Updated snippet code
    - `changed_by` integer, required: User ID who made the change
    - `changed_at` string, required: Timestamp of the change
    - `rerun_count` integer, required: Number of pipeline reruns triggered by this change

## Other responses

- `400`: Bad Request
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
