Attach a criterion to a moments collection
curl --request POST \
--url https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"criterion": {
"name": "<string>",
"instructions": "<string>",
"moment_schema": {},
"finding_schema": {},
"anchors": {}
},
"signals_required": [
"speech"
],
"boundary_policy": "sentence",
"speaker_filter": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"min_duration_seconds": 5,
"max_duration_seconds": 300
}
'import requests
url = "https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria"
payload = {
"criterion": {
"name": "<string>",
"instructions": "<string>",
"moment_schema": {},
"finding_schema": {},
"anchors": {}
},
"signals_required": ["speech"],
"boundary_policy": "sentence",
"speaker_filter": {
"include": ["<string>"],
"exclude": ["<string>"]
},
"min_duration_seconds": 5,
"max_duration_seconds": 300
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
criterion: {
name: '<string>',
instructions: '<string>',
moment_schema: {},
finding_schema: {},
anchors: {}
},
signals_required: ['speech'],
boundary_policy: 'sentence',
speaker_filter: {include: ['<string>'], exclude: ['<string>']},
min_duration_seconds: 5,
max_duration_seconds: 300
})
};
fetch('https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria', 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.cloudglue.dev/v1/collections/{collection_id}/moment-criteria",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'criterion' => [
'name' => '<string>',
'instructions' => '<string>',
'moment_schema' => [
],
'finding_schema' => [
],
'anchors' => [
]
],
'signals_required' => [
'speech'
],
'boundary_policy' => 'sentence',
'speaker_filter' => [
'include' => [
'<string>'
],
'exclude' => [
'<string>'
]
],
'min_duration_seconds' => 5,
'max_duration_seconds' => 300
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.cloudglue.dev/v1/collections/{collection_id}/moment-criteria"
payload := strings.NewReader("{\n \"criterion\": {\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"moment_schema\": {},\n \"finding_schema\": {},\n \"anchors\": {}\n },\n \"signals_required\": [\n \"speech\"\n ],\n \"boundary_policy\": \"sentence\",\n \"speaker_filter\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"min_duration_seconds\": 5,\n \"max_duration_seconds\": 300\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"criterion\": {\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"moment_schema\": {},\n \"finding_schema\": {},\n \"anchors\": {}\n },\n \"signals_required\": [\n \"speech\"\n ],\n \"boundary_policy\": \"sentence\",\n \"speaker_filter\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"min_duration_seconds\": 5,\n \"max_duration_seconds\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"criterion\": {\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"moment_schema\": {},\n \"finding_schema\": {},\n \"anchors\": {}\n },\n \"signals_required\": [\n \"speech\"\n ],\n \"boundary_policy\": \"sentence\",\n \"speaker_filter\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"min_duration_seconds\": 5,\n \"max_duration_seconds\": 300\n}"
response = http.request(request)
puts response.read_body{
"attachment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"criterion_name": "<string>",
"criterion_hash": "<string>",
"criterion": {},
"options": {},
"files_total": 123,
"files_completed": 123,
"files_failed": 123,
"created_at": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Moments Collection
Attach Moment Criterion
Adds a criterion attachment and backfills existing members. The attach response charges nothing (cost header 0); per-file runs charge as they execute, and a matching prior run satisfies a pair at no extra execution.
POST
/
collections
/
{collection_id}
/
moment-criteria
Attach a criterion to a moments collection
curl --request POST \
--url https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"criterion": {
"name": "<string>",
"instructions": "<string>",
"moment_schema": {},
"finding_schema": {},
"anchors": {}
},
"signals_required": [
"speech"
],
"boundary_policy": "sentence",
"speaker_filter": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"min_duration_seconds": 5,
"max_duration_seconds": 300
}
'import requests
url = "https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria"
payload = {
"criterion": {
"name": "<string>",
"instructions": "<string>",
"moment_schema": {},
"finding_schema": {},
"anchors": {}
},
"signals_required": ["speech"],
"boundary_policy": "sentence",
"speaker_filter": {
"include": ["<string>"],
"exclude": ["<string>"]
},
"min_duration_seconds": 5,
"max_duration_seconds": 300
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
criterion: {
name: '<string>',
instructions: '<string>',
moment_schema: {},
finding_schema: {},
anchors: {}
},
signals_required: ['speech'],
boundary_policy: 'sentence',
speaker_filter: {include: ['<string>'], exclude: ['<string>']},
min_duration_seconds: 5,
max_duration_seconds: 300
})
};
fetch('https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria', 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.cloudglue.dev/v1/collections/{collection_id}/moment-criteria",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'criterion' => [
'name' => '<string>',
'instructions' => '<string>',
'moment_schema' => [
],
'finding_schema' => [
],
'anchors' => [
]
],
'signals_required' => [
'speech'
],
'boundary_policy' => 'sentence',
'speaker_filter' => [
'include' => [
'<string>'
],
'exclude' => [
'<string>'
]
],
'min_duration_seconds' => 5,
'max_duration_seconds' => 300
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.cloudglue.dev/v1/collections/{collection_id}/moment-criteria"
payload := strings.NewReader("{\n \"criterion\": {\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"moment_schema\": {},\n \"finding_schema\": {},\n \"anchors\": {}\n },\n \"signals_required\": [\n \"speech\"\n ],\n \"boundary_policy\": \"sentence\",\n \"speaker_filter\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"min_duration_seconds\": 5,\n \"max_duration_seconds\": 300\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"criterion\": {\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"moment_schema\": {},\n \"finding_schema\": {},\n \"anchors\": {}\n },\n \"signals_required\": [\n \"speech\"\n ],\n \"boundary_policy\": \"sentence\",\n \"speaker_filter\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"min_duration_seconds\": 5,\n \"max_duration_seconds\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudglue.dev/v1/collections/{collection_id}/moment-criteria")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"criterion\": {\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"moment_schema\": {},\n \"finding_schema\": {},\n \"anchors\": {}\n },\n \"signals_required\": [\n \"speech\"\n ],\n \"boundary_policy\": \"sentence\",\n \"speaker_filter\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"min_duration_seconds\": 5,\n \"max_duration_seconds\": 300\n}"
response = http.request(request)
puts response.read_body{
"attachment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"criterion_name": "<string>",
"criterion_hash": "<string>",
"criterion": {},
"options": {},
"files_total": 123,
"files_completed": 123,
"files_failed": 123,
"created_at": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
An inline criterion: rubric instructions plus typed output declarations. Snapshotted and hashed onto the run.
Show child attributes
Show child attributes
Minimum array length:
1Available options:
speech, visual_scene_description, scene_text, audio_description Available options:
sentence, tight, loose Show child attributes
Show child attributes
Required range:
x > 0Required range:
x > 0Response
The attachment, backfill pending.
Available options:
pending, processing, completed, completed_with_failures Unix timestamp in milliseconds
⌘I