---
title: "Create prompt"
method: POST
path: "/v1/private/prompts"
tags: ["Prompts"]
---

# Create prompt

`POST /v1/private/prompts`

Create prompt

## Request body

- PromptWrite
  - `id` string, uuid
  - `name` string, required
  - `project_id` string, uuid — Project ID. Takes precedence over project_name when both are provided.
  - `project_name` string — 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.
  - `description` string
  - `template` string
  - `metadata` JsonNodeWrite
  - `change_description` string
  - `type` 'mustache' | 'jinja2' | 'python'
  - `template_structure` 'text' | 'chat' — Template structure type: 'text' or 'chat'. Immutable after creation.
  - `tags` string[]

## Response `201`

Created

## Other responses

- `400` — Bad Request
- `409` — Conflict
- `422` — Unprocessable Content

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
