> ## Documentation Index
> Fetch the complete documentation index at: https://docs.documind.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Dynamic Schema

> Generate an extraction schema from a name and description

## Endpoint

```
POST https://api.documind.cloud/api/v1/generate-dynamic-schema/
```

## Authentication

Requires a valid API key.

## Request Body

| Field                | Type   | Required | Description                                       |
| -------------------- | ------ | -------- | ------------------------------------------------- |
| `schema_name`        | string | Yes      | Short name for the schema                         |
| `schema_description` | string | Yes      | Natural-language description of fields to extract |

## Response

```json theme={null}
{
  "named_entities": {
    "invoice_number": {
      "type": "string",
      "description": "Invoice identifier"
    }
  },
  "required": ["invoice_number"]
}
```

## Example

```python theme={null}
response = requests.post(
    "https://api.documind.cloud/api/v1/generate-dynamic-schema/",
    headers={"X-API-Key": API_KEY},
    json={
        "schema_name": "invoice",
        "schema_description": "Extract invoice number, vendor, issue date, and total amount"
    }
)

schema = response.json()
```
