---
title: "Creates a new data table without a file using row data provided in the request."
method: POST
path: "/api/v2/DataTables"
tags: ["DataTables"]
---

# Creates a new data table without a file using row data provided in the request.

`POST /api/v2/DataTables`

## Request

- Base URL: `https://api.slopesoftware.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.slopesoftware.com/api/v2/DataTables`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/slopesoftware/apis/akur8-life-api/docs/api/v2/DataTables/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new data table using row data provided directly in the request body.

**Limits:**
- Minimum: 1 row
- Maximum: 100,000 rows
- Request size: 10MB

**Row Format:**
Each row is an array of strings where values are **positional** - each position corresponds to a column in table structure order. Use empty string `""` for null/empty values at any position.

**Example 1:** For columns [Name (String), Age (Integer), Rate (Decimal)]:
- `["John", "25", "0.05"]` - all values
- `["John", "", "0.05"]` - Age is empty
- `["", "25", ""]` - Name and Rate are empty

**Example 2:** For columns [Name (String), Scenario (ScenarioTable), Active (Boolean)]:
- `["Base", "15", "true"]` - references ScenarioTable ID 15
- `["Alt", "", "true"]` - no ScenarioTable reference (empty string)

**Example 3:** For columns [Name (String), Mortality (MortalityTable), Nested (DataTable)]:
- `["Row1", "16757", "499", "42"]` - MortalityTable uses 2 positions, DataTable uses 1
- `["Row2", "", "", ""]` - all reference columns empty

**Supported Column Types:**
| Type | Values | Example |
|------|--------|--------|
| Integer (1) | 1 value | "100" |
| Decimal (2) | 1 value | "0.0123" |
| String (3) | 1 value | "Male" |
| Date (4) | 1 value | "2024-01-15" |
| Boolean (5) | 1 value | "true" or "false" |
| MortalityTable (6) | **2 values** | "16757", "499" |
| DataTable (7) | 1 value | "42" or "" |
| DropDownList (8) | 1 value | "Option1" |
| ScenarioTable (9) | 1 value | "15" or "" |

**Important:**
- MortalityTable columns expand to **2 positions** in the row array (decrementTableId, improvementScaleId)
- All other column types use **1 position** each
- Row length must equal: (column count) + (number of MortalityTable columns)
- Invalid DataTable/ScenarioTable reference IDs are silently cleared to empty
- Format matches GET /api/v1/DataTables/{id}/Data response

## Request body

- CreateDataTableRequestV2: Request model for creating a data table without a file
  - `tableStructureId` integer, required: Table Structure ID (required)
  - `name` string, required: Data Table Name (required)
  - `rows` array[], required: Table rows as a 2D array of string values. Values are positional - each position corresponds to a column in table structure order. Use empty string "" for null/empty values.
    - string[]
  - `indexes` DataTableIndexRequestV2[], nullable: Optional list of column indexes for table lookup optimization
    - `columnName` string, required: Column name to index (required)
    - `indexReadMethod` 'ExactMatch' | 'RangeLowerBound'

## Response `200`

Data table created successfully

- ImportDataTableResponseV2
  - `id` integer
  - `name` string, nullable
  - `tableStructureId` integer
  - `tableStructureName` string, nullable
  - `isFileOnly` boolean
  - `version` integer
  - `isLatestVersion` boolean

## Other responses

- `201`: Created
- `400`: Invalid request parameters or validation errors
- `401`: Unauthorized
- `403`: Forbidden - insufficient permissions
- `404`: Table structure not found
- `409`: Data table with the same name already exists for this table structure
- `429`: Too Many Requests

---

[API](https://skmtc.dev/slopesoftware/apis/akur8-life-api.md) - [All operations](https://skmtc.dev/slopesoftware/apis/akur8-life-api/llms.txt) - [OpenAPI document](https://skmtc.dev/slopesoftware/apis/akur8-life-api/revisions/9771b2c79880?raw)
