# Remap source files at application level

Remaps the specified source files to a target library for the specified application(s). This operation runs asynchronously and returns 202 Accepted with async process status. Requires exactly one of: targetLibraryUuid OR matchSuggestionId (not both, not neither). Request body fields: applicationUuids (required, array), sourceFileUuids (required, array), targetLibraryUuid (conditional), matchSuggestionId (conditional), comment (optional), sendEmailNotification (optional, boolean).

Endpoint: POST /api/v3.0/orgs/{orgUuid}/applications/dependencies/sourceFiles/remapping
Version: 3.0
Security: bearer-key

## Security:

  - `bearer-key` (unknown)
    http bearer JWT

## Path parameters:

  - `orgUuid` (string, required)
    org UUID (from the Mend App: **Administration** General > **Organization UUID**).

## Request body:

  - `application/json` (unknown)
    Request body containing remapping details. Fields: applicationUuids (required, array), sourceFileUuids (required, array), targetLibraryUuid (conditional, UUID string - use if remapping from search for a match), matchSuggestionId (conditional, base64 string - use if remapping from match suggestion), comment (optional, string), sendEmailNotification (optional, boolean). IMPORTANT: Provide exactly one of targetLibraryUuid OR matchSuggestionId, not both.

## Request fields (application/json):

  - `applicationUuids` (array)

  - `targetLibraryUuid` (string)
    The UUID of the library to which source files should be remapped. Exactly one of targetLibraryUuid or matchSuggestionId must be provided
    Example: 123e4567-e89b-12d3-a456-426655440000

  - `matchSuggestionId` (string)
    The Id of the library to which source files should be remapped. Exactly one of targetLibraryUuid or matchSuggestionId must be provided
    Example: ZWJlMTZhZjYtMmE2YS00MWQ1LWFiNTQtYWQ3YWE3OWZhNzFl

  - `sourceFileUuids` (array)

  - `comment` (string)
    Optional user comment explaining the reason for this remapping action

  - `sendEmailNotification` (boolean)
    Whether to send email notification upon completion of the remapping operation
    Example: true

  - `originalLibraryUuid` (string)
    When set (remap-all-by-library), the server resolves all source files currently mapped to this library on its own; sourceFileUuids is ignored.
    Example: 123e4567-e89b-12d3-a456-426655440000

## Response 202:

  - `202` (unknown)
    Remapping job accepted and initiated

## Response 202 fields (application/json):

  - `uuid` (string)
    The unique identifier of the async process
    Example: caf69794-9882-4b55-82db-6b6da4fe2a92

  - `status` (string)
    The current status of the async process
    Enum: "PENDING", "IN_PROGRESS", "FAILED", "FAILURE", "SUCCESS"

  - `userEmail` (string)
    Email of the user who initiated the process
    Example: user@example.com

  - `requestToken` (string)
    Short token for tracking the request
    Example: 2cd6a43b

## Response 400:

  - `400` (unknown)
    Invalid request parameters. Possible errors: 'Only one of targetLibraryUuid or matchSuggestionId must be provided, not both' OR 'Either targetLibraryUuid or matchSuggestionId must be provided'

## Response 400 fields (*/*):

  - `supportToken` (string)
    Example: 1171c60d

## Response 403:

  - `403` (unknown)
    User lacks required permissions or application does not belong to organization

## Response 403 fields (*/*):

  - `supportToken` (string)
    Example: 1171c60d

## Response 404:

  - `404` (unknown)
    Organization, application(s), or target library not found. Error: 'Target library not found'

## Response 404 fields (application/json):

  - `uuid` (string)
    The unique identifier of the async process
    Example: caf69794-9882-4b55-82db-6b6da4fe2a92

  - `status` (string)
    The current status of the async process
    Enum: "PENDING", "IN_PROGRESS", "FAILED", "FAILURE", "SUCCESS"

  - `userEmail` (string)
    Email of the user who initiated the process
    Example: user@example.com

  - `requestToken` (string)
    Short token for tracking the request
    Example: 2cd6a43b

