---
title: "Trigger Train Model"
method: POST
path: "/v1/cron/train-model"
tags: ["cron", "cron"]
---

# Trigger Train Model

`POST /v1/cron/train-model`

## Request

- Base URL: `https://api.etymolt.com`
- URL: `https://api.etymolt.com/v1/cron/train-model`
- Auth: none declared

Train the TTAB opposition XGBoost model.

Runs apps/api/scripts/train_xgboost_v1.py inside the container, then
publishes the pickle + meta JSON to the persistent /data volume so the
start.sh bridge picks it up on the next restart.

Manual smoke:
    curl -X POST https://api.etymolt.com/v1/cron/train-model              -H "Authorization: Bearer $ETL_CRON_TOKEN"

Behaviour:
  - dataset path: first existing of /data/ttab_2d_enriched_v2.jsonl,
    /app/data/ttab_2d_enriched_v2.jsonl. Required.
  - writes pickle to /app/data/coexistence_head_xgb_v1.pkl (the script
    default), then copies it + the .meta.json to /data/ so the next
    container restart picks them up via the start.sh bridge.
  - timeout: 600s (XGBoost grid-search + Platt calibration is ~2 min;
    margin allows for cold-start and a larger v3 dataset later).

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- CronResult
  - `triggered_at` string, required
  - `completed_at` string, required
  - `duration_seconds` number, required
  - `exit_code` integer, required
  - `status` string, required
  - `stdout_tail` string, required
  - `stderr_tail` string, required
  - `rows_ingested` integer, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/etymolt/apis/etymolt-verify-ai-generated-brand-names.md) · [All operations](https://skmtc.dev/etymolt/apis/etymolt-verify-ai-generated-brand-names/llms.txt) · [OpenAPI document](https://skmtc.dev/etymolt/apis/etymolt-verify-ai-generated-brand-names/revisions/7228ffa1efa7?raw)
