---
title: "Update a prompt"
method: PATCH
path: "/prompts/{prompt_id}"
tags: ["Prompt"]
---

# Update a prompt

`PATCH /prompts/{prompt_id}`

## Request

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

Update a prompt owned by the current user.

## Path parameters

- `prompt_id` integer, required: ID of the prompt to update.

## 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 `200`

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`: Not the creator, or only admins may make a prompt public.
- `404`: No prompt exists with the given id.
- `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)
