curl --request POST \
--url https://api.sixtyfour.ai/monitors/upload \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'config=<string>'import requests
url = "https://api.sixtyfour.ai/monitors/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "config": "<string>" }
response = requests.post(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('config', '<string>');
const options = {method: 'POST'};
options.body = form;
fetch('https://api.sixtyfour.ai/monitors/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sixtyfour.ai/monitors/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sixtyfour.ai/monitors/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sixtyfour.ai/monitors/upload")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sixtyfour.ai/monitors/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"team_id": "<string>",
"name": "<string>",
"frequency": "<string>",
"struct": {},
"tier": "<string>",
"subject_type": "<string>",
"research_plan": "<string>",
"is_active": true,
"disabled_reason": "<string>",
"webhook_url": "<string>",
"webhook_event_types": [
"<string>"
],
"metadata": {},
"last_run_at": "<string>",
"next_run_times": [
"<string>"
],
"row_count": 123,
"active_row_count": 123,
"status": "starting",
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": "Invalid request body"
}{
"detail": "Invalid API key"
}{
"detail": "This organization no longer has access to Sixtyfour. Contact your representative at Sixtyfour."
}{
"detail": "<string>"
}{
"detail": "Internal server error"
}{
"detail": "Could not verify the API key right now. Retry shortly."
}Create Monitor From A File
Create one monitor from a file, with a row per subject.
Answers as soon as the file has been checked and the monitor exists, with a
status of starting. Its rows are added afterwards; read the monitor
again to see row_count climb and status become active. Sending the
same request again returns the same monitor, and finishes it if the first
attempt was interrupted.
curl --request POST \
--url https://api.sixtyfour.ai/monitors/upload \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form 'config=<string>'import requests
url = "https://api.sixtyfour.ai/monitors/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "config": "<string>" }
response = requests.post(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('config', '<string>');
const options = {method: 'POST'};
options.body = form;
fetch('https://api.sixtyfour.ai/monitors/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sixtyfour.ai/monitors/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sixtyfour.ai/monitors/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sixtyfour.ai/monitors/upload")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sixtyfour.ai/monitors/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"config\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"team_id": "<string>",
"name": "<string>",
"frequency": "<string>",
"struct": {},
"tier": "<string>",
"subject_type": "<string>",
"research_plan": "<string>",
"is_active": true,
"disabled_reason": "<string>",
"webhook_url": "<string>",
"webhook_event_types": [
"<string>"
],
"metadata": {},
"last_run_at": "<string>",
"next_run_times": [
"<string>"
],
"row_count": 123,
"active_row_count": 123,
"status": "starting",
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": "Invalid request body"
}{
"detail": "Invalid API key"
}{
"detail": "This organization no longer has access to Sixtyfour. Contact your representative at Sixtyfour."
}{
"detail": "<string>"
}{
"detail": "Internal server error"
}{
"detail": "Could not verify the API key right now. Retry shortly."
}Headers
Optional. Omitted, a key is derived from the settings and the file's contents, so sending the same file again replays. Reusing a key with different settings or file contents returns 409.
200Body
Response
Successful Response
One uploaded table, watched as a single thing.
row_count and active_row_count differ when rows have been switched off.
'starting' while an uploaded file's rows are still being added, 'failed' when adding them failed. Nothing is checked until it becomes 'active'. 'cancelled' means the owner cancelled it; 'paused' means it was switched off without cancellation.
starting, failed, active, paused, cancelled Was this page helpful?