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

# Upload File

Upload a new file to the system for use in knowledge bases.

## Request Body

<ParamField body="file" type="file" required>
  The file to upload
</ParamField>

<ParamField body="tags" type="array">
  Optional tags for organizing the file
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.artaios.ai/api/v1/files/ \
    -H "x-api-key: YOUR_API_KEY" \
    -F "file=@/path/to/document.pdf" \
    -F "tags=manual,product"
  ```

  ```python Python theme={null}
  import requests

  files = {'file': open('/path/to/document.pdf', 'rb')}
  data = {'tags': ['manual', 'product']}

  response = requests.post(
      "https://api.artaios.ai/api/v1/files/",
      headers={"x-api-key": "YOUR_API_KEY"},
      files=files,
      data=data
  )
  file_info = response.json()
  ```

  ```javascript JavaScript theme={null}
  const formData = new FormData();
  formData.append('file', fileInput.files[0]);
  formData.append('tags', 'manual,product');

  const response = await fetch('https://api.artaios.ai/api/v1/files/', {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY'
    },
    body: formData
  });

  const fileInfo = await response.json();
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "id": "file_456",
  "original_filename": "document.pdf",
  "file_type": "document",
  "size_bytes": 2048576,
  "status": "uploading",
  "tags": ["manual", "product"],
  "created_at": "2025-01-15T10:30:00Z"
}
```

<Note>
  Files start with status "uploading" and transition to "active" once processing is complete.
</Note>
