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

# Upsert a prompt

`POST /prompts`

## Request

- Base URL: `https://api.savanto.ai`
- URL: `https://api.savanto.ai/prompts`
- Auth: HTTP bearer

Create or update a prompt by external ID.

## Request body

- PromptInput
  - `id` string
  - `prompt` string, required
  - `title` string
  - `description` string
  - `cannedResponse` string
  - `responseFormat` 'markdown' | 'text' | 'html'
  - `overrideMode` 'override' | 'fallback'
  - `postIds` string[]
  - `productIds` string[]
  - `followUpIds` string[]
  - `tags` string[]
  - `categories` string[]
  - `status` string
  - `priority` integer
  - `icon` string
  - `activeFrom` string
  - `activeTo` string
  - `metadata` object

## Response `200`

Prompt upserted successfully

- object
  - `object` 'prompt', required
  - `requestId` string, required
  - `data` object, required
    - `id` string, required
    - `message` string, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict
- `413`: Payload too large
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/savanto/apis/savanto-api.md) · [All operations](https://skmtc.dev/savanto/apis/savanto-api/llms.txt) · [OpenAPI document](https://skmtc.dev/savanto/apis/savanto-api/revisions/82437327a878?raw)
