---
title: "Upsert Models"
method: PUT
path: "/api/v2/models"
tags: ["sensors_other"]
---

# Upsert Models

`PUT /api/v2/models`

## Request body

- SensorSORModel[]
  - `model_id` string, uuid
  - `tenant_id` string, uuid
  - `name` string, required
  - `source` string, required
  - `versions` SensorSORModelVersion[]
    - `model_version_id` string, uuid
    - `version` string, required
    - `tags` object
    - `locations` object
    - `deployments` SensorSORDeployment[]
      - `path` string
      - `active` boolean
    - `multi_file` boolean
    - `retrievable` boolean

## Response `200`

Successful response

- object
  - `details` string

## Other responses

- `400` — The request failed due to a client error, with one or more of the following possible causes: 1. The request required a tenant_id field, which was missing. 2. The request was malformed syntactically or semantically.
- `503` — The service is undergoing maintenance and is temporarily unavailable.

---

[API](https://skmtc.net/hiddenlayerai/apis/hiddenlayer-audit-api.md) · [All operations](https://skmtc.net/hiddenlayerai/apis/hiddenlayer-audit-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hiddenlayerai/hiddenlayer-audit-api/revisions/d8c55b669109/schema)
