Snippets
Snippets in Luella are much like variables but with a twist — instead of values that are injected into a sequence copy, they are actually prompts that are passed into an LLM for processing. The output of that LLM is what is injected into the sequence copy. The body of a snippet can also contain variables. You can add them by simply surrounding the variableId with curly braces, e.g. {variable_id}
.
The snippet model
The snippet model defines reusable prompt blocks that dynamically generate content for use in sequences. Snippets accept variables and return processed text at dispatch time.
Properties
- Name
snippetId
- Type
- string
- Description
Unique identifier for the snippet.
- Name
workspaceId
- Type
- string
- Description
Identifier of the workspace that owns this snippet.
- Name
name
- Type
- string
- Description
Name of the snippet used for reference in the UI.
- Name
prompt
- Type
- string
- Description
Prompt string passed to the LLM. Can include variable placeholders like
{variable_id}
.
- Name
createdAt
- Type
- timestamp (ISO string)
- Description
Time the snippet was created.
- Name
lastUpdatedAt
- Type
- timestamp (ISO string)
- Description
Time the snippet was last modified.
List all snippets
This endpoint returns a list of all snippets created under a workspace. Snippets define reusable prompts used during outreach.
Required attributes
- Name
userId
- Type
- string
- Description
ID of the user making the request.
- Name
workspaceId
- Type
- string
- Description
Workspace whose snippets should be listed.
Optional attributes
- Name
sortOrder
- Type
- string
- Description
Optional sorting of results.
- Name
nextToken
- Type
- string
- Description
Token for pagination.
- Name
maxItems
- Type
- integer
- Description
Maximum number of results per page.
Request
{
"userId": "user_123",
"workspaceId": "workspace_456"
}
Response
{
"snippets": [
{
"snippetId": "snippet_001",
"name": "LinkedIn Icebreaker"
}
],
"nextToken": null
}
Create a new snippet
Create a new snippet with a name and prompt body to be evaluated at dispatch time.
Required attributes
- Name
userId
- Type
- string
- Description
ID of the user making the request.
- Name
workspaceId
- Type
- string
- Description
ID of the workspace the snippet belongs to.
- Name
name
- Type
- string
- Description
Display name of the snippet.
- Name
prompt
- Type
- string
- Description
Prompt passed to the LLM. Can contain variables.
Request
{
"userId": "user_123",
"workspaceId": "workspace_456",
"name": "LinkedIn Icebreaker",
"prompt": "Use this contact’s LinkedIn about section to generate an icebreaker: {linkedin_summary}"
}
Response
{
"snippetId": "snippet_001"
}
Get a snippet
Retrieve a single snippet’s full prompt body and metadata.
Required attributes
- Name
userId
- Type
- string
- Description
Requesting user ID.
- Name
workspaceId
- Type
- string
- Description
Workspace that owns the snippet.
- Name
snippetId
- Type
- string
- Description
Unique identifier for the snippet.
Request
{
"userId": "user_123",
"workspaceId": "workspace_456",
"snippetId": "snippet_001"
}
Response
{
"snippetId": "snippet_001",
"name": "LinkedIn Icebreaker",
"prompt": "Use this contact’s LinkedIn about section to generate an icebreaker: {linkedin_summary}",
"createdAt": "2024-11-10T15:12:00.000Z",
"lastUpdatedAt": "2024-11-12T08:45:00.000Z"
}
Update a snippet
Update the name or prompt content of an existing snippet.
Required attributes
- Name
userId
- Type
- string
- Description
User issuing the update.
- Name
workspaceId
- Type
- string
- Description
The workspace containing the snippet.
- Name
snippetId
- Type
- string
- Description
Identifier of the snippet to update.
- Name
name
- Type
- string
- Description
New name for the snippet.
- Name
prompt
- Type
- string
- Description
New prompt content to replace the old one.
Request
{
"userId": "user_123",
"workspaceId": "workspace_456",
"snippetId": "snippet_001",
"name": "Updated Snippet Name",
"prompt": "Updated prompt text using {updated_variable}"
}
Response
{
"snippetId": "snippet_001"
}
Delete a snippet
Permanently deletes a snippet from your workspace.
Required attributes
- Name
userId
- Type
- string
- Description
The user making the deletion request.
- Name
workspaceId
- Type
- string
- Description
The workspace from which to delete the snippet.
- Name
snippetId
- Type
- string
- Description
Unique identifier for the snippet.
Request
{
"userId": "user_123",
"workspaceId": "workspace_456",
"snippetId": "snippet_001"
}
Response
{}