collections
Create Collection
Create a new collection.
POST
/
api
/
v1
/
collections
Create Collection
import requests
url = "https://www.datalab.to/api/v1/collections"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://www.datalab.to/api/v1/collections \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://www.datalab.to/api/v1/collections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.datalab.to/api/v1/collections"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 123,
"name": "<string>",
"description": "<string>",
"archived": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"file_count": 0,
"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
]
}
],
"s3_source": {
"id": 123,
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key_redacted": "<string>",
"sync_status": "<string>",
"last_sync_started_at": "2023-11-07T05:31:56Z",
"last_sync_completed_at": "2023-11-07T05:31:56Z",
"last_sync_file_count": 123,
"last_sync_error": "<string>",
"output_bucket": "<string>",
"output_prefix": "<string>",
"output_region": "<string>",
"output_aws_access_key_id": "<string>",
"output_aws_secret_access_key_redacted": "<string>",
"writeback_status": "<string>",
"last_writeback_run_id": 123,
"last_writeback_started_at": "2023-11-07T05:31:56Z",
"last_writeback_completed_at": "2023-11-07T05:31:56Z",
"last_writeback_file_count": 123,
"last_writeback_total_file_count": 123,
"last_writeback_failed_file_count": 123,
"last_writeback_error": "<string>",
"last_writeback_error_code": "<string>",
"last_writeback_manifest_uri": "<string>"
},
"s3_status": {
"collection_id": 123,
"sync_status": "<string>",
"writeback_status": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Create Collection
import requests
url = "https://www.datalab.to/api/v1/collections"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://www.datalab.to/api/v1/collections \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://www.datalab.to/api/v1/collections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.datalab.to/api/v1/collections"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 123,
"name": "<string>",
"description": "<string>",
"archived": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"file_count": 0,
"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
]
}
],
"s3_source": {
"id": 123,
"bucket": "<string>",
"prefix": "<string>",
"region": "<string>",
"aws_access_key_id": "<string>",
"aws_secret_access_key_redacted": "<string>",
"sync_status": "<string>",
"last_sync_started_at": "2023-11-07T05:31:56Z",
"last_sync_completed_at": "2023-11-07T05:31:56Z",
"last_sync_file_count": 123,
"last_sync_error": "<string>",
"output_bucket": "<string>",
"output_prefix": "<string>",
"output_region": "<string>",
"output_aws_access_key_id": "<string>",
"output_aws_secret_access_key_redacted": "<string>",
"writeback_status": "<string>",
"last_writeback_run_id": 123,
"last_writeback_started_at": "2023-11-07T05:31:56Z",
"last_writeback_completed_at": "2023-11-07T05:31:56Z",
"last_writeback_file_count": 123,
"last_writeback_total_file_count": 123,
"last_writeback_failed_file_count": 123,
"last_writeback_error": "<string>",
"last_writeback_error_code": "<string>",
"last_writeback_manifest_uri": "<string>"
},
"s3_status": {
"collection_id": 123,
"sync_status": "<string>",
"writeback_status": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}