List Agent API source files in the current workspace with cursor pagination.
Endpoint
GET /agents/file
Returns 200 and a list envelope. Only source files uploaded through the Agent API in the current workspace are returned; artifacts and live environment files are not included.
Query parameterslimitinteger (optional)Number of items per page, default 20; 1..100 is recommendedorder string (optional)Sort direction, asc or desc, defaults to descafter string (optional)The last_id from the previous page; the cursor item is excludedbefore string (optional)The first_id from the previous page, for reverse pagination; cannot be used with afterPassing both after and before returns 400. A cursor that does not exist, has been deleted, or belongs to another workspace returns 404. | Request example |
Response fieldsobjectstringList object type, fixed as listdata arraySource files on this page; [] when emptyfirst_id string / nullFirst item ID on this page; null for an empty pagelast_id string / nullLast item ID on this page; null for an empty page; use it as afterhas_more booleanWhether the current scan direction has another pageEach source file in data[] uses the same fields as the retrieve source file response.Source file list items do not contain request_id; get the request identifier from the x-request-id response header.
data item id stringSource file IDobject stringSource file object type, fixed as filebytes integerFile size in bytescreated_at integerCreation time, Unix secondsfilename stringFile namestatus stringFile status: uploaded, processed, or error. processed means the file is usable; uploaded means it is uploaded and undergoing content moderation; error means processing failed or content moderation did not pass | Response example |
Error codes
| HTTP status | Error type / code | Solution |
|---|---|---|
400 | invalid_request_error / invalid_request_error | Fix limit, order, after, or before as described in the query parameters |
401 | authentication_error / invalid_api_key | Send a valid Authorization: Bearer $DASHSCOPE_API_KEY header |
404 | not_found_error / not_found_error | Use a valid source file cursor in the current workspace |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |