---
title: "Create a data source"
method: POST
path: "/v3/mapping_data_sources"
tags: ["Data Sources"]
---

# Create a data source

`POST /v3/mapping_data_sources`

Create a custom mapping data source.

## Request body

- MappingDataSourceCreate — A mapping data source is used to map from raw data found by our AI models to records in your database.
  - `name` string, nullable
  - `organization` string, nullable — The organization that this mapping data source belongs to.
  - `workspace` string, nullable — The workspace that this mapping data source belongs to.
  - `keyProperty` string — Attribute in the schema which uniquely identifiers the value
  - `displayProperty` string — Attribute in the schema which is used to display the value
  - `values` object[]
  - `schema` object — The schema of the mapping data source.

## Response `201`

Successfully created a mapping data source.

- MappingDataSource — A mapping data source is used to map from raw data found by our AI models to records in your database.
  - `identifier` string, required — Uniquely identify a mapping data source.
  - `name` string, nullable
  - `keyProperty` string, required — Attribute in the schema which uniquely identifiers the value
  - `displayProperty` string, required — Attribute in the schema which is used to display the value
  - `organization` string, nullable, required — The organization that this mapping data source belongs to.
  - `workspace` string, nullable, required — The workspace that this mapping data source belongs to.
  - `schema` object — The schema of the mapping data source.

## 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-2.md) · [All operations](https://skmtc.net/affinda/apis/affinda-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/affinda/affinda-api-2/versions/6772e50cb58e/schema)
