---
title: "Detect Schema"
method: POST
path: "/studio/v1/structured-rag/organizations/{organization_id}/schema-detection"
---

# Detect Schema

`POST /studio/v1/structured-rag/organizations/{organization_id}/schema-detection`

## Request

- Base URL: `https://api.ai21.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ai21.com/studio/v1/structured-rag/organizations/{organization_id}/schema-detection`
- Auth: none declared

## Path parameters

- `organization_id` string, required

## Request body

- DetectSchemaRequest
  - `documents` DocumentReference[], required
    - `document_id` string, uuid, required
    - `name` string, required
  - `queries` string[]

## Response `200`

Successful Response

- DetectSchemaResponse
  - `schema_name` string, required
  - `schema_definition` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ai21/apis/ai21-studio-api.md) - [All operations](https://skmtc.dev/ai21/apis/ai21-studio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ai21/apis/ai21-studio-api/revisions/b235ae533c95?raw)
