List Snippets
endpoint
Retrieve all snippets for an environment.
Query Parameters
string
Pagination cursor for retrieving the next page
string
Filter by comma-separated hostnames
string
Filter by snippet title (URL-encoded)
Response
array
Array of snippet objects
object
Create Snippet
endpoint
Add one or more snippets to an environment.
Request Body
array
required
Array of snippet objects to create
Response
array
Array of created snippet objects with IDs
Status Codes
- 201: Snippet created successfully
- 400: Invalid snippet parameters
- 409: Duplicate snippet content in environment
Update Snippet
endpoint
Update an existing snippet.
Request Body
object
required
Snippet object with updated values
Response
boolean
Whether the update was successful
Status Codes
- 200: Snippet updated successfully
- 400: Invalid snippet parameters
- 409: Duplicate snippet content in environment
Delete Snippets
endpoint
Delete one or more snippets by ID.
Query Parameters
string
required
Comma-separated snippet IDs to delete
Response
boolean
Whether the deletion was successful
Snippet Configuration
Injection Locations
- head: Inject into the
<head>element - body: Inject into the
<body>element
Prepend vs Append
- prepend: true: Inject as the first child of the location element
- prepend: false: Inject as the last child of the location element
Rules
Snippets can be conditionally injected based on:- hosts: Specific domain names or wildcard patterns
- path: URL path pattern matching
Development Endpoints
To inject snippets on all development/preview deployments, use the wildcard pattern:Specifying an individual deployment endpoint will enable the snippet for all development endpoints.