> For the complete documentation index, see [llms.txt](https://docs.autocontentapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autocontentapi.com/quick-start/data-tables/create-data-table.md).

# Create a Data Table

Generate spreadsheet-ready data tables by calling `/content/Create` with `outputType: "datatable"`. Data table jobs are asynchronous: submit the job, poll `/content/Status/{id}`, then download the completed spreadsheet from `/data-tables/{id}/download`.

## Step 1: Create the Data Table Request

```bash
curl -X POST "https://api.autocontentapi.com/content/Create" \
  -H "accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "outputType": "datatable",
    "resources": [
      {
        "type": "website",
        "content": "https://example.com/market-report"
      }
    ],
    "text": "Extract the named companies, market segment, funding stage, region, and one-sentence positioning into a clean comparison table.",
    "language": "English"
  }'
```

Example response:

```json
{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 0
}
```

Save the `request_id`. It is also the data table ID used by the `/data-tables` endpoints.

## Step 2: Poll for Status

```bash
curl -X GET "https://api.autocontentapi.com/content/Status/550e8400-e29b-41d4-a716-446655440000" \
  -H "accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

While processing, treat any `status` from `1` to `99` as still running.

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 80,
  "updated_on": "2026-03-11T19:10:00Z",
  "error_code": 0,
  "requested_on": "2026-03-11T19:08:00Z"
}
```

## Step 3: Read the Completed Status Payload

When `status` reaches `100`, the status response exposes the generated file URL in both `datatable_url` and `share_url`.

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 100,
  "audio_url": "",
  "video_url": "",
  "image_url": "",
  "response_text": "",
  "requested_on": "2026-03-11T19:08:00Z",
  "updated_on": "2026-03-11T19:12:00Z",
  "request_type_id": 1,
  "error_code": 0,
  "error_on": null,
  "citations": [],
  "file_size": 0,
  "audio_duration": 0,
  "share_url": "https://autocontentapi.blob.core.windows.net/audios/datatable-550e8400.xlsx",
  "datatable_url": "https://autocontentapi.blob.core.windows.net/audios/datatable-550e8400.xlsx"
}
```

Use `datatable_url` when you only need the hosted file URL. Use the authenticated download endpoint below when you want the API to verify ownership and stream the file with download headers.

## Step 4: Use the Data Tables API

### List Data Tables

```bash
curl -X GET "https://api.autocontentapi.com/data-tables/get?page=1&pageSize=10" \
  -H "accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

Example response:

```json
{
  "items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "url": "https://autocontentapi.blob.core.windows.net/audios/datatable-550e8400.xlsx",
      "createdOn": "2026-03-11T19:12:00Z",
      "status": 100
    }
  ],
  "totalCount": 1,
  "page": 1,
  "pageSize": 10,
  "totalPages": 1
}
```

The list includes in-progress data table requests. In-progress rows have `status` below `100` and `url: null`.

### Download a Data Table

```bash
curl -L "https://api.autocontentapi.com/data-tables/550e8400-e29b-41d4-a716-446655440000/download" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -o generated-table.xlsx
```

The API streams the generated spreadsheet as an attachment. The file extension is inferred from the stored asset and content type, usually `.xlsx`.

## Supported Source Types

Data tables use the same source model as the general content endpoint:

| Type      | Description                  | Example                                      |
| --------- | ---------------------------- | -------------------------------------------- |
| `website` | Public web page URL          | `"https://example.com/report"`               |
| `youtube` | YouTube video URL            | `"https://www.youtube.com/watch?v=VIDEO_ID"` |
| `text`    | Direct text source material  | `"Company A raised $10M..."`                 |
| `pdf`     | Base64-encoded PDF payload   | `"BASE64_ENCODED_PDF"`                       |
| `file`    | File ID returned by `/files` | `"YOUR_FILE_ID"`                             |

You can also use `topic`, `feedSelections`, `researches`, `podcastEpisodeIds`, and `projects` when those sources are available in your account.

## Prompting Tips

1. Name the columns you want in `text`.
2. Ask for normalized values when the source has inconsistent labels.
3. Use a source with enough structured facts; data table generation works best when the input contains comparable entities, dates, metrics, categories, or rankings.
4. Poll `/content/Status/{id}` before downloading. `/data-tables/{id}/download` returns `404` until the asset is ready.

## Error Handling

If generation fails, `/content/Status/{id}` returns the same error metadata used by other asynchronous content jobs:

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 0,
  "error_code": 500,
  "error_message": "Unable to process this request right now. Please try again.",
  "error_on": "2026-03-11T19:09:30Z",
  "requested_on": "2026-03-11T19:08:00Z"
}
```

## What's Next?

* 📋 Browse the [Data Table Scenario Examples](/quick-start/data-tables/data-table-examples.md)
* 🧭 Review [Track Requests & Status Codes](/quick-start/tools/track-requests.md)
* 📁 Upload private source files with [Upload Private Files](/quick-start/tools/upload-files.md)
