---
title: "Upload a tournament import on a partner's behalf (Retool)"
method: POST
path: "/v1/admin/import_runs"
tags: ["Import Runs"]
---

# Upload a tournament import on a partner's behalf (Retool)

`POST /v1/admin/import_runs`

## Request

- Base URL: `https://api.hify.club`
- URL: `https://api.hify.club/v1/admin/import_runs`
- Auth: API key in header `X-User-Token`

Admin only. Takes the same payload a partner feed sends — players and/or matches; a match draw is the matches-only form — and queues it through the same pipeline. The partner is resolved to its active schedule_ingest integration; the tournament is written to approval_mappings at creation, so the run skips the first-run staging a feed needs. The payload is validated before the run is created, so a bad one comes back in this response rather than as a failed run.

## Request body

- object
  - `partner_id` integer, required: Must have an active schedule_ingest integration.
  - `tournament_id` string, uuid, required: The HiFy tournament to apply the payload to. Refused when another partner manages it.
  - `payload` union, required: The feed payload, as a JSON object or as its text. Its own tournament_id is the PARTNER's id for the tournament, not the HiFy one.
    - object
    - string

## Response `201`

The queued run

- ImportRun
  - `id` string, uuid
  - `source` 'partner_api' | 'retool_upload': partner_api: sent by the partner's signed feed. retool_upload: submitted by ops from Retool on the partner's behalf.
  - `kind` string: Free-form; grows with each importer. e.g. tournament_import
  - `status` 'open' | 'in_progress' | 'completed' | 'failed' | 'staged'
  - `partner_integration_id` integer, nullable
  - `importable_type` string, nullable
  - `importable_id` string, uuid, nullable
  - `row_count` integer, nullable
  - `processed_count` integer
  - `approval_mappings` object: Ids ops attached when approving, e.g. a tournament_id uuid.
  - `summary` object
  - `pending_mappings` string[]: Lifted out of summary. What a staged run is waiting for ops to attach.
  - `error_details` object[]
  - `initiated_by_id` string, uuid, nullable
  - `started_at` string, date-time, nullable
  - `finished_at` string, date-time, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `401`: Unauthorized
- `403`: Forbidden — admin access required
- `422`: A bad reference (`errors[0].field` names partner_id, tournament_id or payload), or an invalid payload (`error: invalid_payload` with the importer's own `{ code, path, message }` list).
- `500`: The payload could not be stored; the run exists as failed.

---

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