Skip to main content
POST
Create a mapping

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

company_id
integer<int64>
required

The id of an existing company

Query Parameters

skip_validation
boolean

Skip validation of the mapping expressions against the query engine. Structural validation of the request still runs. The flag is enabled by being present; any value is ignored.

Body

application/json
attribute_id
integer
required

The target attribute's ID.

dataset_id
integer
required

The source dataset's ID.

mapping
object
required

Mapping definition for create/update requests. Dependencies are computed server-side and not provided by the client.

status
enum<string> | null

Status to create the mapping in. Defaults to active when omitted. Narrower than MappingStatus — a mapping cannot be created already archived.

Available options:
active,
pending,
null
tags
string[] | null

Free-form labels on the mapping. Null and an empty array both mean no tags; nio:-prefixed tags are reserved for Narrative.

Example:
source
enum<string> | null

Optional source for the mapping. Null or omitted defaults to company. Only company and rosetta_stone are allowed for user-created mappings.

Available options:
company,
rosetta_stone,
null

Response

200 - application/json

Ok

The mapping that was created, plus the derived mappings it unlocks.

attribute_id
integer
required

The target attribute's ID.

created_at
string
required

ISO-8601 timestamp indicating when the mapping was created.

Example:

"2021-08-26T21:06:07.710357Z"

dataset_id
integer
required

The source dataset's ID.

mapping
object
required
status
enum<string>
required

The status of the mapping.

  • active - Active mappings can be used
  • archived - Archived/Deleted mappings - mapping no longer in use
  • pending - Pending mappings need to be accepted before they can be used
  • rejected - Proposed mappings the owner turned down. Can still be accepted later
Available options:
active,
archived,
pending,
rejected
updated_at
string
required

ISO-8601 timestamp indicating when the mapping was last updated.

Example:

"2021-08-26T21:06:07.710357Z"

created_by
integer<int64>
required

Unique id from a user who created it.

Example:

20

updated_by
integer<int64>
required

Unique id from a user who updated it.

Example:

20

scope
enum<string>
required

The scope of the mapping.

  • global - Mappings available to all
  • private - Company private mappings
Available options:
global,
private
source
enum<string>
required

The source of the mapping.

  • company - Company private mapping
  • admin - Admin created/promoted mapping
  • system - System (Automated/ML) mappings
  • lineage - Lineage-derived mappings (editable without admin)
  • rosetta_stone - Rosetta Stone mappings (editable without admin)
  • derived - Computed on the request from a stored mapping and a derivation rule. Not stored, so it has no id; listed only when asked for by source
Available options:
company,
admin,
system,
lineage,
rosetta_stone,
derived
derived_mappings
object[]
required

The derived mappings the new mapping unlocks: the rows GET /mappings?source=derived would return for it, in the same shape (source: derived, no id, a provenance). Empty when the mapping's attribute is not the source of any derivation rule, when the mapping was created pending, or when every target attribute already has an explicit mapping on the dataset.

id
string<uuid>

Absent on a derived mapping (source: derived), which is computed per request and cannot be fetched or changed by id.

Example:

"ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0"

company_id
integer<int64> | null

The company that owns the mapping. Null for platform-wide mappings.

Example:

345

provenance
object

How a derived mapping was produced. Present only when source is derived.

Example:
tags
string[] | null

Free-form labels on the mapping. Null and an empty array both mean no tags; nio:-prefixed tags are reserved for Narrative.

Example:
derived_from
string<uuid> | null

The stored mapping this one was copied from when it was authored (lineage). Unrelated to derivation rules; see provenance for those. Null when the mapping was authored directly.

Example:

"ea9dddd2-e3ee-40b5-b03e-c3cd37c8a6f0"