---
title: "Controller Build Rfm Configuration"
method: POST
path: "/ad_analytics/rfm/build_configuration"
---

# Controller Build Rfm Configuration

`POST /ad_analytics/rfm/build_configuration`

Builds the configuration for an RFM model

## Request body

- RFMBuildConfigurationPayload
  - `rfm_id` integer, required — The ID of the RFM model to build configuration for
  - `num_segments` integer, required — The number of segments to build for the RFM model

## Response `201`

Successful Response

- SrcAsyncJobServiceBuildConcreteAsyncJobRecordClassLocalsConcreteAsyncJobRecord5
  - `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` RFMConfiguration — Configuration settings for RFM analysis, using equal-width boundaries for segmentation. Supports configurable number of segments (3, 5, or 7).
    - `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 configuration.
    - `r_segments` integer, required — Number of segments for Recency dimension.
    - `f_segments` integer, required — Number of segments for Frequency dimension.
    - `m_segments` integer, required — Number of segments for Monetary dimension.
    - `boundary_method` 'equal_width'
    - `name` string, nullable — Optional name for this configuration.
    - `insights` unknown[], nullable — List of insights for this configuration.
      - unknown
    - `rfm_id` integer, required — The ID of the RFM analysis this configuration belongs to.

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