Replace an evaluation, hops included
curl --request PUT \
--url https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"input": "<string>",
"hops": [
{
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sink": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"hopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedPolicyIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expectedMaskedFields": [
"<string>"
],
"expectedPatterns": [
{
"label": "<string>",
"pattern": "<string>",
"patternId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flags": "<string>"
}
],
"notes": "<string>",
"assertions": [
{
"checkId": "<string>",
"subject": "<string>",
"expected": "<string>"
}
]
}
],
"enabled": true
}
'import requests
url = "https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}"
payload = {
"name": "<string>",
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"input": "<string>",
"hops": [
{
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sink": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"hopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedPolicyIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"expectedMaskedFields": ["<string>"],
"expectedPatterns": [
{
"label": "<string>",
"pattern": "<string>",
"patternId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flags": "<string>"
}
],
"notes": "<string>",
"assertions": [
{
"checkId": "<string>",
"subject": "<string>",
"expected": "<string>"
}
]
}
],
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
source: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
target: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
input: '<string>',
hops: [
{
source: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
sink: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
hopId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expectedPolicyIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
expectedMaskedFields: ['<string>'],
expectedPatterns: [
{
label: '<string>',
pattern: '<string>',
patternId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
flags: '<string>'
}
],
notes: '<string>',
assertions: [{checkId: '<string>', subject: '<string>', expected: '<string>'}]
}
],
enabled: true
})
};
fetch('https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}', 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.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'source' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'target' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'input' => '<string>',
'hops' => [
[
'source' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'sink' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'hopId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expectedPolicyIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'expectedMaskedFields' => [
'<string>'
],
'expectedPatterns' => [
[
'label' => '<string>',
'pattern' => '<string>',
'patternId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'flags' => '<string>'
]
],
'notes' => '<string>',
'assertions' => [
[
'checkId' => '<string>',
'subject' => '<string>',
'expected' => '<string>'
]
]
]
],
'enabled' => true
]),
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.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"target\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"input\": \"<string>\",\n \"hops\": [\n {\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"sink\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"hopId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedPolicyIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expectedMaskedFields\": [\n \"<string>\"\n ],\n \"expectedPatterns\": [\n {\n \"label\": \"<string>\",\n \"pattern\": \"<string>\",\n \"patternId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"flags\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\",\n \"assertions\": [\n {\n \"checkId\": \"<string>\",\n \"subject\": \"<string>\",\n \"expected\": \"<string>\"\n }\n ]\n }\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"target\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"input\": \"<string>\",\n \"hops\": [\n {\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"sink\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"hopId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedPolicyIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expectedMaskedFields\": [\n \"<string>\"\n ],\n \"expectedPatterns\": [\n {\n \"label\": \"<string>\",\n \"pattern\": \"<string>\",\n \"patternId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"flags\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\",\n \"assertions\": [\n {\n \"checkId\": \"<string>\",\n \"subject\": \"<string>\",\n \"expected\": \"<string>\"\n }\n ]\n }\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"target\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"input\": \"<string>\",\n \"hops\": [\n {\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"sink\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"hopId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedPolicyIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expectedMaskedFields\": [\n \"<string>\"\n ],\n \"expectedPatterns\": [\n {\n \"label\": \"<string>\",\n \"pattern\": \"<string>\",\n \"patternId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"flags\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\",\n \"assertions\": [\n {\n \"checkId\": \"<string>\",\n \"subject\": \"<string>\",\n \"expected\": \"<string>\"\n }\n ]\n }\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"source": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"target": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"input": "<string>",
"hops": [
{
"source": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sink": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"expectedAction": "LOG",
"hopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedPolicyIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expectedMaskedFields": [
"<string>"
],
"expectedPatterns": [
{
"label": "<string>",
"pattern": "<string>",
"mode": "MUST_NOT_MATCH",
"patternId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flags": "<string>"
}
],
"notes": "<string>",
"assertions": [
{
"checkId": "<string>",
"kind": "ACTION",
"subject": "<string>",
"expected": "<string>"
}
]
}
],
"enabled": true
}Evaluation Packs
Replace an evaluation, hops included
Security Requirements
| Auth Types | Entities | Permissions | Required Roles |
|---|---|---|---|
| USER | TENANT | WRITE | TENANT:WRITE |
PUT
/
relay
/
v1
/
evaluation-packs
/
{packId}
/
evaluations
/
{evaluationId}
Replace an evaluation, hops included
curl --request PUT \
--url https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"input": "<string>",
"hops": [
{
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sink": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"hopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedPolicyIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expectedMaskedFields": [
"<string>"
],
"expectedPatterns": [
{
"label": "<string>",
"pattern": "<string>",
"patternId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flags": "<string>"
}
],
"notes": "<string>",
"assertions": [
{
"checkId": "<string>",
"subject": "<string>",
"expected": "<string>"
}
]
}
],
"enabled": true
}
'import requests
url = "https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}"
payload = {
"name": "<string>",
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"input": "<string>",
"hops": [
{
"source": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sink": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"hopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedPolicyIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"expectedMaskedFields": ["<string>"],
"expectedPatterns": [
{
"label": "<string>",
"pattern": "<string>",
"patternId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flags": "<string>"
}
],
"notes": "<string>",
"assertions": [
{
"checkId": "<string>",
"subject": "<string>",
"expected": "<string>"
}
]
}
],
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
source: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
target: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
input: '<string>',
hops: [
{
source: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
sink: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'},
hopId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expectedPolicyIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
expectedMaskedFields: ['<string>'],
expectedPatterns: [
{
label: '<string>',
pattern: '<string>',
patternId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
flags: '<string>'
}
],
notes: '<string>',
assertions: [{checkId: '<string>', subject: '<string>', expected: '<string>'}]
}
],
enabled: true
})
};
fetch('https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}', 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.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'source' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'target' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'input' => '<string>',
'hops' => [
[
'source' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'sink' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
],
'hopId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expectedPolicyIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'expectedMaskedFields' => [
'<string>'
],
'expectedPatterns' => [
[
'label' => '<string>',
'pattern' => '<string>',
'patternId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'flags' => '<string>'
]
],
'notes' => '<string>',
'assertions' => [
[
'checkId' => '<string>',
'subject' => '<string>',
'expected' => '<string>'
]
]
]
],
'enabled' => true
]),
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.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"target\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"input\": \"<string>\",\n \"hops\": [\n {\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"sink\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"hopId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedPolicyIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expectedMaskedFields\": [\n \"<string>\"\n ],\n \"expectedPatterns\": [\n {\n \"label\": \"<string>\",\n \"pattern\": \"<string>\",\n \"patternId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"flags\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\",\n \"assertions\": [\n {\n \"checkId\": \"<string>\",\n \"subject\": \"<string>\",\n \"expected\": \"<string>\"\n }\n ]\n }\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"target\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"input\": \"<string>\",\n \"hops\": [\n {\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"sink\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"hopId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedPolicyIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expectedMaskedFields\": [\n \"<string>\"\n ],\n \"expectedPatterns\": [\n {\n \"label\": \"<string>\",\n \"pattern\": \"<string>\",\n \"patternId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"flags\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\",\n \"assertions\": [\n {\n \"checkId\": \"<string>\",\n \"subject\": \"<string>\",\n \"expected\": \"<string>\"\n }\n ]\n }\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.swarmd.ai/relay/v1/evaluation-packs/{packId}/evaluations/{evaluationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"target\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"input\": \"<string>\",\n \"hops\": [\n {\n \"source\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"sink\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n },\n \"hopId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedPolicyIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expectedMaskedFields\": [\n \"<string>\"\n ],\n \"expectedPatterns\": [\n {\n \"label\": \"<string>\",\n \"pattern\": \"<string>\",\n \"patternId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"flags\": \"<string>\"\n }\n ],\n \"notes\": \"<string>\",\n \"assertions\": [\n {\n \"checkId\": \"<string>\",\n \"subject\": \"<string>\",\n \"expected\": \"<string>\"\n }\n ]\n }\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"source": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"target": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"input": "<string>",
"hops": [
{
"source": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sink": {
"type": "AGENT",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"expectedAction": "LOG",
"hopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedPolicyIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expectedMaskedFields": [
"<string>"
],
"expectedPatterns": [
{
"label": "<string>",
"pattern": "<string>",
"mode": "MUST_NOT_MATCH",
"patternId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flags": "<string>"
}
],
"notes": "<string>",
"assertions": [
{
"checkId": "<string>",
"kind": "ACTION",
"subject": "<string>",
"expected": "<string>"
}
]
}
],
"enabled": true
}Authorizations
JWT token (USER, AGENT, or SERVICE auth)
Body
application/json
Maximum string length:
300Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
2000Maximum string length:
20000Maximum array length:
100Show child attributes
Show child attributes
Response
200 - application/json
OK
Maximum string length:
300Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
2000Maximum string length:
20000Maximum array length:
100Show child attributes
Show child attributes
