---
title: "Predict Controller"
method: POST
path: "/modeling/propensity/predict"
tags: ["modeling"]
---

# Predict Controller

`POST /modeling/propensity/predict`

## Request body

- PredictPayload
  - `model_id` integer, required — The ID of the model to use for prediction
  - `time_in_days` integer, required — The time in days to predict
  - `prediction_sql` string, nullable — The SQL to use for prediction.
  - `audience_id` string, nullable — The ID of the audience to use for prediction. If set will override prediction_sql.

## Response `200`

Successful Response

- SrcAsyncJobServiceBuildConcreteAsyncJobRecordClassLocalsConcreteAsyncJobRecord13
  - `id` integer, nullable — ID of this object.
  - `created_at` string, date-time, nullable — datetime object representing when this object was created.
  - `updated_at` string, date-time, nullable — datetime object representing when this object was updated.
  - `deleted_at` string, date-time, nullable — datetime object representing when this object was deleted.
  - `status` 'RUNNING' | 'COMPLETED' | 'FAILED'
  - `endpoint` string — Endpoint spawning async job
  - `request` union — request sent to endpoint
    - object
    - unknown[]
      - unknown
  - `sync_response` union — sync response
    - object
    - unknown[]
      - unknown
  - `error` string, nullable — error message
  - `response` PropensityPredictionMetadataRecord
    - `id` integer, nullable — ID of this object.
    - `created_at` string, date-time, nullable — datetime object representing when this object was created.
    - `updated_at` string, date-time, nullable — datetime object representing when this object was updated.
    - `deleted_at` string, date-time, nullable — datetime object representing when this object was deleted.
    - `async_job_id` integer, required — The ID of the async job.
    - `model_id` integer, required — The ID of the model.
    - `prediction_timeframe` integer, required — The time frame of the prediction in days.
    - `prediction_sql` string, required — The SQL query for the prediction set.
    - `prediction_set_name` string, nullable, required — The name of the prediction set.
    - `prediction_set_size` integer, nullable — The size of the prediction set.
    - `prediction_id` integer, nullable — The ID of the prediction.
    - `shap_values` object, nullable — The SHAP values.
    - `prediction_samples` unknown[], nullable — The prediction samples.
      - unknown
    - `audience_id` string, nullable — The ID of the audience for which the prediction was made.

## 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)
