Create a new job
curl --request POST \
--url https://gateway.app.clavata.ai:8443/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentData": [
{
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
}
],
"policyId": "<string>",
"threshold": 123,
"expedited": true,
"options": {
"options": {}
}
}
'import requests
url = "https://gateway.app.clavata.ai:8443/v1/jobs"
payload = {
"contentData": [
{
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
}
],
"policyId": "<string>",
"threshold": 123,
"expedited": True,
"options": { "options": {} }
}
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({
contentData: [
{
text: '<string>',
image: 'aSDinaTvuI8gbWludGxpZnk=',
imageUrl: '<string>',
metadata: {}
}
],
policyId: '<string>',
threshold: 123,
expedited: true,
options: {options: {}}
})
};
fetch('https://gateway.app.clavata.ai:8443/v1/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8443",
CURLOPT_URL => "https://gateway.app.clavata.ai:8443/v1/jobs",
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([
'contentData' => [
[
'text' => '<string>',
'image' => 'aSDinaTvuI8gbWludGxpZnk=',
'imageUrl' => '<string>',
'metadata' => [
]
]
],
'policyId' => '<string>',
'threshold' => 123,
'expedited' => true,
'options' => [
'options' => [
]
]
]),
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://gateway.app.clavata.ai:8443/v1/jobs"
payload := strings.NewReader("{\n \"contentData\": [\n {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"policyId\": \"<string>\",\n \"threshold\": 123,\n \"expedited\": true,\n \"options\": {\n \"options\": {}\n }\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://gateway.app.clavata.ai:8443/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentData\": [\n {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"policyId\": \"<string>\",\n \"threshold\": 123,\n \"expedited\": true,\n \"options\": {\n \"options\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.app.clavata.ai:8443/v1/jobs")
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 \"contentData\": [\n {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"policyId\": \"<string>\",\n \"threshold\": 123,\n \"expedited\": true,\n \"options\": {\n \"options\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"job": {
"jobUuid": "<string>",
"customerId": "<string>",
"status": "JOB_STATUS_UNSPECIFIED",
"contentData": [
{
"contentHash": "<string>",
"metadata": {}
}
],
"results": [
{
"jobUuid": "<string>",
"report": {
"policyId": "<string>",
"policyKey": "<string>",
"policyVersionId": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"sectionEvaluationReports": [
{
"name": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"contentHash": "<string>",
"contentMetadata": {},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
},
"threshold": 123,
"labelMatches": {},
"tokenUsage": {
"inputTokens": 123,
"billedTokens": 123,
"multiplier": 123
},
"labelId": "<string>",
"labelVersionId": "<string>"
},
"created": "2023-11-07T05:31:56Z"
}
],
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"completed": "2023-11-07T05:31:56Z",
"policyId": "<string>",
"policyVersionId": "<string>",
"threshold": 123,
"labelId": "<string>",
"labelVersionId": "<string>",
"jobType": "JOB_TYPE_UNSPECIFIED"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"type": "PRECHECK_FAILURE_TYPE_UNSPECIFIED",
"message": "<string>",
"details": "<unknown>",
"matchConfidence": "PRECHECK_MATCH_CONFIDENCE_UNSPECIFIED"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Create Jobs
Create a new job
Creates a new job for content evaluation. Can be configured to wait for completion or return immediately with a job ID.
POST
/
v1
/
jobs
Create a new job
curl --request POST \
--url https://gateway.app.clavata.ai:8443/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentData": [
{
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
}
],
"policyId": "<string>",
"threshold": 123,
"expedited": true,
"options": {
"options": {}
}
}
'import requests
url = "https://gateway.app.clavata.ai:8443/v1/jobs"
payload = {
"contentData": [
{
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
}
],
"policyId": "<string>",
"threshold": 123,
"expedited": True,
"options": { "options": {} }
}
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({
contentData: [
{
text: '<string>',
image: 'aSDinaTvuI8gbWludGxpZnk=',
imageUrl: '<string>',
metadata: {}
}
],
policyId: '<string>',
threshold: 123,
expedited: true,
options: {options: {}}
})
};
fetch('https://gateway.app.clavata.ai:8443/v1/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8443",
CURLOPT_URL => "https://gateway.app.clavata.ai:8443/v1/jobs",
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([
'contentData' => [
[
'text' => '<string>',
'image' => 'aSDinaTvuI8gbWludGxpZnk=',
'imageUrl' => '<string>',
'metadata' => [
]
]
],
'policyId' => '<string>',
'threshold' => 123,
'expedited' => true,
'options' => [
'options' => [
]
]
]),
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://gateway.app.clavata.ai:8443/v1/jobs"
payload := strings.NewReader("{\n \"contentData\": [\n {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"policyId\": \"<string>\",\n \"threshold\": 123,\n \"expedited\": true,\n \"options\": {\n \"options\": {}\n }\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://gateway.app.clavata.ai:8443/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentData\": [\n {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"policyId\": \"<string>\",\n \"threshold\": 123,\n \"expedited\": true,\n \"options\": {\n \"options\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.app.clavata.ai:8443/v1/jobs")
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 \"contentData\": [\n {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"policyId\": \"<string>\",\n \"threshold\": 123,\n \"expedited\": true,\n \"options\": {\n \"options\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"job": {
"jobUuid": "<string>",
"customerId": "<string>",
"status": "JOB_STATUS_UNSPECIFIED",
"contentData": [
{
"contentHash": "<string>",
"metadata": {}
}
],
"results": [
{
"jobUuid": "<string>",
"report": {
"policyId": "<string>",
"policyKey": "<string>",
"policyVersionId": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"sectionEvaluationReports": [
{
"name": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"contentHash": "<string>",
"contentMetadata": {},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
},
"threshold": 123,
"labelMatches": {},
"tokenUsage": {
"inputTokens": 123,
"billedTokens": 123,
"multiplier": 123
},
"labelId": "<string>",
"labelVersionId": "<string>"
},
"created": "2023-11-07T05:31:56Z"
}
],
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"completed": "2023-11-07T05:31:56Z",
"policyId": "<string>",
"policyVersionId": "<string>",
"threshold": 123,
"labelId": "<string>",
"labelVersionId": "<string>",
"jobType": "JOB_TYPE_UNSPECIFIED"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"type": "PRECHECK_FAILURE_TYPE_UNSPECIFIED",
"message": "<string>",
"details": "<unknown>",
"matchConfidence": "PRECHECK_MATCH_CONFIDENCE_UNSPECIFIED"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The content data to be evaluated. Only one content type should be set per entry.
Show child attributes
Show child attributes
The threshold to use for truthyness. If not set a default value will be used.
If set, the job will be evaluated in expedited mode, prioritizing speed over cost.
A POST request to make when the job is complete.
Show child attributes
Show child attributes
Options for evaluation behavior.
Show child attributes
Show child attributes
Response
A successful response.
A unique evaluation job that has compared a policy to one or more pieces of content
Show child attributes
Show child attributes
Was this page helpful?
⌘I