Resources
Upload documents into a workspace and track their ingestion.
A resource is one uploaded document. Uploading it starts an asynchronous ingestion pipeline; it can only be answered from once that pipeline reaches ready.
List resources
Lists the workspace's resources, newest first. Check status before assuming a resource is answerable.
/workspaces/{workspace_id}/resources/| Field | Type | Description |
|---|---|---|
page | integer | 1-based page number. Defaults to 1. |
page_size | integer | Results per page. Defaults to 30, capped at 200. |
curl "https://api.daneshyar.info/api/v1/workspaces/8f14e45f-ceea-467a-9f4c-1a2b3c4d5e6f/resources/" \
-H "X-API-Key: dk_live_9f3aC2xQ7mB1vT8sE4nK6pR0jY5wZ2hL"Upload a resource
Uploads a file and queues it for ingestion. The request is multipart, and the response returns immediately with status queued — ingestion has not run yet.
/workspaces/{workspace_id}/resources/| Field | Type | Description |
|---|---|---|
file (required) | file | The document to ingest. PDF, JPG/PNG, MP3/WAV or MP4/MOV, up to 100 MB. |
title | string | Display name. Defaults to the uploaded file's own name when omitted. |
Accepted files:
| Type | Extensions | Notes |
|---|---|---|
pdf | Documents. Text is extracted page by page. | |
image | JPG · JPEG · PNG | Images. Described by the model; they produce no readable segments. |
voice | MP3 · WAV | Audio. Transcribed, with timestamps kept on each passage. |
video | MP4 · MOV | Video. The audio track is transcribed the same way. |
curl -X POST "https://api.daneshyar.info/api/v1/workspaces/8f14e45f-ceea-467a-9f4c-1a2b3c4d5e6f/resources/" \
-H "X-API-Key: dk_live_9f3aC2xQ7mB1vT8sE4nK6pR0jY5wZ2hL" \
-F "file=@discharge-protocol-2026.pdf" \
-F "title=Discharge protocol 2026"{
"status": "ok",
"data": {
"id": "3c9a1b77-0d24-4e8b-b0f1-7a5e9c2d4b81",
"title": "Discharge protocol 2026.pdf",
"type": "pdf",
"file_url": "https://api.daneshyar.info/media/resources/discharge-protocol-2026.pdf",
"extension": "pdf",
"size": 482913,
"status": "queued",
"summary": "",
"key_notes": [],
"error_message": "",
"workspace_id": "8f14e45f-ceea-467a-9f4c-1a2b3c4d5e6f",
"created_at": "2026-08-05T09:20:41.702Z",
"updated_at": "2026-08-05T09:20:41.702Z"
}
}Retrieve a resource
Returns one resource, including its current status. This is the endpoint you poll while waiting for ingestion.
/workspaces/{workspace_id}/resources/{resource_id}/| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier, assigned by the server. |
title | string | Display name. Defaults to the uploaded file's own name when omitted. |
type | pdf | image | voice | video | text | Detected from the file extension — you don't set it. |
file_url | string | Direct URL to the stored original. |
extension | string | Lowercased file extension, without the dot. |
size | integer | File size in bytes. |
status | queued | vectorizing | ready | limited | failed | Where the file is in the ingestion pipeline. Only a ready resource can be answered from. |
summary | string | Model-written summary of the document. Empty until ingestion finishes. |
key_notes | object[] | Extracted notes, each an object with a note and (except for images) its source metadata. |
error_message | string | Why ingestion failed. Empty unless status is failed. |
workspace_id | uuid | The workspace this resource belongs to. |
created_at | datetime | ISO 8601 timestamp of creation. |
updated_at | datetime | ISO 8601 timestamp of the last change. |
curl "https://api.daneshyar.info/api/v1/workspaces/8f14e45f-ceea-467a-9f4c-1a2b3c4d5e6f/resources/3c9a1b77-0d24-4e8b-b0f1-7a5e9c2d4b81/" \
-H "X-API-Key: dk_live_9f3aC2xQ7mB1vT8sE4nK6pR0jY5wZ2hL"{
"status": "ok",
"data": {
"id": "3c9a1b77-0d24-4e8b-b0f1-7a5e9c2d4b81",
"title": "Discharge protocol 2026.pdf",
"type": "pdf",
"file_url": "https://api.daneshyar.info/media/resources/discharge-protocol-2026.pdf",
"extension": "pdf",
"size": 482913,
"status": "ready",
"summary": "A twelve-page protocol covering post-operative discharge criteria...",
"key_notes": [
{
"note": "Patients on anticoagulants require a 48-hour observation window.",
"metadata": { "source_type": "pdf", "page": 4, "line": 112 }
}
],
"error_message": "",
"workspace_id": "8f14e45f-ceea-467a-9f4c-1a2b3c4d5e6f",
"created_at": "2026-08-05T09:20:41.702Z",
"updated_at": "2026-08-05T09:23:07.884Z"
}
}Retry a resource
Puts a stopped resource back through ingestion. It is accepted only from limited (the AI provider rate-limited us mid-run) or failed — any other status is a 400. There is no automatic retry behind it, so for a limited resource this call is the only way it ever finishes.
Ingestion resumes rather than restarts: if the extracted text was already stored, extraction and summarizing are skipped and only the indexing runs again. The response is the resource back at status queued, so poll it exactly as you would after an upload.
/workspaces/{workspace_id}/resources/{resource_id}/retry/curl -X POST "https://api.daneshyar.info/api/v1/workspaces/8f14e45f-ceea-467a-9f4c-1a2b3c4d5e6f/resources/3c9a1b77-0d24-4e8b-b0f1-7a5e9c2d4b81/retry/" \
-H "X-API-Key: dk_live_9f3aC2xQ7mB1vT8sE4nK6pR0jY5wZ2hL"Delete a resource
Deletes the resource and its indexed passages. Answers already given keep their citations, but the resource stops being retrievable.
/workspaces/{workspace_id}/resources/{resource_id}/curl -X DELETE "https://api.daneshyar.info/api/v1/workspaces/8f14e45f-ceea-467a-9f4c-1a2b3c4d5e6f/resources/3c9a1b77-0d24-4e8b-b0f1-7a5e9c2d4b81/" \
-H "X-API-Key: dk_live_9f3aC2xQ7mB1vT8sE4nK6pR0jY5wZ2hL"{
"status": "ok",
"data": { "message": "Resource deleted" }
}