> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/textual/tonic-textual-api/textual-rest-api/entity-linking.md).

# Entity linking

Use the Tonic Textual REST API to link entity values.

## Group entities

> Group entities together based on the original text

```json
{"openapi":"3.1.1","info":{"title":"Textual API","version":"vDev"},"tags":[{"name":"Synthesis","description":"Group detected entities for consistent synthesis across documents."}],"security":[{}],"paths":{"/api/Synthesis/group":{"post":{"tags":["Synthesis"],"summary":"Group entities","description":"Group entities together based on the original text","responses":{"200":{"description":"Returns grouped entities","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/GroupResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/GroupResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/GroupResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"description":"Request to group detected entities using entity linking.","allOf":[{"$ref":"#/components/schemas/GroupRequest"}]}},"text/json":{"schema":{"description":"Request to group detected entities using entity linking.","allOf":[{"$ref":"#/components/schemas/GroupRequest"}]}},"application/*+json":{"schema":{"description":"Request to group detected entities using entity linking.","allOf":[{"$ref":"#/components/schemas/GroupRequest"}]}}}}}}},"components":{"schemas":{"GroupResponse":{"type":"object","description":"Response containing entity groups produced by entity linking.","properties":{"entities":{"type":"array","items":{"$ref":"#/components/schemas/NerEntity"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/EntityGroup"}},"entity_linking_score_matrix":{"type":"array","items":{"type":"array","items":{"$ref":"#/components/schemas/EntityLinkingPairScoreSdkModel"}}}},"additionalProperties":false},"NerEntity":{"type":"object","description":"A detected named entity with its position, label, confidence score, and optional surrounding context.","properties":{"start":{"type":"integer","description":"Character offset where the entity starts in the text","format":"int32"},"end":{"type":"integer","description":"Character offset where the entity ends in the text","format":"int32"},"pythonStart":{"type":"integer","description":"Character offset where the entity starts (Python indexing)","format":"int32"},"pythonEnd":{"type":"integer","description":"Character offset where the entity ends (Python indexing)","format":"int32"},"label":{"type":"string","description":"The entity type label (e.g., NAME_GIVEN, EMAIL_ADDRESS)"},"text":{"type":"string","description":"The detected entity text"},"score":{"type":"number","description":"Confidence score between 0 and 1","format":"double"},"language":{"type":"string","description":"The language of the detected entity"},"exampleRedaction":{"type":"string","description":"An example of what the redacted replacement text looks like"},"head":{"type":"string","description":"Text immediately preceding the entity"},"tail":{"type":"string","description":"Text immediately following the entity"},"subNerEntities":{"type":"array","description":"Sub-entities detected within this entity","items":{"$ref":"#/components/schemas/NerEntity"}},"modelBasedEntityName":{"type":"string","description":"The configured model-based entity that produced this predicted label"}},"additionalProperties":false},"EntityGroup":{"type":"object","properties":{"pii_type":{"description":"The type of personally identifiable information detected by Solar.","enum":["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","ACCOUNT_NUMBER","DRIVERS_LICENSE_NUMBER","VEHICLE_ID"],"allOf":[{"$ref":"#/components/schemas/PiiTypeEnum"}]},"entity_indices":{"type":"array","items":{"type":"integer","format":"int32"}},"representative":{"type":"string"},"linking_edges":{"type":"array","items":{"$ref":"#/components/schemas/EntityLinkingEdgeSdkModel"}}},"additionalProperties":false},"PiiTypeEnum":{"type":"string","description":"The type of personally identifiable information detected by Solar.","enum":["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","ACCOUNT_NUMBER","DRIVERS_LICENSE_NUMBER","VEHICLE_ID"]},"EntityLinkingEdgeSdkModel":{"type":"object","properties":{"entityIndexA":{"type":"integer","format":"int32"},"entityIndexB":{"type":"integer","format":"int32"},"linkingConfidence":{"type":"number","format":"double"},"linkingConfidenceType":{"type":"string"}},"additionalProperties":false},"EntityLinkingPairScoreSdkModel":{"type":"object","description":"Confidence that two entity occurrences refer to the same real-world entity.\nDirect confidence can be below 0.5. Transitive confidence is derived from the\nstrongest path of direct links and is at least 0.5.","properties":{"linkingConfidence":{"type":"number","format":"double"},"linkingConfidenceType":{"type":"string"}},"additionalProperties":false},"GroupRequest":{"type":"object","description":"Request to group detected entities using entity linking.","properties":{"entities":{"type":"array","items":{"$ref":"#/components/schemas/NerEntity"}},"original_text":{"type":"string"},"include_entity_linking_scores":{"type":"boolean","description":"Include entity-linking confidence scores. The default value is False."},"entity_linking_score_limit":{"type":"integer","description":"Maximum number of entity-linking scores to return. Set to null for no limit.","format":"int32","maximum":2147483647,"minimum":1}},"additionalProperties":false}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tonic.ai/textual/tonic-textual-api/textual-rest-api/entity-linking.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
