Sources API
Endpoints for managing sources within notebooks.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /notebooks/:notebookId/sources | List sources in a notebook |
| POST | /notebooks/:notebookId/sources | Add a new source |
| GET | /sources/:sourceId/status | Check processing status |
| DELETE | /sources/:sourceId | Delete a source |
List Sources
GET /notebooks/:notebookId/sourcesReturns all sources in a notebook.
Response
{
"data": [
{
"id": "src_123",
"type": "file",
"filename": "report.pdf",
"status": "completed",
"createdAt": "2024-01-15T10:30:00Z"
}
]
}Add Source
POST /notebooks/:notebookId/sourcesAdds a new source to a notebook.
File Upload
{
"type": "file",
"file": "<base64-encoded-content>",
"filename": "document.pdf"
}URL
{
"type": "url",
"url": "https://example.com/article"
}YouTube
{
"type": "youtube",
"url": "https://youtube.com/watch?v=..."
}Response
{
"data": {
"id": "src_456",
"type": "file",
"filename": "document.pdf",
"status": "pending",
"createdAt": "2024-01-21T09:00:00Z"
}
}Get Source Status
GET /sources/:sourceId/statusCheck the processing status of a source.
Response
{
"data": {
"id": "src_789",
"status": "completed",
"progress": 100,
"message": "Processing complete"
}
}Status Values
| Status | Description |
|---|---|
pending | Queued for processing |
processing | Currently being processed |
completed | Ready for use |
failed | Processing failed |
Delete Source
DELETE /sources/:sourceIdDeletes a source from its notebook.
Response
Returns 204 No Content on success.
Errors
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request or unsupported format |
| 404 | NOT_FOUND | Source or notebook not found |
| 413 | PAYLOAD_TOO_LARGE | File exceeds size limit |
Learn More
Last updated on