Skip to main content
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 request

Code 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

string
required
Length: 1-200 characters Cannot be empty or exceed 200 characters.
object
required
Must include type and content fields.
string
required
Must be a valid team ID that your API key has access to.
string
Length: 0-5000 characters (optional)
string
Length: 0-100 characters (optional)
string
Must be a valid folder ID in the same team (optional)
array
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.)
Always verify that folder IDs and tag IDs exist and belong to the correct team before creating snippets.

Authorizations

Authorization
string
header
required

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

Body

application/json
title
string
required

Title of the snippet

Maximum string length: 200
Example:

"My API Snippet"

content
object
required
teamId
string<uuid>
required

ID of the team this snippet belongs to

note
string

Optional note for the snippet

Maximum string length: 5000
shortcut
string

Optional keyboard shortcut

Maximum string length: 100
folderId
string<uuid>

Optional folder ID to organize the snippet

tagIds
string<uuid>[]

Optional array of tag IDs

additionalVariations
object[]

Optional additional variations of this snippet

Response

Snippet created successfully

success
boolean
Example:

true

data
object
usage
object
metadata
object