Add Column to Evaluation Pipeline
curl --request POST \
--url https://api.promptlayer.com/report-columns \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"report_id": 456,
"column_type": "PROMPT_TEMPLATE",
"name": "Generate Answer",
"configuration": {
"template": {
"name": "qa_template",
"version_number": null
},
"prompt_template_variable_mappings": {
"question": "input_question"
},
"engine": {
"provider": "openai",
"model": "gpt-4",
"parameters": {
"temperature": 0.7
}
}
}
}
'import requests
url = "https://api.promptlayer.com/report-columns"
payload = {
"report_id": 456,
"column_type": "PROMPT_TEMPLATE",
"name": "Generate Answer",
"configuration": {
"template": {
"name": "qa_template",
"version_number": None
},
"prompt_template_variable_mappings": { "question": "input_question" },
"engine": {
"provider": "openai",
"model": "gpt-4",
"parameters": { "temperature": 0.7 }
}
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
report_id: 456,
column_type: 'PROMPT_TEMPLATE',
name: 'Generate Answer',
configuration: {
template: {name: 'qa_template', version_number: null},
prompt_template_variable_mappings: {question: 'input_question'},
engine: {provider: 'openai', model: 'gpt-4', parameters: {temperature: 0.7}}
}
})
};
fetch('https://api.promptlayer.com/report-columns', 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.promptlayer.com/report-columns",
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([
'report_id' => 456,
'column_type' => 'PROMPT_TEMPLATE',
'name' => 'Generate Answer',
'configuration' => [
'template' => [
'name' => 'qa_template',
'version_number' => null
],
'prompt_template_variable_mappings' => [
'question' => 'input_question'
],
'engine' => [
'provider' => 'openai',
'model' => 'gpt-4',
'parameters' => [
'temperature' => 0.7
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.promptlayer.com/report-columns"
payload := strings.NewReader("{\n \"report_id\": 456,\n \"column_type\": \"PROMPT_TEMPLATE\",\n \"name\": \"Generate Answer\",\n \"configuration\": {\n \"template\": {\n \"name\": \"qa_template\",\n \"version_number\": null\n },\n \"prompt_template_variable_mappings\": {\n \"question\": \"input_question\"\n },\n \"engine\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4\",\n \"parameters\": {\n \"temperature\": 0.7\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.promptlayer.com/report-columns")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"report_id\": 456,\n \"column_type\": \"PROMPT_TEMPLATE\",\n \"name\": \"Generate Answer\",\n \"configuration\": {\n \"template\": {\n \"name\": \"qa_template\",\n \"version_number\": null\n },\n \"prompt_template_variable_mappings\": {\n \"question\": \"input_question\"\n },\n \"engine\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4\",\n \"parameters\": {\n \"temperature\": 0.7\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptlayer.com/report-columns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"report_id\": 456,\n \"column_type\": \"PROMPT_TEMPLATE\",\n \"name\": \"Generate Answer\",\n \"configuration\": {\n \"template\": {\n \"name\": \"qa_template\",\n \"version_number\": null\n },\n \"prompt_template_variable_mappings\": {\n \"question\": \"input_question\"\n },\n \"engine\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4\",\n \"parameters\": {\n \"temperature\": 0.7\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"report_column": {}
}{
"success": false,
"message": "Report already has a column with that name"
}{
"success": false,
"message": "You can not overwrite dataset columns"
}{
"success": false,
"message": "Report not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Evaluations & Reports API
Add Column to Evaluation Pipeline
POST
/
report-columns
Add Column to Evaluation Pipeline
curl --request POST \
--url https://api.promptlayer.com/report-columns \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"report_id": 456,
"column_type": "PROMPT_TEMPLATE",
"name": "Generate Answer",
"configuration": {
"template": {
"name": "qa_template",
"version_number": null
},
"prompt_template_variable_mappings": {
"question": "input_question"
},
"engine": {
"provider": "openai",
"model": "gpt-4",
"parameters": {
"temperature": 0.7
}
}
}
}
'import requests
url = "https://api.promptlayer.com/report-columns"
payload = {
"report_id": 456,
"column_type": "PROMPT_TEMPLATE",
"name": "Generate Answer",
"configuration": {
"template": {
"name": "qa_template",
"version_number": None
},
"prompt_template_variable_mappings": { "question": "input_question" },
"engine": {
"provider": "openai",
"model": "gpt-4",
"parameters": { "temperature": 0.7 }
}
}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
report_id: 456,
column_type: 'PROMPT_TEMPLATE',
name: 'Generate Answer',
configuration: {
template: {name: 'qa_template', version_number: null},
prompt_template_variable_mappings: {question: 'input_question'},
engine: {provider: 'openai', model: 'gpt-4', parameters: {temperature: 0.7}}
}
})
};
fetch('https://api.promptlayer.com/report-columns', 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.promptlayer.com/report-columns",
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([
'report_id' => 456,
'column_type' => 'PROMPT_TEMPLATE',
'name' => 'Generate Answer',
'configuration' => [
'template' => [
'name' => 'qa_template',
'version_number' => null
],
'prompt_template_variable_mappings' => [
'question' => 'input_question'
],
'engine' => [
'provider' => 'openai',
'model' => 'gpt-4',
'parameters' => [
'temperature' => 0.7
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.promptlayer.com/report-columns"
payload := strings.NewReader("{\n \"report_id\": 456,\n \"column_type\": \"PROMPT_TEMPLATE\",\n \"name\": \"Generate Answer\",\n \"configuration\": {\n \"template\": {\n \"name\": \"qa_template\",\n \"version_number\": null\n },\n \"prompt_template_variable_mappings\": {\n \"question\": \"input_question\"\n },\n \"engine\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4\",\n \"parameters\": {\n \"temperature\": 0.7\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.promptlayer.com/report-columns")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"report_id\": 456,\n \"column_type\": \"PROMPT_TEMPLATE\",\n \"name\": \"Generate Answer\",\n \"configuration\": {\n \"template\": {\n \"name\": \"qa_template\",\n \"version_number\": null\n },\n \"prompt_template_variable_mappings\": {\n \"question\": \"input_question\"\n },\n \"engine\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4\",\n \"parameters\": {\n \"temperature\": 0.7\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptlayer.com/report-columns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"report_id\": 456,\n \"column_type\": \"PROMPT_TEMPLATE\",\n \"name\": \"Generate Answer\",\n \"configuration\": {\n \"template\": {\n \"name\": \"qa_template\",\n \"version_number\": null\n },\n \"prompt_template_variable_mappings\": {\n \"question\": \"input_question\"\n },\n \"engine\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4\",\n \"parameters\": {\n \"temperature\": 0.7\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"report_column": {}
}{
"success": false,
"message": "Report already has a column with that name"
}{
"success": false,
"message": "You can not overwrite dataset columns"
}{
"success": false,
"message": "Report not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Legacy Dataset, Evaluation, and Report endpoints are deprecated for new workflows. Use the Tables API for new dataset import, evaluation, scoring, recalculation, and reporting workflows.
Important Notes
- Single Column Per Request: This endpoint only allows adding one column at a time. To add multiple columns, make separate API calls for each.
- Column Order Matters: Columns execute left to right. A column can only reference columns to its left.
- Unique Names Required: Each column name must be unique within the pipeline.
- Dataset Columns Protected: You cannot overwrite columns that come from the dataset.
Scoring
By default, only the last column in a pipeline is used for score calculation. To include multiple columns in the final score:- Set
is_part_of_score: trueon each column you want to include in the score - Columns must produce boolean or numeric values to be scored
- When multiple columns are marked for scoring, the final score is the average of all included columns
Column Types and Configuration
For the complete list of supported column types and their detailed configuration options, see the Node & Column Types documentation.Batch Adding Columns
Since columns must be added one at a time, here’s a pattern for adding multiple columns:import requests
columns = [
{
"column_type": "PROMPT_TEMPLATE",
"name": "Generate",
"configuration": {...}
},
{
"column_type": "LLM_ASSERTION",
"name": "Validate",
"configuration": {...}
}
]
for column in columns:
response = requests.post(
"https://api.promptlayer.com/report-columns",
headers={"X-API-KEY": "your_key"},
json={
"report_id": 456,
**column
}
)
if response.status_code != 201:
print(f"Failed: {column['name']}")
break
Column Reference Syntax
When configuring columns that reference other columns:- Dataset columns: Use exact column name from dataset (e.g.,
"question") - Previous columns: Use the name you assigned (e.g.,
"AI Response") - Variable columns: Reference by their name
Error Handling
The endpoint validates:- Column type is valid
- Column name is unique within the pipeline
- Configuration matches the column type schema
- Referenced columns exist (for dependent columns)
- User has permission to modify the pipeline
400: Invalid configuration or duplicate column name403: Cannot overwrite dataset columns or lacking permissions404: Report not found or not accessible
Authorizations
Body
application/json
The ID of the evaluation pipeline to add this column to.
Required range:
x >= 1The type of evaluation or transformation this column performs. Must be one of the supported column types.
Available options:
ABSOLUTE_NUMERIC_DISTANCE, AI_DATA_EXTRACTION, ASSERT_VALID, CONVERSATION_SIMULATOR, COALESCE, CODE_EXECUTION, COMBINE_COLUMNS, COMPARE, CONTAINS, COSINE_SIMILARITY, COUNT, ENDPOINT, MCP, HUMAN, JSON_PATH, LLM_ASSERTION, MATH_OPERATOR, MIN_MAX, PARSE_VALUE, APPLY_DIFF, PROMPT_TEMPLATE, REGEX, REGEX_EXTRACTION, VARIABLE, XML_PATH, WORKFLOW, CODING_AGENT Display name for this column. Must be unique within the pipeline. This name is used to reference the column in subsequent steps.
Required string length:
1 - 255Column-specific configuration. The schema varies based on column_type. See documentation for each type's requirements.
Optional position for the column. If not specified, the column is added at the end. Cannot overwrite dataset columns.
Required range:
x >= 0Was this page helpful?

