---
title: "Track File Internal"
method: POST
path: "/api/internal/track-file"
tags: ["internal"]
---

# Track File Internal

`POST /api/internal/track-file`

## Request

- Base URL: `https://api.tintin-x.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tintin-x.com/api/internal/track-file`
- Auth: none declared

Register an S3 file in the storage system.

Generic endpoint — any internal service can register files produced for
an agent. Auto-determines content type from key, places into the correct
storage folder (Media/Images, Media/Videos, etc.).

This is an internal, idempotent, fire-and-forget endpoint — callers
(media-worker's ``_auto_track_result`` / ``_track_in_storage``) never
inspect the response. A missing agent means "no host to attach this
file to" — a normal no-op for callers dispatching studio-product
(tryon/video) jobs under a synthetic agent_id that was never a real
Agent row, NOT an error condition. Historically this raised 404,
which is unhandled-exception noise for a case that happens on every
completed studio job (fixed 2026-08-24 — see the worker-side skip in
``_auto_track_result`` for the belt-and-suspenders companion fix that
avoids the call in the first place for the two known synthetic shapes;
this 200 response is what makes the fix safe for every OTHER caller /
shape we haven't enumerated).

## Request body

- TrackFileRequest
  - `agent_id` string, uuid, required
  - `s3_key` string, required
  - `filename` string, nullable
  - `content_type` string, nullable
  - `source` string
  - `source_ref` string, nullable
  - `description` string, nullable
  - `metadata` object, nullable
  - `publish` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tintin-x/apis/tintin-api.md) · [All operations](https://skmtc.dev/tintin-x/apis/tintin-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tintin-x/apis/tintin-api/revisions/8839a8d0a66c?raw)
