---
title: "Map the company's own material codes to Retraced materials"
method: POST
path: "/api/constants-mapping/materials/"
tags: ["Constants Mapping/Materials"]
---

# Map the company's own material codes to Retraced materials

`POST /api/constants-mapping/materials/`

## Request

- Base URL: `https://api.retraced.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.retraced.com/api/constants-mapping/materials/`
- Auth: none declared

Maps each `externalId` (and `externalName`) to the Retraced material `retracedMaterialId`, and to the product type standing for that material when there is one. A code the company has already mapped is skipped, not overwritten. Answers 404 `material_not_found` when a material does not exist, without mapping anything. `data` is every mapping the company has on the given materials.

## Request body

- object[]
  - `retracedMaterialId` string, required
  - `externalId` string, required
  - `externalName` string, nullable

## Response `201`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required: True when the request succeeded.
  - `data` object[], required
    - `id` string, required
    - `retracedMaterialId` string, required
    - `name` string, nullable, required
    - `externalId` string, nullable, required
    - `externalName` string, nullable, required
    - `updatedAt` union, required
      - string
      - string, date-time
    - `updatedByUserName` string, nullable, required
    - `updatedByCompanyName` string, nullable, required

## Other responses

- `400`: Default Response
- `401`: Default Response
- `403`: Default Response
- `404`: Default Response

## Changes

> 108 revisions in range; 2 not diffed.

- **2026-10-13** `b9cf8bef8ed3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/retraced/apis/api-reference/changes/api/constants-mapping/materials/post.md)

---

[API](https://skmtc.dev/retraced/apis/api-reference.md) - [All operations](https://skmtc.dev/retraced/apis/api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/retraced/apis/api-reference/revisions/83309c4abd20?raw)
