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

# Create a prompt

`POST /prompts/`

## Request

- Base URL: `https://api.your-domain.com`
- URL: `https://api.your-domain.com/prompts/`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/docs/prompts/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a saved prompt for the current user.

## Query parameters

- `cookie_name` string, nullable

## Request body

- PromptIn
  - `name` string, nullable: Name for the prompt to be created. Max 100 characters.
  - `prompt` string, required: The content of the prompt. This field is required.
  - `is_public` boolean, nullable: Whether the prompt is public or privtate, default is private (False)
  - `description` string, nullable: Description for the prompt.

## Response `201`

Successful Response

- Prompt
  - `id` integer, nullable: Primary key for the prompt.
  - `tenant_id` integer, required: ID of the tenant that owns the prompt.
  - `created_at` string, date-time: Timestamp when the prompt was created.
  - `creator_user_id` integer, required: ID of the user who created the prompt.
  - `name` string, nullable, required: Name of the prompt.
  - `prompt` string, required: Prompt text content.
  - `is_public` boolean: Whether the prompt is shared publicly within the tenant.
  - `description` string, nullable, required: Optional description of the prompt.

## Other responses

- `401`: Missing or invalid authentication.
- `403`: Only admins may create public prompts.
- `422`: Validation Error

---

[API](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api.md) - [All operations](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/revisions/b53e89b98c2b?raw)
