# Domains

Part of the HebrewCore documentation. Web: https://hc.itsbaba.com/docs#domains · Whole docs: https://hc.itsbaba.com/docs.md · Index: https://hc.itsbaba.com/llms.txt

`domain` on `/v1/translate` and `/v1/translate/batch` tells protected translation what kind of text it is reading, so it knows which values to lock and which meaning changes to reject. There are four domains. `general` is the default; any other value turns protection on by itself, so you do not need `protect: true`.

| Domain | Use it for | Also protects | Extra checks |
| --- | --- | --- | --- |
| `general` *(default)* | Product, commerce, support, interface and everyday content. | The [standard set](https://hc.itsbaba.com/docs#protection): numbers, amounts, dates, identifiers, contact details, interface variables and your terms. | Every protected value and number comes back unchanged; negation, left/right and grammatical gender must match. |
| `finance` | Statements, payment and transfer notices, invoices, lending, insurance. Formal financial register. | IBANs (any country, including Israel), SWIFT/BIC codes, Israeli bank account numbers such as `12-345-678901`, Israeli ID numbers (9 digits with a check digit), card numbers (masked or full; the model only ever sees a placeholder), invoice, reference, policy and transaction numbers, signed currency amounts, percentages, basis points, interest rates and dates. | Direction words must match: credit/debit, deposit/withdrawal, increase/decrease, gain/loss, buy/sell, owe/are owed. Negation and every number are checked. |
| `legal` | Contracts, terms of service, privacy policies, notices and filings. Legal register. | Clause and section references: the label is translated and the number kept exactly (`Section 4.2` becomes `סעיף 4.2`; `Clause 7(b)`, `סעיף 12(א)` and `Article III` work the same way, and `§ 3` is kept whole). Defined terms (a Capitalized Term in quotes, or defined as `("the Company")`): translated once and used the same way in every later sentence, for example `(להלן: "החברה")`. Statute and case citations, kept as written (a Hebrew statute year such as `התשנ"ט-1999` becomes `5759-1999` in English and Russian). Party names you pass in `protected_terms`, dates and amounts. | Modality must match: shall/must against may, shall not/must not against may not, and will. Negation, numbers and references must be unchanged. |
| `clinical` | Patient instructions, care-team messages, clinical notes. Clinical register, for a clinician or a patient. | Drug names, doses, units, lab values, clinical codes and abbreviations. | The general checks with every drug, dose and lab value verbatim. `audience` and `patient_gender` apply. For streaming, record search and verification, use the [Clinical API](https://hc.itsbaba.com/docs#medical). |

A sentence that fails a check is retried once with a stronger model, told what was wrong. If it still fails, it comes back in the source language with `status: "fallback"` and an entry in `issues`, so a flipped "credit" or a "may" that became "shall" never reaches your users.

## Span Types

Every protected value is listed in `protection.spans` with a `type`. Personal and account data (`name`, `account`, `id_number`, `card`) is listed without a `value`, so it never appears in your logs through the response.

| Domain | Span types |
| --- | --- |
| Every domain | `term`, `glossary`, `number`, `ordinal`, `date`, `identifier`, `email`, `url`, `template` (interface variables), `keep`, `markup`, `code_inline`, `name` (redacted) |
| `finance` | `account` (IBAN, SWIFT/BIC, bank account), `id_number`, `card`, `reference` (invoice, policy, transaction). Amounts, percentages and basis points are `number`. |
| `legal` | `clause` (`value` is the number), `defined_term` (with its `render` in the target language), `citation` |
| `clinical` | `drug`, `dose`, `abbreviation`, `code` |

## Example: A Transfer Notice

```http
POST /v1/translate
{
  "text": "We debited ₪12,450.00 from account 12-345-678901 on 03/04/2026. Your interest rate increases by 0.25% to 4.75%.",
  "source_lang": "en",
  "target_lang": "he",
  "domain": "finance",
  "date_order": "DMY"
}

{
  "translation": {
    "text": "חייבנו את חשבון 12-345-678901 בסך ₪12,450.00 ב־3 באפריל 2026. שיעור הריבית שלך עולה ב־0.25% ל־4.75%.",
    "dir": "rtl",
    "protection": {
      "status": "ok",
      "spans": [
        { "type": "number", "value": "₪12,450.00" },
        { "type": "account" },
        { "type": "date", "value": "03/04/2026", "render": "3 באפריל 2026", "ambiguous_date": true },
        { "type": "number", "value": "0.25%" },
        { "type": "number", "value": "4.75%" }
      ],
      "issues": [],
      …
    },
    …
  }
}
```
