---
title: "Trigger a run"
method: POST
path: "/v1/live-export/live-exports/{id}/trigger"
tags: ["Live Exports"]
---

# Trigger a run

`POST /v1/live-export/live-exports/{id}/trigger`

## Request

- Base URL: `https://api.whalesync.com`
- URL: `https://api.whalesync.com/v1/live-export/live-exports/{id}/trigger`
- Auth: HTTP bearer

Run the export now, regardless of the schedule. One run at a time: a trigger while one is active returns the `run_in_progress` conflict. Unsaved mapping edits return the `unsaved_changes` conflict — the run would use the last-saved pipeline, not them — save first, or send `{"force": true}` to run anyway. The run writes into the destination tables.

## Path parameters

- `id` string, required

## Request body

- LiveExportTrigger
  - `force` boolean: Run even though the mappings have unsaved edits (the run uses the last-saved pipeline, not them). Without it, that state is the `unsaved_changes` conflict.

## Response `201`

The new (pending) run. Poll its `url` or `…/status`.

- Run
  - `id` string, required
  - `status` 'pending' | 'running' | 'completed' | 'failed' | 'cancelled', required
  - `trigger` 'manual' | 'schedule', required: Whether a person/API started it, or the cadence did.
  - `started_at` string, date-time, nullable, required
  - `finished_at` string, date-time, nullable, required
  - `summary` string, nullable, required: The one-line story: what the run is doing right now, or how it ended.
  - `warning` string, nullable, required: Set when the run completed but a step finished with a warning.
  - `error` string, nullable, required: The rolled-up error for a failed run.
  - `app_url` string, uri, required: The run in the Whalesync app, for a person who wants to watch or share it — like every app_url, nothing here needs their attention.
  - `live_export_id` string, required: The Live Export this run belongs to.
  - `steps` RunStep[], required: The ordered phases of the run. Detail reads only.
    - `action` 'prepare' | 'pull' | 'map' | 'write_plan' | 'write', required: What the step does to your data. `write` is the step that changes the destination.
    - `name` string, required
    - `status` 'pending' | 'running' | 'completed' | 'failed' | 'skipped', required
    - `started_at` string, date-time, nullable, required
    - `finished_at` string, date-time, nullable, required
    - `error` string, nullable, required
  - `url` string, uri, required

## Other responses

- `401`: The API key is missing, invalid, or revoked (`missing_api_key`, `invalid_api_key`). Carries a `required_action` linking a person to key creation, naming the smallest scope this endpoint needs.
- `403`: The key's scope does not allow this call (`insufficient_scope` on a mutation with a `read` key).
- `404`: No live export with that id, or it belongs to someone else.
- `429`: Rate limit exceeded. Wait for `Retry-After` seconds.

---

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