Skip to main content
GET
Get a single snippet

Overview

Retrieves a single snippet by its ID. This endpoint returns the complete snippet data including content, metadata, folder assignment, and timestamps. API Cost: 1 request

Code Examples

Response Example

Use Cases

Retrieve a specific prompt variation for use in voice AI services like VAPI:
Fetch snippet data to display in your application:
Check if a snippet exists before performing operations:
Implement caching to reduce API calls:

Error Handling

Common Issues

Problem: The snippet ID doesn’t exist or was deleted.Solution:
  • Verify the snippet ID is correct
  • Check if the snippet was deleted
  • Ensure the snippet belongs to your workspace
Problem: Your API key doesn’t have access to the snippet’s team. Solution: - Check your API key’s team permissions - Ensure the API key has access to the required team - Verify your workspace subscription is active
Problem: Invalid or missing API key.Solution:
  • Check the Authorization header is properly formatted
  • Verify your API key is active
  • Ensure you’re using Bearer YOUR_API_KEY format

Best Practices

Use caching for frequently accessed snippets to reduce API calls
Implement error handling for all possible error scenarios
Store snippet IDs persistently to avoid lookup operations
Monitor usage through the response’s usage field
Validate IDs before making requests to avoid unnecessary API calls
Don’t fetch snippets in tight loops without caching - this will quickly exhaust your API quota and hit rate limits.

Authorizations

Authorization
string
header
required

API key authentication using Bearer token. Include your API key in the Authorization header.

Query Parameters

id
string<uuid>
required

The ID of the snippet to fetch

Response

Snippet retrieved successfully

success
boolean
Example:

true

data
object
usage
object