# 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](/readme.md).

## 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](/quick-start/tools/track-requests.md).

## 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](/quick-start/documents/from-pdf.md).
* Need the broader document flow? See [Create a Briefing Document](/quick-start/documents/create-document.md).
* Need polling guidance? Review [Track Requests & Status Codes](/quick-start/tools/track-requests.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autocontentapi.com/quick-start/tools/upload-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
