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

# Update Translation Style

PATCH https://api.sofer.ai/v1/translation-styles/{translation_style_id}
Content-Type: application/json

Rename an owned custom style or replace its instructions. Changed instructions
are safety-validated again and invalidate translations cached under this style.
Built-in styles cannot be modified, and a custom style's target language is immutable.

Reference: https://docs.sofer.ai/api-reference/translate/update-translation-style

## Authentication

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

## Request

### Path parameters

- `translation_style_id` (string, required) — Custom translation style ID.

### Body (application/json)

This endpoint expects a TranslationStyleUpdateRequest.

- `name` (string, optional) — New display name. Omit to leave unchanged.
- `instructions` (string, optional) — Replacement style-only instructions. Omit to leave unchanged.

## Response

### 200

- `id` (string, required) — Value to pass as `translation_style` when creating a translation.
- `name` (string, required) — Display name.
- `target_languages` (list of enum, required) — Languages this style can be used with.
  - Allowed values: `en`, `he`, `yi`
- `kind` (enum, required) — Whether this is a built-in or user-created style.
  - Allowed values: `built_in`, `custom`
- `verified` (boolean, required) — Whether the style instructions passed safety and scope validation.
- `description` (string, optional) — Short description of the style.
- `instructions` (string, optional) — The authenticated user's custom style instructions. Omitted for built-in styles.
- `created_at` (datetime, optional) — Creation time for a custom style.
- `updated_at` (datetime, optional) — Last update time for a custom style.

## Errors

### 401 Authentication Error

Authentication error

### 404 Translation Style Not Found

Translation style was not found or is not owned by the authenticated API user.

### 400 Invalid Translation Style

Translation style name, target language, or instructions are invalid or failed safety validation.

### 503 Translation Style Validation Unavailable

Translation style validation is temporarily unavailable. No style was created or changed.

### 429 Rate Limit Error

Rate limit exceeded, or you have used up your quota

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "id",
  "name": "name",
  "target_languages": [
    "en",
    "en"
  ],
  "kind": "built_in",
  "verified": true,
  "description": "description",
  "instructions": "instructions",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.sofer.ai/v1/translation-styles/translation_style_id"

payload = {}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.sofer.ai/v1/translation-styles/translation_style_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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://api.sofer.ai/v1/translation-styles/translation_style_id"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "Bearer <apiKey>")
	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://api.sofer.ai/v1/translation-styles/translation_style_id")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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://api.sofer.ai/v1/translation-styles/translation_style_id")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.sofer.ai/v1/translation-styles/translation_style_id', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.sofer.ai/v1/translation-styles/translation_style_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sofer.ai/v1/translation-styles/translation_style_id")! 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()
```