Docs — API Reference/docs/api-reference/files
Files
Files are how non-text artifacts — PDFs, images, audio — enter the platform. Upload, then either attach the file id to a run or let ingestion write it into the context graph. Extraction is asynchronous; file.processed fires when the content is queryable.
[ 01 ]post — /v1/files
POST
/v1/filesUpload a file (multipart/form-data, max 100 MB). Extraction begins immediately.
| param | type | req | description |
|---|---|---|---|
| file | binary | required | The file payload. PDF, PNG, JPEG, WAV, M4A, and plain text supported. |
| purpose | string | required | "context" (ingest into the graph) or "attachment" (run-only). |
| metadata | object | optional | Up to 16 string key–value pairs. |
[ request ]POST
curl -X POST https://api.myndlabs.ai/v1/files \ -H "Authorization: Bearer $MYND_API_KEY" \ -F purpose=context \ -F file=@invoice-march.pdf
[ response ]200 ok
{
"id": "file_8c21aa04",
"object": "file",
"filename": "invoice-march.pdf",
"bytes": 184201,
"purpose": "context",
"status": "processing"
}[ 02 ]get — /v1/files/:id
GET
/v1/files/:idRetrieve a file's metadata and extraction status.
| param | type | req | description |
|---|---|---|---|
| id | string | required | File identifier. Path parameter. |
[ response ]200 ok
{
"id": "file_8c21aa04",
"object": "file",
"filename": "invoice-march.pdf",
"status": "processed",
"extracted": { "pages": 2, "tables": 1, "graph_items": 14 }
}[ 03 ]delete — /v1/files/:id
DELETE
/v1/files/:idDelete the file and every graph item extracted from it. Audit-log entries are retained.
| param | type | req | description |
|---|---|---|---|
| id | string | required | File identifier. Path parameter. |
[ response ]200 ok
{
"id": "file_8c21aa04",
"object": "file",
"deleted": true,
"graph_items_removed": 14
}More resources