Skip to main content
POST
/
v3
/
models
Add a new model under a project
curl --request POST \
  --url https://api.example.com/v3/models \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "schema": {
    "schema_version": 1,
    "columns": [
      {
        "name": "<string>",
        "min": 123,
        "max": 123,
        "categories": [
          "<string>"
        ],
        "bins": [
          123
        ],
        "replace_with_nulls": [
          "<string>"
        ],
        "n_dimensions": 123,
        "id": "<string>"
      }
    ]
  },
  "spec": {
    "schema_version": 1,
    "inputs": [
      "<string>"
    ],
    "outputs": [
      "<string>"
    ],
    "targets": [
      "<string>"
    ],
    "decisions": [
      "<string>"
    ],
    "metadata": [
      "<string>"
    ],
    "custom_features": [
      {
        "name": "<string>",
        "columns": [
          "<string>"
        ],
        "centroids": [
          123
        ],
        "tf_idf": [
          {}
        ],
        "n_clusters": 123,
        "monitor_components": true
      }
    ]
  },
  "version": "v1",
  "status": "LIVE",
  "task_params": {
    "binary_classification_threshold": 123,
    "target_class_order": [
      "<string>"
    ],
    "group_by": "<string>",
    "top_k": 123,
    "class_weights": [
      123
    ],
    "weighted_ref_histograms": true
  },
  "xai_params": {
    "custom_explain_methods": [
      "<string>"
    ],
    "default_explain_method": "<string>"
  },
  "description": "<string>",
  "owner_id": "<string>",
  "deployment_date": "2023-11-07T05:31:56Z",
  "algorithm": "<string>",
  "framework": "<string>",
  "event_id_col": "<string>",
  "event_ts_col": "<string>",
  "event_ts_format": "<string>"
}
'
import requests

url = "https://api.example.com/v3/models"

payload = {
"name": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schema": {
"schema_version": 1,
"columns": [
{
"name": "<string>",
"min": 123,
"max": 123,
"categories": ["<string>"],
"bins": [123],
"replace_with_nulls": ["<string>"],
"n_dimensions": 123,
"id": "<string>"
}
]
},
"spec": {
"schema_version": 1,
"inputs": ["<string>"],
"outputs": ["<string>"],
"targets": ["<string>"],
"decisions": ["<string>"],
"metadata": ["<string>"],
"custom_features": [
{
"name": "<string>",
"columns": ["<string>"],
"centroids": [123],
"tf_idf": [{}],
"n_clusters": 123,
"monitor_components": True
}
]
},
"version": "v1",
"status": "LIVE",
"task_params": {
"binary_classification_threshold": 123,
"target_class_order": ["<string>"],
"group_by": "<string>",
"top_k": 123,
"class_weights": [123],
"weighted_ref_histograms": True
},
"xai_params": {
"custom_explain_methods": ["<string>"],
"default_explain_method": "<string>"
},
"description": "<string>",
"owner_id": "<string>",
"deployment_date": "2023-11-07T05:31:56Z",
"algorithm": "<string>",
"framework": "<string>",
"event_id_col": "<string>",
"event_ts_col": "<string>",
"event_ts_format": "<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({
name: '<string>',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
schema: {
schema_version: 1,
columns: [
{
name: '<string>',
min: 123,
max: 123,
categories: ['<string>'],
bins: [123],
replace_with_nulls: ['<string>'],
n_dimensions: 123,
id: '<string>'
}
]
},
spec: {
schema_version: 1,
inputs: ['<string>'],
outputs: ['<string>'],
targets: ['<string>'],
decisions: ['<string>'],
metadata: ['<string>'],
custom_features: [
{
name: '<string>',
columns: ['<string>'],
centroids: [123],
tf_idf: [{}],
n_clusters: 123,
monitor_components: true
}
]
},
version: 'v1',
status: 'LIVE',
task_params: {
binary_classification_threshold: 123,
target_class_order: ['<string>'],
group_by: '<string>',
top_k: 123,
class_weights: [123],
weighted_ref_histograms: true
},
xai_params: {custom_explain_methods: ['<string>'], default_explain_method: '<string>'},
description: '<string>',
owner_id: '<string>',
deployment_date: '2023-11-07T05:31:56Z',
algorithm: '<string>',
framework: '<string>',
event_id_col: '<string>',
event_ts_col: '<string>',
event_ts_format: '<string>'
})
};

fetch('https://api.example.com/v3/models', 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.example.com/v3/models",
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([
'name' => '<string>',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'schema' => [
'schema_version' => 1,
'columns' => [
[
'name' => '<string>',
'min' => 123,
'max' => 123,
'categories' => [
'<string>'
],
'bins' => [
123
],
'replace_with_nulls' => [
'<string>'
],
'n_dimensions' => 123,
'id' => '<string>'
]
]
],
'spec' => [
'schema_version' => 1,
'inputs' => [
'<string>'
],
'outputs' => [
'<string>'
],
'targets' => [
'<string>'
],
'decisions' => [
'<string>'
],
'metadata' => [
'<string>'
],
'custom_features' => [
[
'name' => '<string>',
'columns' => [
'<string>'
],
'centroids' => [
123
],
'tf_idf' => [
[

]
],
'n_clusters' => 123,
'monitor_components' => true
]
]
],
'version' => 'v1',
'status' => 'LIVE',
'task_params' => [
'binary_classification_threshold' => 123,
'target_class_order' => [
'<string>'
],
'group_by' => '<string>',
'top_k' => 123,
'class_weights' => [
123
],
'weighted_ref_histograms' => true
],
'xai_params' => [
'custom_explain_methods' => [
'<string>'
],
'default_explain_method' => '<string>'
],
'description' => '<string>',
'owner_id' => '<string>',
'deployment_date' => '2023-11-07T05:31:56Z',
'algorithm' => '<string>',
'framework' => '<string>',
'event_id_col' => '<string>',
'event_ts_col' => '<string>',
'event_ts_format' => '<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.example.com/v3/models"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schema\": {\n \"schema_version\": 1,\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"min\": 123,\n \"max\": 123,\n \"categories\": [\n \"<string>\"\n ],\n \"bins\": [\n 123\n ],\n \"replace_with_nulls\": [\n \"<string>\"\n ],\n \"n_dimensions\": 123,\n \"id\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"schema_version\": 1,\n \"inputs\": [\n \"<string>\"\n ],\n \"outputs\": [\n \"<string>\"\n ],\n \"targets\": [\n \"<string>\"\n ],\n \"decisions\": [\n \"<string>\"\n ],\n \"metadata\": [\n \"<string>\"\n ],\n \"custom_features\": [\n {\n \"name\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ],\n \"centroids\": [\n 123\n ],\n \"tf_idf\": [\n {}\n ],\n \"n_clusters\": 123,\n \"monitor_components\": true\n }\n ]\n },\n \"version\": \"v1\",\n \"status\": \"LIVE\",\n \"task_params\": {\n \"binary_classification_threshold\": 123,\n \"target_class_order\": [\n \"<string>\"\n ],\n \"group_by\": \"<string>\",\n \"top_k\": 123,\n \"class_weights\": [\n 123\n ],\n \"weighted_ref_histograms\": true\n },\n \"xai_params\": {\n \"custom_explain_methods\": [\n \"<string>\"\n ],\n \"default_explain_method\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"deployment_date\": \"2023-11-07T05:31:56Z\",\n \"algorithm\": \"<string>\",\n \"framework\": \"<string>\",\n \"event_id_col\": \"<string>\",\n \"event_ts_col\": \"<string>\",\n \"event_ts_format\": \"<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.example.com/v3/models")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schema\": {\n \"schema_version\": 1,\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"min\": 123,\n \"max\": 123,\n \"categories\": [\n \"<string>\"\n ],\n \"bins\": [\n 123\n ],\n \"replace_with_nulls\": [\n \"<string>\"\n ],\n \"n_dimensions\": 123,\n \"id\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"schema_version\": 1,\n \"inputs\": [\n \"<string>\"\n ],\n \"outputs\": [\n \"<string>\"\n ],\n \"targets\": [\n \"<string>\"\n ],\n \"decisions\": [\n \"<string>\"\n ],\n \"metadata\": [\n \"<string>\"\n ],\n \"custom_features\": [\n {\n \"name\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ],\n \"centroids\": [\n 123\n ],\n \"tf_idf\": [\n {}\n ],\n \"n_clusters\": 123,\n \"monitor_components\": true\n }\n ]\n },\n \"version\": \"v1\",\n \"status\": \"LIVE\",\n \"task_params\": {\n \"binary_classification_threshold\": 123,\n \"target_class_order\": [\n \"<string>\"\n ],\n \"group_by\": \"<string>\",\n \"top_k\": 123,\n \"class_weights\": [\n 123\n ],\n \"weighted_ref_histograms\": true\n },\n \"xai_params\": {\n \"custom_explain_methods\": [\n \"<string>\"\n ],\n \"default_explain_method\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"deployment_date\": \"2023-11-07T05:31:56Z\",\n \"algorithm\": \"<string>\",\n \"framework\": \"<string>\",\n \"event_id_col\": \"<string>\",\n \"event_ts_col\": \"<string>\",\n \"event_ts_format\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v3/models")

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 \"name\": \"<string>\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"schema\": {\n \"schema_version\": 1,\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"min\": 123,\n \"max\": 123,\n \"categories\": [\n \"<string>\"\n ],\n \"bins\": [\n 123\n ],\n \"replace_with_nulls\": [\n \"<string>\"\n ],\n \"n_dimensions\": 123,\n \"id\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"schema_version\": 1,\n \"inputs\": [\n \"<string>\"\n ],\n \"outputs\": [\n \"<string>\"\n ],\n \"targets\": [\n \"<string>\"\n ],\n \"decisions\": [\n \"<string>\"\n ],\n \"metadata\": [\n \"<string>\"\n ],\n \"custom_features\": [\n {\n \"name\": \"<string>\",\n \"columns\": [\n \"<string>\"\n ],\n \"centroids\": [\n 123\n ],\n \"tf_idf\": [\n {}\n ],\n \"n_clusters\": 123,\n \"monitor_components\": true\n }\n ]\n },\n \"version\": \"v1\",\n \"status\": \"LIVE\",\n \"task_params\": {\n \"binary_classification_threshold\": 123,\n \"target_class_order\": [\n \"<string>\"\n ],\n \"group_by\": \"<string>\",\n \"top_k\": 123,\n \"class_weights\": [\n 123\n ],\n \"weighted_ref_histograms\": true\n },\n \"xai_params\": {\n \"custom_explain_methods\": [\n \"<string>\"\n ],\n \"default_explain_method\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"deployment_date\": \"2023-11-07T05:31:56Z\",\n \"algorithm\": \"<string>\",\n \"framework\": \"<string>\",\n \"event_id_col\": \"<string>\",\n \"event_ts_col\": \"<string>\",\n \"event_ts_format\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "api_version": "3.0",
  "kind": "NORMAL",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "version": "v1",
    "organization": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>"
    },
    "project": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>"
    },
    "deleted_at": "2023-11-07T05:31:56Z",
    "algorithm": "<string>",
    "framework": "<string>",
    "created_by": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "email": "jsmith@example.com",
      "full_name": "<string>"
    },
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "owner": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "email": "jsmith@example.com",
      "full_name": "<string>"
    },
    "deployment_date": "2023-11-07T05:31:56Z",
    "updated_by": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "email": "jsmith@example.com",
      "full_name": "<string>"
    },
    "task_params": {
      "binary_classification_threshold": 123,
      "target_class_order": [
        "<string>"
      ],
      "group_by": "<string>",
      "top_k": 123,
      "class_weights": [
        123
      ],
      "weighted_ref_histograms": true
    },
    "schema": {
      "schema_version": 1,
      "columns": [
        {
          "name": "<string>",
          "id": "<string>",
          "min": 123,
          "max": 123,
          "categories": [
            "<string>"
          ],
          "bins": [
            123
          ],
          "replace_with_nulls": [
            "<string>"
          ],
          "n_dimensions": 123
        }
      ]
    },
    "spec": {
      "schema_version": 1,
      "inputs": [
        "<string>"
      ],
      "outputs": [
        "<string>"
      ],
      "targets": [
        "<string>"
      ],
      "decisions": [
        "<string>"
      ],
      "metadata": [
        "<string>"
      ],
      "custom_features": [
        {
          "name": "<string>",
          "columns": [
            "<string>"
          ],
          "centroids": [
            123
          ],
          "tf_idf": [
            {}
          ],
          "n_clusters": 123,
          "monitor_components": true
        }
      ]
    },
    "event_id_col": "<string>",
    "event_ts_col": "<string>",
    "event_ts_format": "<string>",
    "xai_params": {
      "custom_explain_methods": [
        "<string>"
      ],
      "default_explain_method": "<string>"
    },
    "artifact_files": [
      {
        "name": "<string>",
        "size": 123,
        "modified": "2023-11-07T05:31:56Z"
      }
    ],
    "is_binary_ranking_model": true
  }
}
{
"api_version": "3.0",
"kind": "ERROR",
"error": {
"code": 400,
"message": "Resource Not Found",
"errors": [
{
"reason": "ResourceNotFoundException",
"message": "Resource Not Found",
"help": "<string>"
}
]
}
}
{
"api_version": "3.0",
"kind": "ERROR",
"error": {
"code": 400,
"message": "Resource Not Found",
"errors": [
{
"reason": "ResourceNotFoundException",
"message": "Resource Not Found",
"help": "<string>"
}
]
}
}
{
"api_version": "3.0",
"kind": "ERROR",
"error": {
"code": 400,
"message": "Resource Not Found",
"errors": [
{
"reason": "ResourceNotFoundException",
"message": "Resource Not Found",
"help": "<string>"
}
]
}
}
{
"api_version": "3.0",
"kind": "ERROR",
"error": {
"code": 400,
"message": "Resource Not Found",
"errors": [
{
"reason": "ResourceNotFoundException",
"message": "Resource Not Found",
"help": "<string>"
}
]
}
}
{
"api_version": "3.0",
"kind": "ERROR",
"error": {
"code": 400,
"message": "Resource Not Found",
"errors": [
{
"reason": "ResourceNotFoundException",
"message": "Resource Not Found",
"help": "<string>"
}
]
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Name of the model

project_id
string<uuid>
required

UUID format unique identifier for the project the model is added in

input_type
enum<string>
required

Enumeration of different model input types.

Available options:
text,
structured
task
enum<string>
required

Enumeration of different types of model tasks.

Available options:
binary_classification,
multiclass_classification,
regression,
ranking,
not_set,
llm
schema
object
required

Model schema with the details of each column

spec
object
required
version
string
default:v1

Version of the model

Required string length: 1 - 64
status
enum<string>
default:LIVE
Available options:
LIVE,
DRAFT
task_params
object
xai_params
object

XAI parameters set for a model

description
string | null

Description of the model

owner_id
string | null

User ID for the owner of the model

deployment_date
string<date-time> | null

Date the model was deployed on

algorithm
string | null

Model algorithm

framework
string | null

A string providing information about the software library and version used to train and run this model

event_id_col
string | null

Event id column to be found in published data for the model

event_ts_col
string | null

Timestamp column to be found in published data for the model

event_ts_format
string | null

Format of the timestamp like datetime, epoch time etc.

Response

Created model JSON response

Response object for standard API responses.

api_version
enum<string>
default:3.0

API version.

Available options:
2.0,
3.0
kind
enum<string>
default:NORMAL

Type of response, indicating a normal response.

Available options:
NORMAL
data
object

Model fields JSON