---
title: "ML Models"
description: "ML Models"
url: "https://www.contentstack.com/docs/developers/apis/lytics-api/ml-models"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-20"
---

# ML Models

## Get ML Models

### Get ML Models

**GET** `/v2/ml`

Get a list of all ML models for the account

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": [
    {
      "additional_data": {
        "property1": "string",
        "property2": "string"
      },
      "aid": 0,
      "author_id": "string",
      "config": {
        "additional": [
          "string"
        ],
        "auto_tune": true,
        "blocked": [
          "string"
        ],
        "build_only": true,
        "collect": 0,
        "internal": true,
        "re_run": true,
        "use_content": true,
        "use_scores": true
      },
      "created": "string",
      "description": "string",
      "error": "string",
      "hidden": true,
      "id": "string",
      "is_active": true,
      "is_healthy": true,
      "label": "string",
      "name": "string",
      "source": "string",
      "state": "string",
      "target": "string",
      "type": "string",
      "updated": "string",
      "work_ids": [
        "string"
      ]
    }
  ],
  "request_id": "string",
  "status": 0
}
```

## Post ML Model

### Post ML Model

**POST** `/v2/ml`

Create an ML Model

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {
    "additional_data": {
      "property1": "string",
      "property2": "string"
    },
    "aid": 0,
    "author_id": "string",
    "config": {
      "additional": [
        "string"
      ],
      "auto_tune": true,
      "blocked": [
        "string"
      ],
      "build_only": true,
      "collect": 0,
      "internal": true,
      "re_run": true,
      "use_content": true,
      "use_scores": true
    },
    "created": "string",
    "description": "string",
    "error": "string",
    "hidden": true,
    "id": "string",
    "is_active": true,
    "is_healthy": true,
    "label": "string",
    "name": "string",
    "source": "string",
    "state": "string",
    "target": "string",
    "type": "string",
    "updated": "string",
    "work_ids": [
      "string"
    ]
  },
  "request_id": "string",
  "status": 0
}
```

## Get ML Model

### Get ML Model

**GET** `/v2/ml/{id}`

Get an ML model by ID

#### URL Parameters

- **id** (required)
  The model ID

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {
    "additional_data": {
      "property1": "string",
      "property2": "string"
    },
    "aid": 0,
    "author_id": "string",
    "config": {
      "additional": [
        "string"
      ],
      "auto_tune": true,
      "blocked": [
        "string"
      ],
      "build_only": true,
      "collect": 0,
      "internal": true,
      "re_run": true,
      "use_content": true,
      "use_scores": true
    },
    "created": "string",
    "description": "string",
    "error": "string",
    "hidden": true,
    "id": "string",
    "is_active": true,
    "is_healthy": true,
    "label": "string",
    "name": "string",
    "source": "string",
    "state": "string",
    "target": "string",
    "type": "string",
    "updated": "string",
    "work_ids": [
      "string"
    ]
  },
  "request_id": "string",
  "status": 0
}
```

## Update ML Model

### Update ML Model

**PUT** `/v2/ml/{id}`

Update an ML model by ID

#### URL Parameters

- **id** (required)
  The model ID

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.
- **is_active** (optional)
  Promote and deploy the model to users
- **label** (optional)
  Label of the model
- **hidden** (optional)
  Hide the model from the UI

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {
    "additional_data": {
      "property1": "string",
      "property2": "string"
    },
    "aid": 0,
    "author_id": "string",
    "config": {
      "additional": [
        "string"
      ],
      "auto_tune": true,
      "blocked": [
        "string"
      ],
      "build_only": true,
      "collect": 0,
      "internal": true,
      "re_run": true,
      "use_content": true,
      "use_scores": true
    },
    "created": "string",
    "description": "string",
    "error": "string",
    "hidden": true,
    "id": "string",
    "is_active": true,
    "is_healthy": true,
    "label": "string",
    "name": "string",
    "source": "string",
    "state": "string",
    "target": "string",
    "type": "string",
    "updated": "string",
    "work_ids": [
      "string"
    ]
  },
  "request_id": "string",
  "status": 0
}
```

## Delete ML Model

### Delete ML Model

**DELETE** `/v2/ml/{id}`

Delete an ML model by ID

#### URL Parameters

- **id** (required)
  The model ID

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {},
  "request_id": "string",
  "status": 0
}
```

## Get ML Model Summary

### Get ML Model Summary

**GET** `/v2/ml/{id}/summary`

Get an ML model's summary by ID

#### URL Parameters

- **id** (required)
  The model ID

#### Query Parameters

- **account_id** (optional)
  The account ID. Defaults to the user's default account.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "_meta": {},
  "data": {
    "features": [
      {
        "correlation": 0,
        "field_prevalence": {
          "source": 0,
          "target": 0
        },
        "impact": {
          "lift": 0,
          "threshold": 0,
          "value": "string"
        },
        "importance": 0,
        "kind": "string",
        "name": "string",
        "type": "string"
      }
    ],
    "id": "string",
    "name": "string",
    "state": "string",
    "summary": {
      "accuracy": 0,
      "auc": 0,
      "audience_similarity": 0,
      "error_matrix": {
        "FalseNegative": 0,
        "FalsePositive": 0,
        "TrueNegative": 0,
        "TruePositive": 0
      },
      "model_health": "string",
      "mse": 0,
      "msgs": [
        {
          "severity": "string",
          "tags": [
            "string"
          ],
          "text": "string"
        }
      ],
      "reach": 0,
      "rsq": 0,
      "source_predictions": {
        "property1": 0,
        "property2": 0
      },
      "target_predictions": {
        "property1": 0,
        "property2": 0
      },
      "threshold": 0
    }
  },
  "request_id": "string",
  "status": 0
}
```