Skip to main content
POST
/
v1
/
promotions
/
{promotionId}
/
versions
/
{versionId}
/
evaluate
Trigger evaluation
curl --request POST \
  --url https://public-api.adclear.ai/v1/promotions/{promotionId}/versions/{versionId}/evaluate \
  --header 'Authorization: Bearer <token>' \
  --header 'X-External-User-ID: <x-external-user-id>'
import requests

url = "https://public-api.adclear.ai/v1/promotions/{promotionId}/versions/{versionId}/evaluate"

headers = {
"X-External-User-ID": "<x-external-user-id>",
"Authorization": "Bearer <token>"
}

response = requests.post(url, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-External-User-ID': '<x-external-user-id>', Authorization: 'Bearer <token>'}
};

fetch('https://public-api.adclear.ai/v1/promotions/{promotionId}/versions/{versionId}/evaluate', 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://public-api.adclear.ai/v1/promotions/{promotionId}/versions/{versionId}/evaluate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-External-User-ID: <x-external-user-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://public-api.adclear.ai/v1/promotions/{promotionId}/versions/{versionId}/evaluate"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("X-External-User-ID", "<x-external-user-id>")
req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://public-api.adclear.ai/v1/promotions/{promotionId}/versions/{versionId}/evaluate")
.header("X-External-User-ID", "<x-external-user-id>")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://public-api.adclear.ai/v1/promotions/{promotionId}/versions/{versionId}/evaluate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-External-User-ID"] = '<x-external-user-id>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "evaluationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "processing",
  "correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"error": {
"message": "<string>",
"details": [
{
"type": "field_error",
"field": "<string>",
"message": "<string>"
}
]
},
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"error": {
"message": "<string>",
"details": [
{
"type": "field_error",
"field": "<string>",
"message": "<string>"
}
]
},
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"error": {
"message": "<string>",
"details": [
{
"type": "field_error",
"field": "<string>",
"message": "<string>"
}
]
},
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"error": {
"message": "<string>",
"details": [
{
"type": "field_error",
"field": "<string>",
"message": "<string>"
}
]
},
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
{
"error": {
"message": "<string>",
"details": [
{
"type": "field_error",
"field": "<string>",
"message": "<string>"
}
]
},
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

Authorization
string
header
required

Unkey API key passed as Bearer token

Headers

X-External-User-ID
string
required

External user identifier from the calling system

X-External-User-Email
string<email>

External user email from the calling system

Path Parameters

promotionId
string<uuid>
required

Promotion ID

versionId
string<uuid>
required

Version ID

Response

Evaluation triggered

evaluationId
string<uuid>
required
status
enum<string>
required
Available options:
processing
correlationId
string<uuid>
required

Correlation ID for request tracing. Include in support requests.