# Upload Private Files

Use `/files` when you want to keep a PDF or other source private instead of placing it at a public URL. Upload once, save the returned file ID, and reuse that ID in workflows that accept `type: "file"`.

For schema-level details, see the Files endpoints in the [API Documentation](https://docs.autocontentapi.com/readme).

## Before You Begin

* Have your API token ready (`Authorization: Bearer ...`).
* Uploads use `multipart/form-data`.
* The Files API accepts uploads up to `200 MB`.

## Step 1: Upload the File

```bash
curl -X POST "https://api.autocontentapi.com/files" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@/absolute/path/to/report.pdf"
```

The upload response includes the stored file record. Save its `id` and use that value anywhere a guide asks for `YOUR_FILE_ID`.

## Step 2: List Uploaded Files

Use the list endpoint to confirm the upload, recover an existing file ID, or inspect what is still stored:

```bash
curl -X GET "https://api.autocontentapi.com/files" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

## Step 3: Use the File ID in a Document Request

Briefing document flows can reference the uploaded file directly:

```bash
curl -X POST "https://api.autocontentapi.com/content/Create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "outputType": "briefing_doc",
    "format": "html",
    "resources": [
      {
        "type": "file",
        "content": "YOUR_FILE_ID"
      }
    ],
    "text": "Turn this uploaded report into an HTML briefing with headings, bullets, and recommended actions."
  }'
```

After submission, keep the returned request ID and follow [Track Requests & Status Codes](https://docs.autocontentapi.com/quick-start/tools/track-requests).

## Step 4: Delete a File You No Longer Need

```bash
curl -X DELETE "https://api.autocontentapi.com/files/YOUR_FILE_ID" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

## Tips

* Use uploaded file IDs when the source document is private or too large for a base64 payload.
* Keep your own mapping between business objects and file IDs if multiple workflows reuse the same uploaded asset.
* For briefing documents, uploaded file IDs are the cleanest way to reference internal PDFs repeatedly without exposing public URLs.

## Related Endpoints

* `POST /files` - Upload a file and receive its file ID.
* `GET /files` - List uploaded files.
* `DELETE /files/{id}` - Remove an uploaded file.

## What's Next?

* Create a document from that asset via [Create a Briefing Document from a PDF Upload](https://docs.autocontentapi.com/quick-start/documents/from-pdf).
* Need the broader document flow? See [Create a Briefing Document](https://docs.autocontentapi.com/quick-start/documents/create-document).
* Need polling guidance? Review [Track Requests & Status Codes](https://docs.autocontentapi.com/quick-start/tools/track-requests).
