---
title: "Import prompts"
method: POST
path: "/api/mcp/projects/{projectId}/prompt-generation/import"
tags: ["Prompts"]
---

# Import prompts

`POST /api/mcp/projects/{projectId}/prompt-generation/import`

## Request

- Base URL: `https://app.searchable.com`
- URL: `https://app.searchable.com/api/mcp/projects/{projectId}/prompt-generation/import`
- Auth: HTTP bearer

Add 1-10 validated Prompt Universe candidates to the project as tracked prompts (`isTracked: true`), as when you add prompts in the app: the project's next scheduled run checks them, within the prompt allowance. Starts no Prompt Universe run and calls no model. THE GATES AND THE ALLOWANCE ARE ALL-OR-NOTHING, THE WRITES ARE NOT: every candidate is checked before anything is written and one refusal refuses the whole batch with 422 `prompt_gates_failed` and nothing created; the whole batch is then checked against the prompt allowance, and one that does not fit is refused with 403 `quota_exceeded` and nothing created. Once writing starts each prompt commits on its own and re-checks your prompt quota, so a batch can still stop partway if another write takes the room. Every response - success or failure - carries `outcomes`, one row per submitted candidate (`created` / `failed` / `not_attempted`); on a partial failure the response keeps the underlying error's own status and code (for example 403 `quota_exceeded`) and adds `created` and `outcomes`, so retry only the rows that are not `created`. Any `topicIds` must belong to the same project as the prompt; one that does not is refused with 404 `not_found`, indistinguishable from a topic id that does not exist. Requires a connection minted with the `prompt:draft` capability (not the bare `write` scope), and your own project role must allow the write. Supports `Idempotency-Key` replay. Returns 404 where the feature is not enabled for the workspace.

## Path parameters

- `projectId` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `candidates` object[], required
    - `text` string, required: The prompt's wording.
    - `stage` 'tofu' | 'mofu' | 'bofu' | 'post_purchase', required: The funnel moment: tofu (first look), mofu (compare), bofu (buy), post_purchase (own).
    - `kind` 'open' | 'sentiment' | 'competitor': open = unbranded, sentiment = branded, competitor = comparison.
    - `branded` boolean: Whether the prompt names the brand.
    - `topicIds` string[]: Existing topic ids to assign to each added prompt.
  - `market` string: Which spelling list to hold the set to (US or GB).

## Response `200`

The added prompts.

- object
  - `prompts` AddPromptDraft[], required
    - `id` string, uuid, required
    - `text` string, required
    - `topicId` string, nullable
    - `topicName` string, nullable
    - `topics` object[], required
      - `id` string, required
      - `name` string, required
    - `lastUpdated` string, required
    - `createdAt` string, date-time, nullable
    - `isFromOnboarding` boolean, nullable
    - `isTracked` boolean, nullable: `false` for every draft this endpoint creates — call the tracking endpoint to turn it on.
    - `locations` object[], required
      - `id` string, required
      - `countryCode` string, required
      - `city` string, nullable
      - `region` string, nullable
      - `latitude` number, nullable
      - `longitude` number, nullable
    - `fallbackLocation` unknown
    - `usesFallbackLocation` boolean, required
    - `projectId` string, uuid, nullable
    - `intentCategory` string, nullable
    - `promptType` string, nullable
    - `isBranded` boolean, nullable
    - `keywordSearchVolume` integer, nullable
    - `keywordDifficulty` integer, nullable
    - `currentRevision` integer, required: Optimistic-concurrency counter — pass as `If-Match` on a subsequent PATCH to detect a concurrent change without a second fetch.
    - `updatedAt` string, date-time, nullable
  - `created` integer, required
  - `success` boolean, required
  - `outcomes` object[]: One row per submitted candidate, in submission order. Present on success and, alongside the error, on a partial failure.
    - `index` integer: Position in the submitted array, 0-based.
    - `text` string
    - `status` 'created' | 'failed' | 'not_attempted': `created` - the prompt exists. `failed` - the candidate the run stopped on. `not_attempted` - the run stopped before reaching it, and nothing was written for it.
    - `promptId` string, nullable

## Other responses

- `400`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `401`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `403`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `404`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `409`: Another request with the same `Idempotency-Key` is still executing. `Retry-After` (5 seconds) is always present — retry with the SAME key once it elapses.
- `422`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `429`: Rate limited. Usually the per-API-key REST limit (600 requests/minute); on Google-backed endpoints it can also relay an upstream Google rate limit. `Retry-After` (seconds) is present when the limit was applied by Searchable's own rate limiter; it may be absent when an upstream provider rate-limits.

## Changes

- **2026-11-03** `28a5e2a65cd3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/searchable/apis/searchable-rest-api/changes/api/mcp/projects/:projectId/prompt-generation/import/post.md)

---

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