---
title: "Create a prompt under a topic"
method: POST
path: "/prompts"
tags: ["Resources"]
---

# Create a prompt under a topic

`POST /prompts`

## Request body

- object
  - `topicId` string, uuid, required
  - `promptTemplate` string, required
  - `language` string, nullable
  - `attributes` string[] — Optional. Omitting the key is the same as sending []. When present, must be an array of attributes from the project's allowed list.

## Response `201`

Prompt created

- Prompt
  - `id` string, uuid, required
  - `topicId` string, uuid, required
  - `topicName` string
  - `promptTemplate` string, required
  - `intentType` string, nullable
  - `language` string, nullable
  - `isManual` boolean
  - `isActive` boolean, required
  - `attributes` string[], required
  - `createdAt` string, date-time

## Other responses

- `400` — Missing or invalid request parameter.
- `401` — Missing, malformed, or revoked API key.
- `402` — Monthly included API calls for your tier are used up (code `USAGE_LIMIT`). Body includes a `limit` object — `{ limitHit, currentTier, targetTier, feature, cap, used, resetAt }` — describing the cap and the upgrade that lifts it.
- `404` — Resource not found or not owned by your account.
- `429` — Rate limit, project cap, or daily quota hit. Body includes a `code` field.
- `500` — Server error. Retry; if persistent, contact support.

---

[API](https://skmtc.net/openlens/apis/openlens-api.md) · [All operations](https://skmtc.net/openlens/apis/openlens-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openlens/openlens-api/revisions/d307a7633c0a/schema)
