---
title: "Attach Source Files"
method: POST
path: "/projects/{projectId}/source-files/attach-files"
tags: ["Source File"]
---

# Attach Source Files

`POST /projects/{projectId}/source-files/attach-files`

This endpoint can only be used after files have been uploaded via the [Upload Zip File](#/operations/UploadZipFile) endpoint. It allows you to add multiple source files to a project. 

 Each file must be individually attached by setting the `fileUrl` to the `associatedFiles.id` returned by the [Poll Upload Zip File](#/operations/PollUploadZipFile) endpoint, once the `unzipStatus` is `extracted`. 

If a file is attached after the project has already been started, a new start project request must be made.

> Note: The maximum character size of the sum between the `name` and the `path` fields must not exceed 255. Otherwise the request cannot be validated.

## Query parameters

- `fields` string

## Headers

- `Authorization` string, required
- `X-LC-Tenant` string, required

## Request body

- SourceFileAttachmentRequest
  - `sourceFilesAttachment` SourceFileAttachmentRequestItem[] — List of Attached Source File properties referencing previously uploaded file
    - `name` string, required — The name of the source file. For example `Finance_2021_dummy_EN.txt`. The character limit is calculated together with the `path` length.
    - `role` 'translatable' | 'reference' | 'unknown', required — The role of the source file. When set to unknown or translatable, the system will try to detect the file type.
    - `fileUrl` string, required — The identifier of the previously uploaded file.
    - `type` 'native' | 'bcm' | 'sdlxliff', required — The type of the file.
    - `language` SourceLanguageRequest, required
      - `languageCode` string, required — The language code.
    - `targetLanguages` TargetLanguageRequest[] — A list of target languages in code 5 (ex. en-US)
      - `languageCode` string, required — The language code.
    - `path` string[] — Path represents the hierarchy of the source file inside the project. For example `/ZipWithFolders/Finance/2021/Finance_2021_dummy_EN.txt` would be sent as: ```json "path": [ "ZipWithFolders", "Finance", "2021" ] ``` The character limit is calculated together with the `name` length.

## Response `201`

- SourceFileAttachmentResponse
  - `sourceFiles` SourceFile[]
    - `id` string, required
    - `name` string — <div style="display:inline; float:right; color:#008080; margin-top:-23px; font-size:11px">default</div><div style="display: inline;">The file name.</div>
    - `role` 'translatable' | 'reference' | 'localizable' | 'unknown', nullable
    - `language` Language — The language object.
      - `languageCode` string, required — Language code. ex: "en-US", "de-DE".
      - `englishName` string — <div style="display:inline; float:right; color:#008080; margin-top:-23px; font-size:11px">default</div><div style="display: inline;">Human readable name.</div>
      - `direction` string
      - `parentLanguageCode` string
      - `defaultSpecificLanguageCode` string
      - `isNeutral` boolean, nullable
    - `versions` SourceFileVersion[] — The source file versions. (Not available for List endpoints).
      - `id` string, required — The source file version identifier.
      - `type` 'native' | 'bcm', nullable — <div style="display:inline; float:right; color:#008080; margin-top:-23px; font-size:11px">default</div><div style="display: inline;">The version type.</div>
      - `name` string — <div style="display:inline; float:right; color:#008080; margin-top:-23px; font-size:11px">default</div><div style="display: inline;">The file version name. This is a synthetic value, typically constructed from the version number and the originating task name.</div>
      - `version` integer, required — A numeric value, incremented for each new version.
      - `originatingTaskId` string — The identifier of the task that generated the file.
    - `targetLanguages` Language[]
      - `languageCode` string, required — Language code. ex: "en-US", "de-DE".
      - `englishName` string — <div style="display:inline; float:right; color:#008080; margin-top:-23px; font-size:11px">default</div><div style="display: inline;">Human readable name.</div>
      - `direction` string
      - `parentLanguageCode` string
      - `defaultSpecificLanguageCode` string
      - `isNeutral` boolean, nullable
    - `path` string[]
    - `totalWords` integer — Word count in the source file. </br> Available only for translatable source files, and only after the workflow task with Task Type `convert` (File Format Conversion) was executed on the source file. </br> Available only on the List Source Files endpoint.

## Other responses

- `400` — Error codes: * "invalid": invalid input on for the value mentioned in the “name” field on the error response. * "empty": missing input for the value mentioned in the "name" field on the error response. * "maxSize": maximum size exceeded for the value mentioned in the "name" field on the error response.
- `401` — The user could not be identified.
- `403` — Error codes: * "forbidden": the authenticated user is not allowed to attach a source file on the project.
- `409` — Error codes: * "duplicate": duplicate source file name inside a project is not allowed. * "duplicate": duplicate fileUrl inside a project is not allowed.

---

[API](https://skmtc.net/rws/apis/trados-cloud-platform-api.md) · [All operations](https://skmtc.net/rws/apis/trados-cloud-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rws/trados-cloud-platform-api/revisions/d42dac7c28a3/schema)
