---
title: "Classify free text into legal practice areas only."
method: GET
path: "/api/ask/classify"
tags: ["Matching"]
---

# Classify free text into legal practice areas only.

`GET /api/ask/classify`

## Request

- Base URL: `https://legal.ge`
- URL: `https://legal.ge/api/ask/classify`
- Auth: none declared

Lighter than /api/ask — returns just the matched categories with weighted scores and the keywords that fired. Useful when an agent wants to pick categories first, then query specialists separately.

## Query parameters

- `q` string, required
- `locale` 'ka' | 'en' | 'ru'

## Response `200`

OK

- ClassifyResponse
  - `query` string
  - `locale` 'ka' | 'en' | 'ru'
  - `matched_categories` MatchedCategory[]
    - `kind` 'category' | 'service': `category` = a legal practice area at some depth in the taxonomy. `service` = a specific service under a category. Services are the deepest level the matcher considers.
    - `id` string, uuid
    - `level` integer: Depth in the taxonomy: 1 = top-level practice area, 2/3 = sub-areas, 4+ = services (one level deeper than their parent category). The matcher narrows ancestors when a descendant matches.
    - `slug` string
    - `name` string
    - `match_confidence` 'curated' | 'name_fallback': `curated` = the node was matched via one or more admin-curated keywords (strong signal). `name_fallback` = the matcher only found a token overlap with the node name itself (weaker, used when no curated keyword fired).
    - `matched_keywords` string[]: Keywords from the user query that triggered this match.
    - `parent_chain` object[]: Ancestors of this node, in child-first order (closest parent first, root last). Lets a caller cite the broader practice area without an extra request.
      - `kind` 'category' | 'service'
      - `id` string, uuid
      - `level` integer
      - `slug` string
      - `name` string
  - `meta` object
    - `fallback_used` boolean

## Other responses

- `400`: Invalid request. The `error.code` field is machine-readable; possible values: `QUERY_REQUIRED`, `QUERY_TOO_LONG`, `INVALID_BODY`.
- `429`: Too many requests. The `Retry-After` header and `error.constraint.retry_after_seconds` both indicate when to retry.

---

[API](https://skmtc.dev/legal-ge/apis/legal-ge-public-api.md) · [All operations](https://skmtc.dev/legal-ge/apis/legal-ge-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/legal-ge/apis/legal-ge-public-api/revisions/060000c9c51b?raw)
