---
title: "Controller Build Audience For Rfm"
method: POST
path: "/ad_analytics/rfm/build_audience_for_rfm"
---

# Controller Build Audience For Rfm

`POST /ad_analytics/rfm/build_audience_for_rfm`

Builds the audience for an RFM model

## Request body

- RFMBuildAudienceForRfmPayload
  - `segment_ids` integer[], required — The IDs of the segments to build audience for
  - `project_id` string, required — The ID of the project to build audience for
  - `new_audience_name` string, nullable — The name of the new audience to create
  - `org_id` string, required — The ID of the organization to build audience for

## Response `201`

Successful Response

- SrcAsyncJobServiceBuildConcreteAsyncJobRecordClassLocalsConcreteAsyncJobRecord8
  - `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` RFM — Main RFM model for RFM analysis with equal-width segmentation and UPC upload support. Supports 1:N relationship with brands, sub-brands, products, and product categories.
    - `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 — ID of the async job used for this RFM analysis.
    - `name` string, nullable — Optional name for this RFM analysis.
    - `audience_id` string, nullable — ID of the audience used for this RFM analysis.
    - `start_date` string, date-time, nullable — Start date for the RFM analysis.
    - `end_date` string, date-time, nullable — End date for the RFM analysis.
    - `upc_batch_id` integer, nullable — ID of the UPC batch used for this analysis.
    - `product_selections` object, nullable — Structured selection of brands, sub-brands, products, and categories for analysis.

## 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/versions/6662a407c637/schema)
