---
title: "Group entities"
method: POST
path: "/api/Synthesis/group"
tags: ["Synthesis"]
---

# Group entities

`POST /api/Synthesis/group`

Group entities together based on the original text

## Request body

- GroupRequest — Request to group detected entities using entity linking.
  - `entities` NerEntity[]
    - `start` integer — Character offset where the entity starts in the text
    - `end` integer — Character offset where the entity ends in the text
    - `pythonStart` integer — Character offset where the entity starts (Python indexing)
    - `pythonEnd` integer — Character offset where the entity ends (Python indexing)
    - `label` string — The entity type label (e.g., NAME_GIVEN, EMAIL_ADDRESS)
    - `text` string — The detected entity text
    - `score` number, double — Confidence score between 0 and 1
    - `language` string, nullable — The language of the detected entity
    - `exampleRedaction` string, nullable — An example of what the redacted replacement text looks like
    - `head` string, nullable — Text immediately preceding the entity
    - `tail` string, nullable — Text immediately following the entity
    - `subNerEntities` NerEntity[], nullable — Sub-entities detected within this entity
  - `original_text` string

## Response `200`

Returns grouped entities

- GroupResponse — Response containing entity groups produced by entity linking.
  - `groups` EntityGroup[]
    - `pii_type` 'NUMERIC_VALUE' | 'LANGUAGE' | 'MONEY' | 'PRODUCT' | 'EVENT' | 'LAW' | 'US_PASSPORT' | 'MEDICAL_LICENSE' | 'DATE_TIME' | 'US_BANK_NUMBER' | 'NRP' | 'US_SSN' | 'IP_ADDRESS' | 'ORGANIZATION' | 'PHONE_NUMBER' | 'US_ITIN' | 'LOCATION' | 'LOCATION_ADDRESS' | 'LOCATION_CITY' | 'LOCATION_STATE' | 'LOCATION_ZIP' | 'LOCATION_COUNTRY' | 'CREDIT_CARD' | 'EMAIL_ADDRESS' | 'IBAN_CODE' | 'URL' | 'NAME_GIVEN' | 'NAME_FAMILY' | 'GENDER_IDENTIFIER' | 'OCCUPATION' | 'PERSON_AGE' | 'DOB' | 'CC_EXP' | 'CVV' | 'MICR_CODE' | 'HEALTHCARE_ID' | 'NUMERIC_PII' | 'LOCATION_COMPLETE_ADDRESS' | 'US_ROUTING_TRANSIT_NUMBER' — The type of personally identifiable information (PII) detected, such as NAME_GIVEN, EMAIL_ADDRESS, or CREDIT_CARD.
    - `entities` NerEntity[]
      - `start` integer — Character offset where the entity starts in the text
      - `end` integer — Character offset where the entity ends in the text
      - `pythonStart` integer — Character offset where the entity starts (Python indexing)
      - `pythonEnd` integer — Character offset where the entity ends (Python indexing)
      - `label` string — The entity type label (e.g., NAME_GIVEN, EMAIL_ADDRESS)
      - `text` string — The detected entity text
      - `score` number, double — Confidence score between 0 and 1
      - `language` string, nullable — The language of the detected entity
      - `exampleRedaction` string, nullable — An example of what the redacted replacement text looks like
      - `head` string, nullable — Text immediately preceding the entity
      - `tail` string, nullable — Text immediately following the entity
      - `subNerEntities` NerEntity[], nullable — Sub-entities detected within this entity
    - `representative` string, nullable

---

[API](https://skmtc.net/tonic/apis/textual-api.md) · [All operations](https://skmtc.net/tonic/apis/textual-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tonic/textual-api/revisions/41da8739a690/schema)
