---
title: "Replace an ID mapping"
method: PUT
path: "/api/v2/external-ids/{mappingId}"
tags: ["External IDs"]
---

# Replace an ID mapping

`PUT /api/v2/external-ids/{mappingId}`

> 🔑
>
> Required OAuth scope: `externalIds:write`.

Replaces an existing external ID mapping with the provided data.

## Path parameters

- `mappingId` string, ObjectId, required

## Headers

- `360-api-version` 'v2.0', required

## Request body

- InputExternalIdDTO
  - `platform` string, required — The name of the platform where the external ID comes from.
  - `targetId` string, ObjectId, required — The resource ID to which the external ID is linked.
  - `targetType` 'attempt' | 'classroom' | 'classroomAttendance' | 'classroomAttendanceSheet' | 'classroomSlot' | 'classroomSlotRegistration' | 'course' | 'group' | 'learningNeed' | 'path' | 'pathEnrollment' | 'pathSession' | 'pathTracking' | 'registrationRequest' | 'user', required — The resource type to which the external ID is linked.
  - `value` string, required — The value of the external ID.

## Response `200`

Returns the updated external ID mapping.

- ExternalIdDTO
  - `platform` string, required — The name of the platform where the external ID comes from.
  - `targetId` string, ObjectId, required — The resource ID to which the external ID is linked.
  - `targetType` 'attempt' | 'classroom' | 'classroomAttendance' | 'classroomAttendanceSheet' | 'classroomSlot' | 'classroomSlotRegistration' | 'course' | 'group' | 'learningNeed' | 'path' | 'pathEnrollment' | 'pathSession' | 'pathTracking' | 'registrationRequest' | 'user', required — The resource type to which the external ID is linked.
  - `value` string, required — The value of the external ID.
  - `_id` string, ObjectId, required — The unique ID that identifies the resources mapping.

## Other responses

- `400` — The server cannot or will not process the request due to something that is perceived to be a client error.
- `401` — The given access token is either missing, invalid, has expired, or has been revoked.
- `403` — The given access token does not have the required OAuth scope to execute the request.
- `404` — The server cannot find the requested resource.
- `429` — The client has sent too many requests in a short amount of time.

---

[API](https://skmtc.net/360learning/apis/core-api.md) · [All operations](https://skmtc.net/360learning/apis/core-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/360learning/core-api/revisions/94b691b0b72c/schema)
