---
title: "Update ML Model"
method: PUT
path: "/ml/{id}"
tags: ["ML Models"]
---

# Update ML Model

`PUT /ml/{id}`

## Request

- Base URL: `https://api.lytics.io/v2`
- URL: `https://api.lytics.io/v2/ml/{id}`
- Auth: API key in header `Authorization`

Update an ML model by ID

## Path parameters

- `id` string, required

## Query parameters

- `account_id` string
- `is_active` string
- `label` string
- `hidden` string

## Response `200`

ML Model Response

- object
  - `_meta` object: Response Metadata
  - `data` object: Response Payload
    - `additional_data` object
    - `aid` integer
    - `author_id` string: Creator of the model
    - `config` ModelsModelConfig
      - `additional` string[]: Additional features to include in the model
      - `auto_tune` boolean: Automatically search through all data fields in Lytics and build the optimized model of the best fields
      - `blocked` string[]: Features to exclude from the model
      - `build_only` boolean: Train the model only, do not deploy
      - `collect` integer: Number of samples to collect for training
      - `internal` boolean: Internal Lytics model; not visible to users
      - `re_run` boolean: Re-train the model every week
      - `use_content` boolean: Use content affinities as features
      - `use_scores` boolean: Use behavioral scores as features
    - `created` string: Created timestamp
    - `description` string: Description for the model
    - `error` string: Error from model training; set to nil if no error or "building" if model is still training
    - `hidden` boolean: Model is hidden from the UI
    - `id` string: ID of the model
    - `is_active` boolean: Has model been promoted and deployed to users
    - `is_healthy` boolean: Model health
    - `label` string: Label for the model
    - `name` string: Name of the model
    - `source` string: Source segment ID of the model
    - `state` string: State of the model, "complete", "building", or "invalid"
    - `target` string: Target segment ID of the model
    - `type` string: Model algorithm chosen from automatic tuning; random forest (rf), logistic regression (lr), or gradient boosting machine (gbm)
    - `updated` string: Updated timestamp for re-training
    - `work_ids` string[]: Work IDs of the model; presence of multiple usually indicates an eval-only work, thus the model has been deployed at one point
  - `request_id` string
  - `status` integer: HTTP Status Code

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `500`: Internal Server Error

## Changes

- **2026-11-03** `d8e975057aec`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/lytics/apis/lytics-api/changes/ml/:id/put.md)

---

[API](https://skmtc.dev/lytics/apis/lytics-api.md) - [All operations](https://skmtc.dev/lytics/apis/lytics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lytics/apis/lytics-api/revisions/d8e975057aec?raw)
