Python
import requests
url = "https://app.langwatch.ai/api/v1/dataset/attachments"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {'X-Auth-Token': '<api-key>'}};
options.body = form;
fetch('https://app.langwatch.ai/api/v1/dataset/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/dataset/attachments \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-Token: <api-key>' \
--form file=@example-file{
"url": "<string>",
"name": "<string>",
"mediaType": "<string>",
"sizeBytes": 123
}This response has no body data.This response has no body data.This response has no body data.Datasets
Create Attachments
deprecated
Upload a file for an image or file column and get the reference a cell holds. The project is named by the projectId query parameter; the file goes in the file multipart field, with an optional datasetId field. create the upload, send the file to the address it answers, confirm it as a stored object, then put its reference in the cell
POST
/
api
/
v1
/
dataset
/
attachments
Python
import requests
url = "https://app.langwatch.ai/api/v1/dataset/attachments"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"X-Auth-Token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {'X-Auth-Token': '<api-key>'}};
options.body = form;
fetch('https://app.langwatch.ai/api/v1/dataset/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/dataset/attachments \
--header 'Content-Type: multipart/form-data' \
--header 'X-Auth-Token: <api-key>' \
--form file=@example-file{
"url": "<string>",
"name": "<string>",
"mediaType": "<string>",
"sizeBytes": 123
}This response has no body data.This response has no body data.This response has no body data.Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Query Parameters
The project the file is stored for.
Minimum string length:
1Body
multipart/form-data
Last modified on October 12, 2026
Was this page helpful?