---
title: "Controller Handle Preview Predict"
method: POST
path: "/integrations/preview/predict"
tags: ["integrations"]
---

# Controller Handle Preview Predict

`POST /integrations/preview/predict`

Represents a user providing connection details and a table of interest, and us giving them a preview of what the data transform looks like. The user is expected to follow this up with a "Predict Commit" request representing a user asking for an ad-hoc import and persistent prediction schedule.

## Request body

- PreviewPredictPayload
  - `flow_id` string, required — Flow ID these predictions will be run off of. Important to specify because this is how we track down the exact model we'll use for predictions.
  - `connection_id` string, nullable — Connection ID to use for credentials. If not provided, we use the connection attached to the flow (older meltano deployments)] = None.
  - `specifier` object, required — The table specifier specifying the table we'd like a preview of. We pull it down and run N predictions on it, then return the results.
  - `mappings` object — Field mappings, useful incase you are trying to run on a table with the same information but different column names. Keys of the object are keys on the table we'll be running predictions on, Values of the object are keys on our training table.
  - `step_title` string, nullable — Which deployment user-friendly name (Snowflake, Postgres, etc) is running
  - `step_key` string, nullable — Which deployment key (postgre-sql-output, etc) is running

## Response `201`

Successful Response

- PreviewPredictResponse
  - `dataset_id` string, required — Dataset created during the preview process.
  - `input_table_specifier_id` string, required — The table specifier of where the source data for predictions is.
  - `target_table_specifier_id` string, required — The table specifier of where we'll be placing predictions.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/akk/apis/fastapi.md) · [All operations](https://skmtc.net/akk/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akk/fastapi/revisions/6662a407c637/schema)
