---
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` PromptTemplateResponse, 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
    - `defaultDrifted` boolean, required

## Other responses

- `400` — Validation error

## Changes

- **2026-08-20** `d06bca6c3ff5` — 12 breaking, 1 info
  - the `template` response's property type changed from `object` to no type for status `200`
  - removed the required property `template/body` from the response with the `200` status
  - removed the required property `template/createdAt` from the response with the `200` status
  - removed the required property `template/createdBy` from the response with the `200` status
  - …9 more
- **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-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/8cde933218b5/schema)
