> 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.

# Import XML Dump

POST https://api.markup.ai/style-agent/terminology/import/xml-dump
Content-Type: multipart/form-data

Import an Acrolinx terminology XML database dump. Maximum file size: 100MB.

**This replaces all existing terminology in the organization.** Every term,
category, and custom field is removed and rebuilt from the file.

Returns immediately with a job to poll via `GET /jobs/{job_id}` or
`GET /jobs/current`; the import continues in the background and can take
several minutes for a large dump. A file that fails validation is reported
on the job as a failure, not on this response.

Returns `413` if the file exceeds the size limit, and `409` if a publish or
import is already in progress — only one runs per organization at a time.

Reference: https://docs.markup.ai/developer-reference/api-reference/style-agent/terminology/import-xml-dump-endpoint

## Authentication

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

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `file` (file, required)

## Response

### 202

Successful Response

- `id` (string, required)
- `job_type` (string, required) — Either `publish` or `import`.
- `status` (string, required) — One of `queued`, `running`, `succeeded`, `failed`, or `canceled`. The first two mean the job is still holding the lock.
- `started_at` (datetime, required)
- `stage` (string, optional, nullable) — Coarse progress label while running; null once finished.
- `started_by` (string, optional, nullable) — Who started the job, for display.
- `finished_at` (datetime, optional, nullable)
- `error` (string, optional, nullable) — Why the job failed; null unless status is `failed`.
- `term_count` (integer, optional, nullable) — Terms published, for a successful publish.
- `stats` (map from string to integer, optional, nullable) — Per-record-type counts, for a successful import.
- `languages` (list of TerminologyJobLanguage, optional) — How each language fared, for a publish. Empty for an import, and for publishes that ran before per-language reporting existed.
- `import_term_filters` (list of ImportTermFilterOutcome, optional) — What an import did with each of the legacy terminology's saved term filters. Empty for a publish, and for imports that ran before this was reported.
- `publish_term_filters` (list of PublishTermFilterOutcome, optional) — What a publish did with each filter used for checking. Empty for an import, and for publishes that ran before this was reported.

## 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

### TerminologyJobLanguage

How one language's build ended, on a finished publish.

- `language` (string, required)
- `status` (string, required) — `succeeded`, `stored`, `failed`, or `empty`. `empty` means the organization has no terminology at all — a language with none of its own is published as a document with no entries and reports `succeeded`. `stored` means it was published but is not being served, because no language variant is configured for this language; publishing again once one is will serve it.
- `term_count` (integer, optional, default: 0)
- `error` (string, optional, nullable)

### ImportTermFilterOutcome

What an import did with one of the legacy terminology's saved term filters.

- `name` (string, required)
- `outcome` (enum, required) — `imported`: a filter targets used, saved here and used for checking, replacing any filter of the same name. `personal_view`: someone's own Term Browser view, not brought over. `skipped`: a filter targets used that was not brought over; `reason` says why.
  - Allowed values: `imported`, `personal_view`, `skipped`
- `owner` (string, optional, nullable) — The legacy user the filter belonged to.
- `reason` (string, optional, nullable)
- `replaced` (boolean, optional, default: false) — Imported over a filter of the same name made or edited here.

### PublishTermFilterOutcome

What a publish did with one filter used for checking.

- `name` (string, required)
- `outcome` (enum, required) — `published`: sent with the terminology as a term set of its name. `skipped`: not sent; `reason` says why.
  - Allowed values: `published`, `skipped`
- `reason` (string, optional, nullable)
- `term_counts` (map from string to integer, optional) — For a published filter: the terms it was sent with, by language.

### ValidationError

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

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "file": "<file: [object Object]>"
}
```

**Response**

```json
{
  "id": "string",
  "job_type": "string",
  "status": "string",
  "started_at": "2024-01-15T09:30:00Z",
  "stage": "string",
  "started_by": "string",
  "finished_at": "2024-01-15T09:30:00Z",
  "error": "string",
  "term_count": 1,
  "stats": {},
  "languages": [
    {
      "language": "string",
      "status": "string",
      "term_count": 0,
      "error": "string"
    }
  ],
  "import_term_filters": [
    {
      "name": "string",
      "outcome": "imported",
      "owner": "string",
      "reason": "string",
      "replaced": false
    }
  ],
  "publish_term_filters": [
    {
      "name": "string",
      "outcome": "published",
      "reason": "string",
      "term_counts": {}
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.markup.ai/style-agent/terminology/import/xml-dump"

files = { "file": "open('[object Object]', 'rb')" }
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.markup.ai/style-agent/terminology/import/xml-dump';
const form = new FormData();
form.append('file', '[object Object]');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

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/import/xml-dump"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("Authorization", "Bearer <token>")

	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/import/xml-dump")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\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.post("https://api.markup.ai/style-agent/terminology/import/xml-dump")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.markup.ai/style-agent/terminology/import/xml-dump', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => '[object Object]',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.markup.ai/style-agent/terminology/import/xml-dump");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "file",
    "fileName": "[object Object]"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

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