Skip to main content
POST
/
api
/
output-destinations
/
{destinationId}
/
test
cURL
curl -X POST "https://app.cotool.ai/api/output-destinations/:destinationId/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"outputType":"detection","payload":null,"structuredOutputSchema":null,"agentName":"string"}'
import requests

url = "https://app.cotool.ai/api/output-destinations/{destinationId}/test"

payload = {
"payload": "<string>",
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"required": ["<string>"],
"enum": ["<string>"],
"additionalProperties": True,
"x-cotool": { "viewerId": "<string>" }
},
"agentName": "<string>"
}
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({
payload: '<string>',
structuredOutputSchema: {
title: '<string>',
description: '<string>',
properties: {},
items: '<unknown>',
required: ['<string>'],
enum: ['<string>'],
additionalProperties: true,
'x-cotool': {viewerId: '<string>'}
},
agentName: '<string>'
})
};

fetch('https://app.cotool.ai/api/output-destinations/{destinationId}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
HttpResponse<String> response = Unirest.post("https://app.cotool.ai/api/output-destinations/{destinationId}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payload\": \"<string>\",\n \"structuredOutputSchema\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"properties\": {},\n \"items\": \"<unknown>\",\n \"required\": [\n \"<string>\"\n ],\n \"enum\": [\n \"<string>\"\n ],\n \"additionalProperties\": true,\n \"x-cotool\": {\n \"viewerId\": \"<string>\"\n }\n },\n \"agentName\": \"<string>\"\n}")
.asString();
package main

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

func main() {

url := "https://app.cotool.ai/api/output-destinations/{destinationId}/test"

payload := strings.NewReader("{\n \"payload\": \"<string>\",\n \"structuredOutputSchema\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"properties\": {},\n \"items\": \"<unknown>\",\n \"required\": [\n \"<string>\"\n ],\n \"enum\": [\n \"<string>\"\n ],\n \"additionalProperties\": true,\n \"x-cotool\": {\n \"viewerId\": \"<string>\"\n }\n },\n \"agentName\": \"<string>\"\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))

}
{
  "success": true,
  "detail": "<string>"
}
{
"error": "<string>",
"issues": [
{}
]
}
{
"error": "<string>"
}
{
"error": "<string>",
"missingPerms": [
"<string>"
]
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

API Key authentication for programmatic access. Include your API key in the Authorization header as: Bearer your_api_key_here

Path Parameters

destinationId
string<uuid>
required

Body

application/json
outputType
enum<string>
required

The context the destination is configured in; determines the example payload shape and formatting

Available options:
detection,
response,
acceptance-criteria,
threat-intel,
alert-escalation
payload
required

The (possibly user-edited) example payload to send. For webhook it is the full envelope (POSTed verbatim); for the response context on non-webhook destinations it is just the structured output.

structuredOutputSchema
object | null

For the response context: the agent structured-output schema, so the test send formats the payload the same way the real delivery path does

agentName
string

For the response context on non-webhook destinations: the agent name shown in the message header

Response

Successful response

success
boolean
required

Whether the test output was delivered

destinationType
enum<string>
required

Type of destination the test was sent to

Available options:
webhook,
teams,
slack,
pagerduty,
linear,
tines
detail
string

Optional human-readable detail about the delivery (e.g. created issue identifier)