Submit an async explain job
curl --request POST \
--url https://api.nixtla.io/v2/explain/async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"series": {
"y": [
123
],
"sizes": [
123
],
"X": [
[
123
]
],
"categorical_exog": [
1
],
"start_datetime": [
"<string>"
]
},
"method": "granger",
"job_options": {
"timeout_seconds": 1
}
}
'import requests
url = "https://api.nixtla.io/v2/explain/async"
payload = {
"series": {
"y": [123],
"sizes": [123],
"X": [[123]],
"categorical_exog": [1],
"start_datetime": ["<string>"]
},
"method": "granger",
"job_options": { "timeout_seconds": 1 }
}
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({
series: {
y: [123],
sizes: [123],
X: [[123]],
categorical_exog: [1],
start_datetime: ['<string>']
},
method: 'granger',
job_options: {timeout_seconds: 1}
})
};
fetch('https://api.nixtla.io/v2/explain/async', 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.nixtla.io/v2/explain/async",
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([
'series' => [
'y' => [
123
],
'sizes' => [
123
],
'X' => [
[
123
]
],
'categorical_exog' => [
1
],
'start_datetime' => [
'<string>'
]
],
'method' => 'granger',
'job_options' => [
'timeout_seconds' => 1
]
]),
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.nixtla.io/v2/explain/async"
payload := strings.NewReader("{\n \"series\": {\n \"y\": [\n 123\n ],\n \"sizes\": [\n 123\n ],\n \"X\": [\n [\n 123\n ]\n ],\n \"categorical_exog\": [\n 1\n ],\n \"start_datetime\": [\n \"<string>\"\n ]\n },\n \"method\": \"granger\",\n \"job_options\": {\n \"timeout_seconds\": 1\n }\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.nixtla.io/v2/explain/async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"series\": {\n \"y\": [\n 123\n ],\n \"sizes\": [\n 123\n ],\n \"X\": [\n [\n 123\n ]\n ],\n \"categorical_exog\": [\n 1\n ],\n \"start_datetime\": [\n \"<string>\"\n ]\n },\n \"method\": \"granger\",\n \"job_options\": {\n \"timeout_seconds\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixtla.io/v2/explain/async")
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 \"series\": {\n \"y\": [\n 123\n ],\n \"sizes\": [\n 123\n ],\n \"X\": [\n [\n 123\n ]\n ],\n \"categorical_exog\": [\n 1\n ],\n \"start_datetime\": [\n \"<string>\"\n ]\n },\n \"method\": \"granger\",\n \"job_options\": {\n \"timeout_seconds\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"job_id": "fc-4f2a1c9e8b7d4a6f9c3e1b5d7a9f2c4e"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}async jobs
Submit an async explain job
Queues a explain job and returns immediately with its job_id. The job runs in a sandbox; poll GET /v2/explain/jobs/{job_id} for its state and result. Accepts the same body as the synchronous endpoint plus an optional job_options.
POST
/
v2
/
explain
/
async
Submit an async explain job
curl --request POST \
--url https://api.nixtla.io/v2/explain/async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"series": {
"y": [
123
],
"sizes": [
123
],
"X": [
[
123
]
],
"categorical_exog": [
1
],
"start_datetime": [
"<string>"
]
},
"method": "granger",
"job_options": {
"timeout_seconds": 1
}
}
'import requests
url = "https://api.nixtla.io/v2/explain/async"
payload = {
"series": {
"y": [123],
"sizes": [123],
"X": [[123]],
"categorical_exog": [1],
"start_datetime": ["<string>"]
},
"method": "granger",
"job_options": { "timeout_seconds": 1 }
}
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({
series: {
y: [123],
sizes: [123],
X: [[123]],
categorical_exog: [1],
start_datetime: ['<string>']
},
method: 'granger',
job_options: {timeout_seconds: 1}
})
};
fetch('https://api.nixtla.io/v2/explain/async', 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.nixtla.io/v2/explain/async",
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([
'series' => [
'y' => [
123
],
'sizes' => [
123
],
'X' => [
[
123
]
],
'categorical_exog' => [
1
],
'start_datetime' => [
'<string>'
]
],
'method' => 'granger',
'job_options' => [
'timeout_seconds' => 1
]
]),
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.nixtla.io/v2/explain/async"
payload := strings.NewReader("{\n \"series\": {\n \"y\": [\n 123\n ],\n \"sizes\": [\n 123\n ],\n \"X\": [\n [\n 123\n ]\n ],\n \"categorical_exog\": [\n 1\n ],\n \"start_datetime\": [\n \"<string>\"\n ]\n },\n \"method\": \"granger\",\n \"job_options\": {\n \"timeout_seconds\": 1\n }\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.nixtla.io/v2/explain/async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"series\": {\n \"y\": [\n 123\n ],\n \"sizes\": [\n 123\n ],\n \"X\": [\n [\n 123\n ]\n ],\n \"categorical_exog\": [\n 1\n ],\n \"start_datetime\": [\n \"<string>\"\n ]\n },\n \"method\": \"granger\",\n \"job_options\": {\n \"timeout_seconds\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixtla.io/v2/explain/async")
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 \"series\": {\n \"y\": [\n 123\n ],\n \"sizes\": [\n 123\n ],\n \"X\": [\n [\n 123\n ]\n ],\n \"categorical_exog\": [\n 1\n ],\n \"start_datetime\": [\n \"<string>\"\n ]\n },\n \"method\": \"granger\",\n \"job_options\": {\n \"timeout_seconds\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"job_id": "fc-4f2a1c9e8b7d4a6f9c3e1b5d7a9f2c4e"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
HTTPBearer
Body
application/json
Show child attributes
Show child attributes
Model-agnostic causal analysis method used by the /v2/explain endpoint. Options are: 'granger' (default) and 'transfer_entropy'.
Available options:
granger, transfer_entropy Show child attributes
Show child attributes
Response
Successful Response
The 202 every async submit returns. Shared by all tasks — they differ in request, not reply.
Identifier for the accepted job. Prefixed per task (e.g. fc- for forecast).
Example:
"fc-4f2a1c9e8b7d4a6f9c3e1b5d7a9f2c4e"
Was this page helpful?