---
title: "Compute RIM weight from target distributions"
method: POST
path: "/v1/weight/compute"
tags: ["Weighting"]
---

# Compute RIM weight from target distributions

`POST /v1/weight/compute`

## Request

- Base URL: `https://spss.insightgenius.io` (the document declares no server; this is the origin it was published from)
- URL: `https://spss.insightgenius.io/v1/weight/compute`
- Auth: none declared

Compute a RIM weight (iterative proportional fitting).

Targets is a JSON array:
```json
[
  {"variable": "CLA_EDAD", "targets": {"1": 33.3, "2": 33.3, "3": 33.4}},
  {"variable": "F1", "targets": {"1": 50.0, "2": 50.0}}
]
```

Each variable's targets must sum to ~100%.
Returns weight statistics, convergence info, and before/after distributions.

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/insightgenius/apis/spss-insightgenius-api.md) · [All operations](https://skmtc.dev/insightgenius/apis/spss-insightgenius-api/llms.txt) · [OpenAPI document](https://skmtc.dev/insightgenius/apis/spss-insightgenius-api/revisions/0d165df595f0?raw)
