Zatomic API

Create 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
POST https://api.zatomic.ai/v1/prompts/{promptId}/versions

// Example
POST https://api.zatomic.ai/v1/prompts/prm_2qRzu8geIvfudcJTwP0pur4TbMJ/versions

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 version object.

HTTP Status Codes
201 Created The 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.