---
title: "Create Audience From Backtest Controller"
method: POST
path: "/modeling/propensity/create_audience_from_backtest"
tags: ["modeling"]
---

# Create Audience From Backtest Controller

`POST /modeling/propensity/create_audience_from_backtest`

## Request body

- CreateAudienceFromBacktestPayload
  - `model_id` integer, required — The ID of the model to use for backtest
  - `audience_name` string, nullable — The name of the audience to create
  - `project_id` string, required — The ID of the project to create the audience in
  - `loyals` boolean, required — Whether to create a loyal audience

## Response `200`

Successful Response

- SrcAsyncJobServiceBuildConcreteAsyncJobRecordClassLocalsConcreteAsyncJobRecord15
  - `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/akkio/apis/fastapi.md) · [All operations](https://skmtc.net/akkio/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akkio/fastapi/revisions/6662a407c637/schema)
