---
title: "Get Snippet Usage"
method: GET
path: "/prompt-templates/{identifier}/snippet-usage"
tags: ["prompt-templates", "snippets"]
---

# Get Snippet Usage

`GET /prompt-templates/{identifier}/snippet-usage`

## Path parameters

- `identifier` string, required — The identifier can be either the prompt name or the prompt id.

## Query parameters

- `prompt_version_number` integer — Optional specific version number to check usage for

## Response `200`

Successful Response

- GetSnippetUsageResponse
  - `success` boolean
  - `message` string
  - `snippet_name` string — The name of the snippet prompt template
  - `snippet_usage` object[] — List of prompts using this snippet
    - `prompt_registry_id` integer — The ID of the prompt that uses this snippet
    - `prompt_name` string — The name of the prompt that uses this snippet
    - `version_numbers` integer[] — List of version numbers that use this snippet
  - `total_prompts_using_snippet` integer — Total number of prompts using this snippet
  - `label_usage` object[] — List of labels using this snippet
    - `prompt_registry_id` integer — The ID of the prompt with a label using this snippet
    - `prompt_name` string — The name of the prompt with a label using this snippet
    - `label_name` string — The name of the label using this snippet
  - `total_labels_using_snippet` integer — Total number of labels using this snippet

## Other responses

- `401` — Unauthorized - missing or invalid API key.
- `403` — Access denied - Invalid workspace_id
- `404` — Prompt template not found
- `422` — Validation error - request parameters or body are invalid.

---

[API](https://skmtc.dev/promptlayer/apis/promptlayer-api.md) · [All operations](https://skmtc.dev/promptlayer/apis/promptlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/promptlayer/promptlayer-api/revisions/a23093a0a506/schema)
