---
title: "Identify contextual categories in the input."
method: POST
path: "/categories"
tags: ["categories"]
---

# Identify contextual categories in the input.

`POST /categories`

## Request

- Base URL: `https://api.rosette.com/rest/v1`
- URL: `https://api.rosette.com/rest/v1/categories`
- Auth: API key in header `X-RosetteAPI-Key`

Returns a category or categories identified in the input.  The possible categories are Tier 1 contextual categories defined in the QAG Taxonomy. The response is the contextual categories identified in the input.

## Request body

- union
  - object
    - `content` string
    - `language` string: 3 letter code of language.
    - `options` object
      - `scoreThreshold` number: override the internal default threshold
      - `singleLabel` boolean: return only a single category label per document
  - object
    - `contentUri` string
    - `language` string: 3 letter code of language.
    - `options` object
      - `scoreThreshold` number: override the internal default threshold
      - `singleLabel` boolean: return only a single category label per document

## Response `200`

OK

- CategoriesResponse
  - `categories` CategoryLabel[]: list of categories
    - `label` string: label for contextual category
    - `confidence` number: confidence (0.0 - 1.0)
    - `score` number: raw score (-INF - INF)

---

[API](https://skmtc.dev/babelstreet/apis/rosette-text-analytics.md) · [All operations](https://skmtc.dev/babelstreet/apis/rosette-text-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/babelstreet/apis/rosette-text-analytics/revisions/7c1d1497a5dd?raw)
