POST https://api.zatomic.ai/v1/prompts/{promptId}/versions
// Example
POST https://api.zatomic.ai/v1/prompts/prm_2qRzu8geIvfudcJTwP0pur4TbMJ/versions
API Reference
- Overview
- Versioning
- Authentication
- Workspaces
- Status Codes and Errors
- Credit Usage
- Expanding Objects
- OpenAPI Spec
- Contexts
- The Context Object
- Create File Context
- Create Text Context
- Update Context
- Delete Context
- Retrieve Context
- Retrieve All Contexts
- Context Versions
- The Context Version Object
- Create File Context Version
- Create Text Context Version
- Update File Context Version
- Update Text Context Version
- Delete Context Version
- Retrieve Context Version
- Retrieve All Context Versions
- Projects
- The Project Object
- Create Project
- Update Project
- Delete Project
- Retrieve Project
- Retrieve All Projects
- Prompts
- The Prompt Object
- Create Prompt
- Update Prompt
- Delete Prompt
- Retrieve Prompt
- Retrieve All Prompts
- Generate Prompt
- Prompt Versions
- The Prompt Version Object
- Create Prompt Version
- Update Prompt Version
- Delete Prompt Version
- Retrieve Prompt Version
- Retrieve All Prompt Versions
- Calculate Prompt Version Score
- Retrieve Prompt Version Score
- Generate Prompt Version Heatmap
- Retrieve Prompt Version Heatmap
- Analyze Prompt Version Balance
- Retrieve Prompt Version Balance
- Analyze Prompt Version Risk
- Retrieve Prompt Version Risk
- Improve Prompt Version
- Scoring Criteria
- The Scoring Criteria Object
- The Scoring Criterion Object
- Create Scoring Criteria
- Update Scoring Criteria
- Delete Scoring Criteria
- Retrieve Scoring Criteria
- Retrieve All Scoring Criteria
- Generate Scoring Criteria
- Create Scoring Criterion
- Update Scoring Criterion
- Delete Scoring Criterion
- Retrieve Scoring Criterion
- Scoring Criteria Results
- The Scoring Criteria Results Object
- Scoring
- The Scoring Object
- Calculate Prompt Score
- Heatmaps
- The Heatmap Object
- Generate Prompt Heatmap
- Balance
- The Balance Object
- Analyze Prompt Balance
- Risk
- The Risk Object
- Analyze Prompt Risk
Create Prompt Version
Creating a new prompt version requires only the prompt content; the name and any variables are optional. If a set of variables is given, the keys will be replaced by their values in the content before creating the prompt version.
Endpoint
Endpoint Request
| Request Properties | |
|---|---|
|
name
string, optional
|
Name of the version. |
|
content
string
|
Content for the version. |
|
variables
set of key-value pairs, optional
|
Set of template variables for the version, in key-value pair format. Variables can use either double curly braces {{ }} or double square brackets [[ ]]. |
Request Body
{
"name": "Version name",
"content": "You are a knowledgeable and friendly assistant...",
"variables": {
"{{variable1}}": "variable 1",
"[[variable2]]": "variable 2"
}
}
Endpoint Response
A successful call returns a 201 status code with a response that contains the prompt version object.
| HTTP Status Codes | ||
|---|---|---|
| 201 | Created | The prompt version was created. |
| 400 | Bad Request | The content was not provided in the request. |
| 404 | Not Found | The prompt didn't exist. |
| 500 | Internal Server Error | Something went wrong on Zatomic's end. |