---
title: "Create Prompt"
method: POST
path: "/v1/prompts/create"
tags: ["prompts"]
---

# Create Prompt

`POST /v1/prompts/create`

## Request body

- PromptParams
  - `content` string
  - `collect_fields` CollectField[], nullable
    - `field_type` 'field_type_email', required
    - `label` string, required
    - `name` string, required
    - `description` string, nullable
  - `context_endpoint` string, nullable
  - `prompt_template` union
    - string, uuid
    - PromptTemplate
      - `id` string, uuid, required
      - `user_id` string, uuid, required
      - `label` string
      - `required_context_keys` string[], required

## Response `200`

Successful Response

- Prompt
  - `id` string, uuid, required
  - `user_id` string, uuid, required
  - `content` string
  - `collect_fields` CollectField[], nullable
    - `field_type` 'field_type_email', required
    - `label` string, required
    - `name` string, required
    - `description` string, nullable
  - `context_endpoint` string, nullable
  - `prompt_template` PromptTemplate
    - `id` string, uuid, required
    - `user_id` string, uuid, required
    - `label` string
    - `required_context_keys` string[], required

## Other responses

- `422` — Validation Error

## Changes

- **2024-08-14** `63991d99e2e1` — 6 breaking, 1 warning, 4 info
  - response property `collect_fields` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `context_endpoint` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - the `prompt_template` response's property type/format changed from `object`/`` to ``/`` for status `200`
  - removed the required property `prompt_template/id` from the response with the `200` status
  - …7 more
- **2023-09-26** `eb14a21c478e` — 1 breaking, 5 info
  - the response property `content` became optional for the status `200`
  - added the new optional request property `prompt_template`
  - the request property `content` became optional
  - the `content` request property default value `` was added
  - …2 more
- **2023-09-06** `ec1d8c780c18` — 1 breaking, 1 info
  - removed the enum value `field_type_address` of the request property `collect_fields/items/field_type`
  - removed the `field_type_address` enum value from the `collect_fields/items/field_type` response property for the response status `200`
- **2023-08-26** `28dead252457` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/vocodedev/apis/vocode-hosted-api/changes/v1/prompts/create/post.md)

---

[API](https://skmtc.dev/vocodedev/apis/vocode-hosted-api.md) · [All operations](https://skmtc.dev/vocodedev/apis/vocode-hosted-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vocodedev/vocode-hosted-api/revisions/ffca17c004e2/schema)
