List files - Writer AI Studio
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
cURL
curl --location --request GET https://api.writer.com/v1/files \
--header "Authorization: Bearer <token>"
import os
from writerai import Writer
client = Writer(
# This is the default and can be omitted
api_key=os.environ.get("WRITER_API_KEY"),
)
page = client.files.list()
page = page.data[0]
print(page.id)
import Writer from 'writer-sdk';
const client = new Writer({
apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
});
async function main() {
// Automatically fetches more pages as needed.
for await (const file of client.files.list()) {
console.log(file.id);
}
}
main();
Response Example
200
{
"data": [
{
"id": "7c36a365-392f-43ba-840d-8f3103b42572",
"name": "example.pdf",
"created_at": "2024-07-10T12:00:00Z",
"graph_ids": [
"31a8b75a-9a90-432f-8861-942229125333"
],
"status": "in_progress"
},
{
"id": "4bbe6207-737e-486f-a287-c5e95536984a",
"name": "image.jpg",
"created_at": "2024-07-09T15:30:00Z",
"graph_ids": [
"31a8b75a-9a90-432f-8861-942229125333"
],
"status": "completed"
},
{
"id": "efc86bb4-30a4-40c9-a52a-ecee0d7e071f",
"name": "document.txt",
"created_at": "2024-07-08T16:00:00Z",
"graph_ids": [
"31a8b75a-9a90-432f-8861-942229125333"
],
"status": "failed"
}
],
"has_more": false,
"first_id": "7c36a365-392f-43ba-840d-8f3103b42572",
"last_id": "efc86bb4-30a4-40c9-a52a-ecee0d7e071f"
}
Query Parameters
before: string - The ID of the first object in the previous page. This parameter instructs the API to return the previous page of results.after: string - The ID of the last object in the previous page. This parameter instructs the API to return the next page of results.limit: integer- default:50 - Specifies the maximum number of objects returned in a page. The default value is 50. The minimum value is 1, and the maximum value is 100. order: enum- default:desc - Specifies the order of the results. Valid values are ascfor ascending anddescfor descending.graph_id: string- The unique identifier of the graph to which the files belong. status: enum- Specifies the status of the files to retrieve. Valid values are in_progress,completedorfailed.file_types: string - The extensions of the files to retrieve. Separate multiple extensions with a comma. For example:pdf,jpg,docx.