---
title: "Analyze Text"
method: POST
path: "/text:analyze"
---

# Analyze Text

`POST /text:analyze`

A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

## Query parameters

- `api-version` string, required

## Request body

- AnalyzeTextOptions — The text analysis request.
  - `text` string, required — The text to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.
  - `categories` TextCategory[] — The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.
  - `blocklistNames` string[] — The names of blocklists.
  - `haltOnBlocklistHit` boolean — When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit.
  - `outputType` 'FourSeverityLevels' | 'EightSeverityLevels' — This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels".

## Response `200`

The request has succeeded.

- AnalyzeTextResult — The text analysis response.
  - `blocklistsMatch` TextBlocklistMatch[] — The blocklist match details.
    - `blocklistName` string, required — The name of the matched blocklist.
    - `blocklistItemId` string, required — The ID of the matched item.
    - `blocklistItemText` string, required — The content of the matched item.
  - `categoriesAnalysis` TextCategoriesAnalysis[], required — Analysis result for categories.
    - `category` 'Hate' | 'SelfHarm' | 'Sexual' | 'Violence', required — The harm category supported in Text content analysis.
    - `severity` integer — The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/cognitiveservices-contentsafety.md) · [All operations](https://skmtc.net/azure/apis/cognitiveservices-contentsafety/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/cognitiveservices-contentsafety/revisions/d4969093cba0/schema)
