curl --request POST \
--url https://api.woodwide.ai/models/{model_id}/estimate-causal-effect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"treatment_action": 123,
"control_action": 123,
"model_version_id": "<string>"
}
'import requests
url = "https://api.woodwide.ai/models/{model_id}/estimate-causal-effect"
payload = {
"treatment_action": 123,
"control_action": 123,
"model_version_id": "<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({treatment_action: 123, control_action: 123, model_version_id: '<string>'})
};
fetch('https://api.woodwide.ai/models/{model_id}/estimate-causal-effect', 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.woodwide.ai/models/{model_id}/estimate-causal-effect",
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([
'treatment_action' => 123,
'control_action' => 123,
'model_version_id' => '<string>'
]),
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.woodwide.ai/models/{model_id}/estimate-causal-effect"
payload := strings.NewReader("{\n \"treatment_action\": 123,\n \"control_action\": 123,\n \"model_version_id\": \"<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))
}HttpResponse<String> response = Unirest.post("https://api.woodwide.ai/models/{model_id}/estimate-causal-effect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"treatment_action\": 123,\n \"control_action\": 123,\n \"model_version_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.woodwide.ai/models/{model_id}/estimate-causal-effect")
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 \"treatment_action\": 123,\n \"control_action\": 123,\n \"model_version_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"status": "<string>",
"model_version_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Estimate Causal Effect
Estimate the average effect of do(treatment = treatment_action) vs do(treatment = control_action) for a causal model, by g-computation over the model’s training dataset (the causal frame is rebuilt from the labels frozen at training time).
Always asynchronous: returns a job_id immediately (202). Poll GET /jobs/{job_id} until succeeded, then fetch the scalar results (estimand, effect, n_rows, n_extrapolated, tau_summary) from the summary of GET /jobs/{job_id}/results; the per-row effects (tau — the CATE surface) are served by GET /jobs/{job_id}/results/rows.
estimand:
ate: average treatment effect over every training row.att: average effect on the treated (rows whose observed treatment equalstreatment_action). Categorical treatments only — ATT for continuous treatments requires a dose band and is not yet supported (422).
Unanswerable requests fail with 422 up front: a categorical action the model never saw at training, or a non-numeric action for a continuous treatment. Identical requests return the previously dispatched job.
curl --request POST \
--url https://api.woodwide.ai/models/{model_id}/estimate-causal-effect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"treatment_action": 123,
"control_action": 123,
"model_version_id": "<string>"
}
'import requests
url = "https://api.woodwide.ai/models/{model_id}/estimate-causal-effect"
payload = {
"treatment_action": 123,
"control_action": 123,
"model_version_id": "<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({treatment_action: 123, control_action: 123, model_version_id: '<string>'})
};
fetch('https://api.woodwide.ai/models/{model_id}/estimate-causal-effect', 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.woodwide.ai/models/{model_id}/estimate-causal-effect",
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([
'treatment_action' => 123,
'control_action' => 123,
'model_version_id' => '<string>'
]),
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.woodwide.ai/models/{model_id}/estimate-causal-effect"
payload := strings.NewReader("{\n \"treatment_action\": 123,\n \"control_action\": 123,\n \"model_version_id\": \"<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))
}HttpResponse<String> response = Unirest.post("https://api.woodwide.ai/models/{model_id}/estimate-causal-effect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"treatment_action\": 123,\n \"control_action\": 123,\n \"model_version_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.woodwide.ai/models/{model_id}/estimate-causal-effect")
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 \"treatment_action\": 123,\n \"control_action\": 123,\n \"model_version_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"status": "<string>",
"model_version_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Request body for causal effect estimation
(POST /models/{id}/estimate-causal-effect).
Estimates the average effect of do(treatment = treatment_action) vs
do(treatment = control_action) by g-computation over the model's
training dataset (the frame is rebuilt from the frozen causal labels).
Always asynchronous: returns a job to poll; scalar results land in the
job's results summary, per-row effects (tau) via
GET /jobs/{id}/results/rows.
Which effect to estimate: ate or att.
ate, att Counterfactual treatment value for the 'treated' arm.
Counterfactual treatment value for the control arm.
Public ID of a specific model version (e.g. mdlv_A8K2P9QX). If omitted, the latest ready version is used.
Was this page helpful?