---
title: "Replace choices of a data point"
method: POST
path: "/v3/data_point_choices/replace"
tags: ["Deprecated End Points"]
deprecated: true
---

# Replace choices of a data point

`POST /v3/data_point_choices/replace`

> **Deprecated.**

Replace choices of a data point. Existing choices and incoming choices are matched base on their `value`. New `value` will be created, existing `value` will be updated, and `value` not in incoming choices will be deleted.

## Request body

- DataPointChoiceReplaceRequest — Request body for replacing choices of a data point. Either `collection` or `organization` is required.
  - `dataPoint` string, required — Uniquely identify a data point.
  - `collection` string — Uniquely identify a collection.
  - `organization` string — Uniquely identify an organization.
  - `choices` DataPointChoiceForReplace[], required — Incoming choices to replace existing choices of a data point. Existing choices and incoming choices are matched base on their `value`. New `value` will be created, existing `value` will be updated, and `value` not in incoming choices will be deleted.
    - `value` string, required
    - `label` string
    - `synonyms` string[], nullable
    - `description` string, nullable

## Response `200`

Successfully replaced choices of a data point.

- DataPointChoiceReplaceResponse
  - `dataPoint` string, required — Uniquely identify a data point.
  - `collection` string, nullable, required — Uniquely identify a collection.
  - `organization` string, nullable, required — Uniquely identify an organization.
  - `choices` object[], required
    - `id` integer, required — Data point choice's ID
    - `value` string, required
    - `label` string, required
    - `synonyms` string[], nullable, required
    - `description` string, nullable, required

## Other responses

- `400` — Bad request. If it is a validation error will contain a list of each invalid field
- `401` — Authorisation error
- `default` — UnexpectedError

---

[API](https://skmtc.net/affinda/apis/affinda-api.md) · [All operations](https://skmtc.net/affinda/apis/affinda-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/affinda/affinda-api/versions/5f71e092a3e8/schema)
