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

> ## Agent Instructions
> Autumn AI (autumn.ai) is a people and company intelligence API, a separate company from useautumn.com (billing software); no billing-product routes exist here.
> Base URL https://api.autumn.ai. Auth on every request: `X-API-Key: <key>` or `Authorization: Bearer <key>`. Plain HTTP + JSON. Schemas: https://www.autumn.ai/docs/openapi.json. Every docs page is Markdown at its URL plus `.md`.

# Attach a CSV

> Upload a CSV, text, or markdown file and enrich every row in a task.

Autumn accepts `.csv`, `.txt`, `.md`, and `.markdown` uploads up to **10 MB and 10,000
rows**. Uploading is three calls: create a task to attach to, presign, then validate.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# 1. get a task to attach the file to (skip if you already have a task_id)
curl -X POST https://api.autumn.ai/tasks/draft \
  -H "X-API-Key: $AUTUMN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Lead enrichment"}'
# -> {"task_id":"ab12..."}

# 2. presign
curl -X POST https://api.autumn.ai/upload-url \
  -H "X-API-Key: $AUTUMN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"task_id":"ab12...","filename":"leads.csv"}'
# -> {"upload_url":"https://...","filename":"leads.csv"}

# 3. PUT the bytes to upload_url with NO Autumn auth headers, then validate
curl -X PUT "$UPLOAD_URL" -H "Content-Type: application/octet-stream" --data-binary @leads.csv

curl -X POST https://api.autumn.ai/validate-upload \
  -H "X-API-Key: $AUTUMN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"task_id":"ab12...","filename":"leads.csv"}'
```

<Warning>
  Send the `PUT` to `upload_url` **without** `X-API-Key` or `Authorization`. The presigned URL
  carries its own signature, and an extra auth header will be rejected.
</Warning>

## What validation returns

`/validate-upload` converts a CSV to task-local JSONL and returns the filename to pass as
`input_files`:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "filename": "upload_9f2c1ab3.jsonl",
  "rows": 240,
  "fields": ["name", "email", "company"],
  "renamed": [],
  "delimiter": ",",
  "extra_columns": 0
}
```

| Field           | Meaning                                                                                                                |
| --------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `filename`      | Pass this in `input_files` when starting or continuing a task.                                                         |
| `rows`          | Data rows accepted, excluding the header.                                                                              |
| `fields`        | Final column names, after de-duplication and blank-header naming.                                                      |
| `renamed`       | Columns Autumn had to rename, with the original name for each.                                                         |
| `delimiter`     | Detected delimiter. Comma unless the header parses as a single column, in which case `;`, tab, and `\|` are tried.     |
| `extra_columns` | Columns added because some row had more cells than the header. Those cells are kept as `column_N` rather than dropped. |

Check `renamed` and `extra_columns` before you rely on column names. A messy header is
repaired rather than rejected, so the names you get back may not be the names you sent.

<Note>
  Autumn reserves `_row_id` for its own row identity. A CSV that already has a `_row_id`
  column keeps its values under `_row_id_2`.
</Note>

## Enrich the uploaded rows

Pass the validated filename as `input_files` and describe the columns you want added:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://api.autumn.ai/task \
  -H "X-API-Key: $AUTUMN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "For every uploaded row, find the company domain, employee count, and current CEO name. Leave a field empty rather than guessing.",
    "input_files": ["upload_9f2c1ab3.jsonl"],
    "clarify": false
  }'
```

"Leave a field empty rather than guessing" is worth stating explicitly. Enrichment fills
what it can find, and an unstated bar becomes a guessed one. See
[Writing task prompts](/docs/best-practices/prompting).

Then wait for the turn to finish and read the rows back, exactly as for any other task:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS "https://api.autumn.ai/task/$TASK_ID/output?limit=1000" \
  -H "X-API-Key: $AUTUMN_API_KEY"
```

Enriched values come back as cells with `_sources`, so you can show where each filled value
came from. See [Outputs and sources](/docs/concepts/outputs).

`/upload-url` is rate limited per account. Exceeding it returns `429`; retry after a short
pause. See [Rate limits](/docs/api/rate-limits).

## Related

<CardGroup cols={2}>
  <Card title="Structured output" icon="braces" href="/docs/guides/structured-output">
    Declare the exact columns you want added.
  </Card>

  <Card title="Task lifecycle" icon="activity" href="/docs/concepts/lifecycle">
    Waiting for the enrichment turn to finish.
  </Card>
</CardGroup>
