import requests
import json
url = "https://api.keywordsai.co/api/datasets/"
payload = json.dumps({
"name": "Support Conversations - July",
"description": "Sampled support chats for July",
"sampling": 40,
"start_time": "2025-07-01T00:00:00Z",
"end_time": "2025-07-31T23:59:59Z",
"initial_log_filters": {
"status_code": {
"operator": "eq",
"value": 200
}
}
})
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)