Create a new snippet
Snippets
Create Snippet
Creates a new snippet with optional variations and tags. API Cost: 1 request.
POST
Create a new snippet
Overview
Creates a new snippet with optional variations, folder assignment, and tags. This endpoint allows you to create structured snippets programmatically. API Cost: 1 requestCode Examples
Real-World Use Case: Voice AI Integration
Here’s a complete example of creating prompts for a voice AI system (like VAPI):Response Example
Validation Rules
Length: 1-200 characters Cannot be empty or exceed 200 characters.
Must include
type and content fields.Must be a valid team ID that your API key has access to.
Length: 0-5000 characters (optional)
Length: 0-100 characters (optional)
Must be a valid folder ID in the same team (optional)
Array of valid tag IDs from the same team (optional)
Batch Creation
To create multiple snippets, use the batch endpoint instead:Error Handling
Best Practices
Validate data before API calls to catch errors early and save on API costs
Use meaningful titles that make snippets easy to identify
Add notes to provide context for team members
Organize with folders and tags for better management
Create variations for different use cases (languages, contexts, etc.)
Related Endpoints
- Update Snippet - Update an existing snippet
- Create Multiple Snippets - Batch create snippets
- Get Snippet - Retrieve a snippet
- Create Folder - Create a folder first
Authorizations
API key authentication using Bearer token. Include your API key in the Authorization header.
Body
application/json
Title of the snippet
Maximum string length:
200Example:
"My API Snippet"
ID of the team this snippet belongs to
Optional note for the snippet
Maximum string length:
5000Optional keyboard shortcut
Maximum string length:
100Optional folder ID to organize the snippet
Optional array of tag IDs
Optional additional variations of this snippet