Skip to main content
GET
/
api
/
v1
/
collections
/
{collection_id}
/
files
List Collection Files
import requests

url = "https://www.datalab.to/api/v1/collections/{collection_id}/files"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
curl --request GET \
--url https://www.datalab.to/api/v1/collections/{collection_id}/files \
--header 'X-API-Key: <api-key>'
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://www.datalab.to/api/v1/collections/{collection_id}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://www.datalab.to/api/v1/collections/{collection_id}/files"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "files": [
    {
      "uploaded_file_id": 123,
      "original_filename": "<string>",
      "file_size": 123,
      "content_type": "<string>",
      "sort_order": 123,
      "source_type": "upload",
      "external_key": "<string>",
      "external_etag": "<string>",
      "external_last_modified": "2023-11-07T05:31:56Z",
      "external_deleted_at": "2023-11-07T05:31:56Z",
      "last_eval_score": 123,
      "last_score_breakdown": [
        123
      ]
    }
  ],
  "total": 123,
  "limit": 123,
  "has_more": true,
  "next_cursor": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

X-API-Key
string
header
required

Path Parameters

collection_id
integer
required

Query Parameters

limit
integer
default:50
Required range: x >= 1
cursor
string | null

Cookies

wos-session
string
datalab_active_team
string

Response

Successful Response

files
CollectionFileResponse · object[]
required
total
integer
required
limit
integer
required
has_more
boolean
required
next_cursor
string | null