> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.lumenia.net/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.lumenia.net/_mcp/server.

# Update prompt template

PATCH https://app.lumenia.net/api/v1/prompt-templates/{templateId}
Content-Type: application/json

Update a template name or description.

Reference: https://docs.lumenia.net/api-reference/prompt-templates/update-prompt-template

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <API_KEY>`, where `API_KEY` is your API key.

## Request

### Path parameters

- `templateId` (string, required) — Template to update.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — The new template name. Must be unique among the partner templates.
- `description` (string, optional, nullable) — The new description.

## Response

### 200

The updated prompt template.

- `template` (V1PromptTemplatesTemplateIdPatchResponsesContentApplicationJsonSchemaTemplate, required) — The updated template.

## Errors

### 400 Bad Request Error

No valid fields to update

- `any`

### 403 Forbidden Error

The API key is missing or invalid.

- `message` (string, optional)

### 404 Not Found Error

Template not found for this partner

- `any`

### 409 Conflict Error

A template with the new name already exists for this partner

- `any`

### 500 Internal Server Error

Internal Server Error

- `any`

## Types

### V1PromptTemplatesTemplateIdPatchResponsesContentApplicationJsonSchemaTemplate

The updated template.

- `id` (string, optional) — The sole identifier for the template.
- `name` (string, optional) — Human-readable template name.
- `description` (string, optional, nullable) — What the template is for.
- `type` (enum, optional) — The channel the template is written for.
  - Allowed values: `chat`, `voice`
- `createdAt` (string, optional) — ISO 8601 timestamp of when the template was created.
- `updatedAt` (string, optional) — ISO 8601 timestamp of when the template was last updated.

## Examples

**Request**

```json
{
  "name": "Dental receptionist v2",
  "description": "Updated description"
}
```

**Response**

```json
{
  "template": {
    "id": "a1b2c3d4-5e6f-4a0b-8c1d-2e3f4a5b6c7d",
    "name": "Dental receptionist v2",
    "description": "Updated description",
    "type": "voice",
    "createdAt": "2026-07-01T09:00:00.000Z",
    "updatedAt": "2026-07-12T09:00:00.000Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.lumenia.net/api/v1/prompt-templates/templateId"

payload = {
    "name": "Dental receptionist v2",
    "description": "Updated description"
}
headers = {
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.lumenia.net/api/v1/prompt-templates/templateId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <API_KEY>', 'Content-Type': 'application/json'},
  body: '{"name":"Dental receptionist v2","description":"Updated description"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.lumenia.net/api/v1/prompt-templates/templateId"

	payload := strings.NewReader("{\n  \"name\": \"Dental receptionist v2\",\n  \"description\": \"Updated description\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <API_KEY>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.lumenia.net/api/v1/prompt-templates/templateId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <API_KEY>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Dental receptionist v2\",\n  \"description\": \"Updated description\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.lumenia.net/api/v1/prompt-templates/templateId")
  .header("Authorization", "Bearer <API_KEY>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Dental receptionist v2\",\n  \"description\": \"Updated description\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.lumenia.net/api/v1/prompt-templates/templateId', [
  'body' => '{
  "name": "Dental receptionist v2",
  "description": "Updated description"
}',
  'headers' => [
    'Authorization' => 'Bearer <API_KEY>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.lumenia.net/api/v1/prompt-templates/templateId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <API_KEY>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Dental receptionist v2\",\n  \"description\": \"Updated description\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <API_KEY>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Dental receptionist v2",
  "description": "Updated description"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.lumenia.net/api/v1/prompt-templates/templateId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```