Skip to main content
GET
/
api
/
v1
/
files
/
{file_id}
Get File Metadata
import requests

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

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/files/{file_id} \
--header 'X-API-Key: <api-key>'
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://www.datalab.to/api/v1/files/{file_id}', 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/files/{file_id}"

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))

}
{
  "file_id": 123,
  "original_filename": "<string>",
  "content_type": "<string>",
  "file_size": 123,
  "upload_status": "<string>",
  "created": "2023-11-07T05:31:56Z",
  "reference": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

X-API-Key
string
header
required

Path Parameters

file_id
integer
required

Cookies

wos-session
string
datalab_active_team
string

Response

Successful Response

Response with file metadata.

file_id
integer
required

Unique file ID

original_filename
string
required

Original filename

content_type
string
required

MIME type

file_size
integer
required

File size in bytes

upload_status
string
required

Upload status: pending, completed, or failed

created
string<date-time>
required

Upload timestamp

reference
string
required

File reference in datalab://file-{id} format