Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Create prompt

POST/v1/private/promptsCreate prompt

Create prompt

Request body

application/json
objectPrompt_Write
change_descriptionstring
descriptionstring

maxLength 255 · minLength 0 · pattern (?s)^\s*(\S.*\S|\S)\s*$

idstring · uuid
metadataobject
namestringrequired

minLength 1

project_idstring · uuid

Project ID. Takes precedence over project_name when both are provided.

project_namestring

For project scope, specify either project_id or project_name. If project_name is provided and the project does not exist, it will be created. Ignored when project_id is provided. If neither is provided, the prompt is created at workspace level.

pattern (?s)^\s*(\S.*\S|\S)\s*$

tagsarray of string

uniqueItems true

Show child attributes

uniqueItems true

templatestring

pattern (?s)^\s*(\S.*\S|\S)\s*$

template_structurestring

Template structure type: 'text' or 'chat'. Immutable after creation.

one of "text", "chat" · default "text"

typestring

one of "mustache", "jinja2", "python"

Example request
{
  "change_description": "string",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "metadata": {},
  "name": "string",
  "project_id": "00000000-0000-0000-0000-000000000000",
  "project_name": "string",
  "tags": [
    "string"
  ],
  "template": "string",
  "template_structure": "text",
  "type": "jinja2"
}

Responses

201Created

Headers

Location
400Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
409Conflictapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
422Unprocessable Contentapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu