---
title: "Create or update a prompt template override"
method: PUT
path: "/api/prompt-templates"
tags: ["PromptTemplates"]
---

# Create or update a prompt template override

`PUT /api/prompt-templates`

## Request body

- object
  - `eventType` string, required
  - `scope` 'global' | 'agent' | 'repo'
  - `scopeId` string
  - `state` 'enabled' | 'default_prompt_fallback' | 'skip_event'
  - `body` string, required
  - `changedBy` string
  - `changeReason` string

## Response `200`

Upserted template

- object
  - `template` PromptTemplate, required
    - `id` string, required
    - `eventType` string, required
    - `scope` 'global' | 'agent' | 'repo', required
    - `scopeId` string, nullable, required
    - `state` 'enabled' | 'default_prompt_fallback' | 'skip_event', required
    - `body` string, required
    - `isDefault` boolean, required
    - `version` number, required
    - `createdBy` string, nullable, required
    - `createdAt` string, required
    - `updatedAt` string, required

## Other responses

- `400` — Validation error

## Changes

- **2026-08-07** `06cac6a7c5bc` — 2 info
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `400`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/prompt-templates/put.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/revisions/4d23bb3d853c?raw)
