---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/services/nlp:analyzeEntities"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/services/nlp:analyzeEntities"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/services/nlp:analyzeEntities

`POST /v1/projects/{projectsId}/locations/{locationsId}/services/nlp:analyzeEntities`

## Request

- Base URL: `https://healthcare.googleapis.com`
- URL: `https://healthcare.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/services/nlp:analyzeEntities`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-healthcare`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-healthcare`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
- TypeScript: <https://skmtc.dev/google/apis/healthcare/docs/v1/projects/:projectsId/locations/:locationsId/services/nlp:analyzeEntities/post.ts> (a function with typed inputs; its response is checked against the schema)

Analyze heathcare entity in a document. Its response includes the recognized entity mentions and the relationships between them. AnalyzeEntities uses context aware models to detect entities.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Request body

- AnalyzeEntitiesRequest: The request to analyze healthcare entities in a document.
  - `alternativeOutputFormat` 'ALTERNATIVE_OUTPUT_FORMAT_UNSPECIFIED' | 'FHIR_BUNDLE': Optional. Alternative output format to be generated based on the results of analysis.
  - `documentContent` string: document_content is a document to be annotated.
  - `licensedVocabularies` string[]: A list of licensed vocabularies to use in the request, in addition to the default unlicensed vocabularies.

## Response `200`

Successful response

- AnalyzeEntitiesResponse: Includes recognized entity mentions and relationships between them.
  - `entities` Entity[]: The union of all the candidate entities that the entity_mentions in this response could link to. These are UMLS concepts or normalized mention content.
    - `entityId` string: entity_id is a first class field entity_id uniquely identifies this concept and its meta-vocabulary. For example, "UMLS/C0000970".
    - `preferredTerm` string: preferred_term is the preferred term for this concept. For example, "Acetaminophen". For ad hoc entities formed by normalization, this is the most popular unnormalized string.
    - `vocabularyCodes` string[]: Vocabulary codes are first-class fields and differentiated from the concept unique identifier (entity_id). vocabulary_codes contains the representation of this concept in particular vocabularies, such as ICD-10, SNOMED-CT and RxNORM. These are prefixed by the name of the vocabulary, followed by the unique code within that vocabulary. For example, "RXNORM/A10334543".
  - `entityMentions` EntityMention[]: The `entity_mentions` field contains all the annotated medical entities that were mentioned in the provided document.
    - `certaintyAssessment` Feature: A feature of an entity mention.
      - `confidence` number, double: The model's confidence in this feature annotation. A number between 0 and 1.
      - `value` string: The value of this feature annotation. Its range depends on the type of the feature.
    - `confidence` number, double: The model's confidence in this entity mention annotation. A number between 0 and 1.
    - `linkedEntities` LinkedEntity[]: linked_entities are candidate ontological concepts that this entity mention may refer to. They are sorted by decreasing confidence.
      - `entityId` string: entity_id is a concept unique identifier. These are prefixed by a string that identifies the entity coding system, followed by the unique identifier within that system. For example, "UMLS/C0000970". This also supports ad hoc entities, which are formed by normalizing entity mention content.
    - `mentionId` string: mention_id uniquely identifies each entity mention in a single response.
    - `subject` Feature: A feature of an entity mention.
      - `confidence` number, double: The model's confidence in this feature annotation. A number between 0 and 1.
      - `value` string: The value of this feature annotation. Its range depends on the type of the feature.
    - `temporalAssessment` Feature: A feature of an entity mention.
      - `confidence` number, double: The model's confidence in this feature annotation. A number between 0 and 1.
      - `value` string: The value of this feature annotation. Its range depends on the type of the feature.
    - `text` TextSpan: A span of text in the provided document.
      - `beginOffset` integer: The unicode codepoint index of the beginning of this span.
      - `content` string: The original text contained in this span.
    - `type` string: The semantic type of the entity: UNKNOWN_ENTITY_TYPE, ALONE, ANATOMICAL_STRUCTURE, ASSISTED_LIVING, BF_RESULT, BM_RESULT, BM_UNIT, BM_VALUE, BODY_FUNCTION, BODY_MEASUREMENT, COMPLIANT, DOESNOT_FOLLOWUP, FAMILY, FOLLOWSUP, LABORATORY_DATA, LAB_RESULT, LAB_UNIT, LAB_VALUE, MEDICAL_DEVICE, MEDICINE, MED_DOSE, MED_DURATION, MED_FORM, MED_FREQUENCY, MED_ROUTE, MED_STATUS, MED_STRENGTH, MED_TOTALDOSE, MED_UNIT, NON_COMPLIANT, OTHER_LIVINGSTATUS, PROBLEM, PROCEDURE, PROCEDURE_RESULT, PROC_METHOD, REASON_FOR_NONCOMPLIANCE, SEVERITY, SUBSTANCE_ABUSE, UNCLEAR_FOLLOWUP.
  - `fhirBundle` string: The FHIR bundle ([`R4`](http://hl7.org/fhir/R4/bundle.html)) that includes all the entities, the entity mentions, and the relationships in JSON format.
  - `relationships` EntityMentionRelationship[]: relationships contains all the binary relationships that were identified between entity mentions within the provided document.
    - `confidence` number, double: The model's confidence in this annotation. A number between 0 and 1.
    - `objectId` string: object_id is the id of the object entity mention.
    - `subjectId` string: subject_id is the id of the subject entity mention.

## Changes

- **2026-10-30** `7027c0ced7f9`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-healthcare` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-healthcare` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/healthcare/changes/v1/projects/:projectsId/locations/:locationsId/services/nlp:analyzeEntities/post.md)

---

[API](https://skmtc.dev/google/apis/healthcare.md) - [All operations](https://skmtc.dev/google/apis/healthcare/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/healthcare/revisions/7027c0ced7f9?raw)
