Files
Upload and manage documents within your projects.
Supported File Types
| Type | Formats | Processing |
|---|---|---|
.pdf | Auto-extracted to text | |
| Images | .png, .jpg, .jpeg, .gif, .webp | Claude Vision API |
| Text | .txt, .md, .csv, .json | Read directly |
Note: Images are analyzed visually using Claude's native vision API. This enables OCR, chart reading, and visual content analysis.
Upload File
POST /api/files/upload?projectId=proj_abc123&filename=document.pdf
Content-Type: application/octet-stream
Query Parameters
| Parameter | Required | Description |
|---|---|---|
| projectId | Yes | Target project ID |
| filename | Yes | Name of the file |
| path | No | Relative path (e.g., reports/2024/file.pdf) |
Example - cURL
curl -X POST \
"https://api.getneji.com/api/files/upload?projectId=proj_abc123&filename=report.pdf" \
-H "Authorization: Bearer sk_your_key" \
-H "Content-Type: application/pdf" \
--data-binary @report.pdf
Example - JavaScript
const response = await fetch(
'https://api.getneji.com/api/files/upload?projectId=proj_abc123&filename=document.pdf',
{
method: 'POST',
headers: {
'Authorization': 'Bearer sk_your_key',
'Content-Type': 'application/pdf',
},
body: file,
}
);
Example - Python
import requests
with open('document.pdf', 'rb') as f:
response = requests.post(
'https://api.getneji.com/api/files/upload',
params={'projectId': 'proj_abc123', 'filename': 'document.pdf'},
headers={
'Authorization': 'Bearer sk_your_key',
'Content-Type': 'application/pdf'
},
data=f
)
Response
{
"success": true,
"fileId": "file_xyz789",
"filename": "document.pdf",
"size": 1048576,
"path": "document.pdf"
}
List Files
GET /api/files/projects/:projectId/files
Response
{
"success": true,
"files": [
{
"fileId": "file_xyz789",
"filename": "document.pdf",
"size": 1048576,
"mimeType": "application/pdf",
"uploadedAt": 1699999999999,
"extractionStatus": "completed"
}
]
}
Extraction Status Values
| Status | Description |
|---|---|
completed | PDF text extracted, ready for analysis |
pending | PDF queued for extraction |
not_applicable | Non-PDF file (ready immediately) |
Tip: Wait for
extractionStatus: "completed"before analyzing newly uploaded PDFs.
Download File
GET /api/files/:fileId/download
Delete File
DELETE /api/files/:fileId