---
title: "Create a prompt"
method: POST
path: "/api/prompts/"
tags: ["Prompts"]
---

# Create a prompt

`POST /api/prompts/`

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/prompts/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

## Request body

- object
  - `name` string: Prompt name. Defaults to `Untitled`.
  - `description` string: Prompt description.

## Response `201`

Prompt created successfully.

- object
  - `id` string: The unique prompt identifier.
  - `name` string
  - `description` string, nullable
  - `prompt_slug` string, nullable
  - `tags` object[]
    - `id` string
    - `name` string
    - `color` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `current_version` object, nullable: The prompt's current version, as the full version object that Get a prompt version returns.
    - `version` integer
    - `model` string
    - `updated_at` string, date-time
  - `live_version` object, nullable: The deployed version, as the full version object that Get a prompt version returns. `null` until a version is deployed.
    - `version` integer
    - `model` string
    - `updated_at` string, date-time

## Other responses

- `400`: Bad Request
- `403`: The API key is missing, invalid or expired.

## Changes

- **2026-10-21** `c30bcb383ee8`: 7 breaking, 12 info
  - request body became required
  - the response property `current_version` became nullable for the status `201`
  - the response property `description` became nullable for the status `201`
  - the response property `live_version` became nullable for the status `201`
  - …15 more
- **2026-10-02** `b830b79cfd52`: 2 warning, 3 info
  - removed the optional property `created_at` from the response with the `201` status
  - removed the optional property `updated_at` from the response with the `201` status
  - the request property `name` became optional
  - added the non-success response with the status `403`
  - …1 more
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `create-prompt` removed and replaced with `prompts_createPrompt`
- **2026-08-13** `4e064cf81dae`: 30 breaking, 62 warning, 4 info
  - the request property `name` became required
  - the response property `description` became nullable for the status `201`
  - the response property `current_version` became optional for the status `201`
  - the response property `id` became optional for the status `201`
  - …92 more

[Operation history](https://skmtc.dev/keywordsai/apis/respan-api/changes/api/prompts/post.md)

---

[API](https://skmtc.dev/keywordsai/apis/respan-api.md) - [All operations](https://skmtc.dev/keywordsai/apis/respan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keywordsai/apis/respan-api/revisions/900841387635?raw)
