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

# Update Term

PUT https://api.markup.ai/style-agent/terminology/terms/{term_id}
Content-Type: application/json

Update a term. Omitted fields are left unchanged.

`category_ids` replaces the term's whole set of domains and other
categories, so send every category the term should keep. Custom field
values are replaced only for the fields included. To move an entry to
another domain, update each of its terms.

Returns `404` if the term does not exist, and `400` if a referenced
category does not exist in this organization.

Reference: https://docs.markup.ai/developer-reference/api-reference/style-agent/terminology/update-term

## Authentication

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

## Request

### Path parameters

- `term_id` (string, required)

### Body (application/json)

This endpoint expects a StyleAgentTermUpdateRequest.

- `surface` (string, optional, nullable)
- `language_id` (string, optional, nullable)
- `status_id` (string, optional, nullable)
- `msr_id` (string, optional, nullable)
- `variantsconfigurations` (string, optional, nullable) — Raw variant configuration (newline-separated key=value). Prefer `variant_settings`; send one or the other.
- `variant_settings` (TermVariantSettings, optional, nullable) — How variants of one term are matched during checking.
- `category_ids` (list of string, optional, nullable)
- `custom_field_values` (list of CustomFieldValueInput, optional, nullable)
- `lemma_start` (integer, optional, nullable) — Character offset in `surface` of the word whose grammatical forms are checked. Send with `lemma_length`.
- `lemma_length` (integer, optional, nullable) — Length of that word; 0 turns off checking of grammatical forms.

## Response

### 200

Successful Response

- `id` (string, required) — Identifier used by this API.
- `uuid` (string, required) — The term's stable uuid, as in ACTIF `term/uuid`; searchable with `term_uuid`.
- `external_id` (string, required) — The term's ID, as in ACTIF `term/id`.
- `conceptid` (string, required) — The entry's ID, as in ACTIF `entry/id`.
- `conceptuuid` (string, required) — The entry's uuid, as in ACTIF `entry/uuid`; searchable with `entry_uuid`.
- `isconcept` (string, required) — `t` for the entry's head (primary) term, `f` otherwise.
- `surface` (SurfaceResponse, optional, nullable)
- `language` (CategoryResponse, optional, nullable) — One category: a language, status, domain, part of speech, or a value of a custom category type.
- `status` (CategoryResponse, optional, nullable) — One category: a language, status, domain, part of speech, or a value of a custom category type.
- `msr` (CategoryResponse, optional, nullable) — One category: a language, status, domain, part of speech, or a value of a custom category type.
- `categories` (list of CategoryResponse, optional, default: [])
- `variantsconfigurations` (string, optional, nullable)
- `variant_settings` (TermVariantSettings, optional) — How variants of one term are matched during checking.
- `frequency` (integer, optional, default: 0)
- `creationdate` (datetime, optional, nullable)
- `creator` (string, optional, nullable)
- `lastmodificationdate` (datetime, optional, nullable)
- `lastmodifier` (string, optional, nullable)
- `linked_term_count` (integer, optional, default: 0)
- `member_count` (integer, optional, default: 0)
- `custom_fields` (map from string to string, optional, default: {})
- `custom_field_values` (list of CustomFieldValueResponse, optional, default: [])

## Errors

### 401 Unauthorized Error

Authentication failed or no valid API key provided.

- `detail` (string, required) — A description of the error that occurred.
- `status` (integer, required) — The HTTP status code generated by the server for this issue
- `request_id` (string, required) — A unique ID associated with the HTTP request.

### 403 Forbidden Error

Forbidden

- `detail` (string, required) — A description of the error that occurred.
- `status` (integer, required) — The HTTP status code generated by the server for this issue
- `request_id` (string, required) — A unique ID associated with the HTTP request.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Internal Server Error

Internal Server Error

- `detail` (string, required) — A description of the error that occurred.
- `status` (integer, required) — The HTTP status code generated by the server for this issue
- `request_id` (string, required) — A unique ID associated with the HTTP request.

## Types

### TermVariantSettings

How variants of one term are matched during checking.

- `rules` (TermVariantRuleOverrides, optional) — Per-term overrides of the account-wide variant rules. Null uses the account-wide value.
- `bosForms` (list of string, optional) — Forms accepted at the beginning of a sentence.
- `titleForms` (list of string, optional) — Forms accepted as the title form.
- `alwaysFlag` (list of string, optional) — Variants that are always flagged.
- `neverFlag` (list of string, optional) — Variants that are never flagged.

### CustomFieldValueInput

One custom field's value(s) to persist for a term. `string_value` carries TEXT/HTML/IMAGE_URL fields; `category_ids` carries CATEGORY (one id) and CATEGORIES (many ids) fields. They are mutually exclusive per field — the field's type decides which applies. An empty `category_ids` with no `string_value` clears the field for that term.

- `field_id` (string, required)
- `string_value` (string, optional, nullable)
- `category_ids` (list of string, optional)

### SurfaceResponse

- `surface` (string, required)
- `lemmastart` (integer, required)
- `lemmalength` (integer, required)
- `lowercasesurface` (string, optional, nullable)

### CategoryResponse

One category: a language, status, domain, part of speech, or a value of a custom category type.

- `id` (string, required) — Identifier used by this API.
- `type` (string, required) — Category type ID
- `name` (string, required) — Name, unique within the type; for languages, the language code such as `en`.
- `displayname` (string, required)
- `issystem` (boolean, required)
- `uuid` (string, required) — Stable identifier carried over from Acrolinx terminology.
- `external_id` (string, required)
- `parent` (string, optional, nullable)
- `priority` (integer, optional, nullable)

### CustomFieldValueResponse

One custom field's value for a term. Text fields carry `string_value`; category fields carry `category_values`, with every selected category of a multi-select field in one entry. `field_uuid` is the field's stable identifier carried over from Acrolinx terminology and kept across import and export.

- `field_id` (string, required)
- `field_uuid` (string, required)
- `name` (string, required)
- `displayname` (string, required)
- `type` (string, required)
- `isconceptlevel` (boolean, required)
- `ismultiline` (boolean, required)
- `location` (integer, required)
- `string_value` (string, optional, nullable)
- `category_values` (list of CategoryResponse, optional, default: [])

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### TermVariantRuleOverrides

Per-term overrides of the account-wide variant rules. Null uses the account-wide value.

- `flagVariants` (boolean, optional, nullable)
- `allowHyphen` (boolean, optional, nullable)
- `allowTitleAnywhere` (boolean, optional, nullable)
- `allowUpperCase` (boolean, optional, nullable)
- `allowBOS` (boolean, optional, nullable)
- `requireBOSFormAtBOS` (boolean, optional, nullable)
- `upperCaseTitleAfterHyphen` (boolean, optional, nullable)
- `applyMcatRestriction` (boolean, optional, nullable)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "string",
  "uuid": "string",
  "external_id": "string",
  "conceptid": "string",
  "conceptuuid": "string",
  "isconcept": "string",
  "surface": {
    "surface": "string",
    "lemmastart": 1,
    "lemmalength": 1,
    "lowercasesurface": "string"
  },
  "language": {
    "id": "string",
    "type": "string",
    "name": "string",
    "displayname": "string",
    "issystem": true,
    "uuid": "string",
    "external_id": "string",
    "parent": "string",
    "priority": 1
  },
  "status": {
    "id": "string",
    "type": "string",
    "name": "string",
    "displayname": "string",
    "issystem": true,
    "uuid": "string",
    "external_id": "string",
    "parent": "string",
    "priority": 1
  },
  "msr": {
    "id": "string",
    "type": "string",
    "name": "string",
    "displayname": "string",
    "issystem": true,
    "uuid": "string",
    "external_id": "string",
    "parent": "string",
    "priority": 1
  },
  "categories": [
    {
      "id": "string",
      "type": "string",
      "name": "string",
      "displayname": "string",
      "issystem": true,
      "uuid": "string",
      "external_id": "string",
      "parent": "string",
      "priority": 1
    }
  ],
  "variantsconfigurations": "string",
  "variant_settings": {
    "rules": {
      "flagVariants": true,
      "allowHyphen": true,
      "allowTitleAnywhere": true,
      "allowUpperCase": true,
      "allowBOS": true,
      "requireBOSFormAtBOS": true,
      "upperCaseTitleAfterHyphen": true,
      "applyMcatRestriction": true
    },
    "bosForms": [
      "string"
    ],
    "titleForms": [
      "string"
    ],
    "alwaysFlag": [
      "string"
    ],
    "neverFlag": [
      "string"
    ]
  },
  "frequency": 0,
  "creationdate": "2024-01-15T09:30:00Z",
  "creator": "string",
  "lastmodificationdate": "2024-01-15T09:30:00Z",
  "lastmodifier": "string",
  "linked_term_count": 0,
  "member_count": 0,
  "custom_fields": {},
  "custom_field_values": [
    {
      "field_id": "string",
      "field_uuid": "string",
      "name": "string",
      "displayname": "string",
      "type": "string",
      "isconceptlevel": true,
      "ismultiline": true,
      "location": 1,
      "string_value": "string",
      "category_values": [
        {
          "id": "string",
          "type": "string",
          "name": "string",
          "displayname": "string",
          "issystem": true,
          "uuid": "string",
          "external_id": "string",
          "parent": "string",
          "priority": 1
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.markup.ai/style-agent/terminology/terms/term_id"

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

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

print(response.json())
```

```javascript
const url = 'https://api.markup.ai/style-agent/terminology/terms/term_id';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', '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.markup.ai/style-agent/terminology/terms/term_id"

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

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

	req.Header.Add("Authorization", "Bearer <token>")
	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.markup.ai/style-agent/terminology/terms/term_id")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
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.put("https://api.markup.ai/style-agent/terminology/terms/term_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.markup.ai/style-agent/terminology/terms/term_id', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.markup.ai/style-agent/terminology/terms/term_id");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.markup.ai/style-agent/terminology/terms/term_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```