> ## Documentation Index
> Fetch the complete documentation index at: https://developers.phrase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update source

> 
Reimports an already-imported job by replacing its source file with a new one. This is a job-level operation, distinct from the organization-level import settings templates managed via the import settings API.

API updated source file for specified job

Job file can be provided directly in the message body. 

Please supply jobs in `Memsource` header. 

For file in the request body provide also the filename in `Content-Disposition` header. A folder in the filename (e.g. `dir/sub/file.txt`) replaces the job directory. A plain filename, an absolute name (leading slash or drive letter) or a folder made only of `.`/`..` segments leaves the existing directory unchanged. A folder longer than 4096 characters is rejected.

If a job from a multilingual file is updated, all jobs from the same file are update too even if their UIDs aren't 
listed in the jobs field.

Accepted metadata: 

  - `jobs` - **required** - list of jobs UID reference (maximum size `100`)
  - `preTranslate` - pre translate flag (default `false`)
  - `allowAutomaticPostAnalysis` - if automatic post editing analysis should be created. If not specified then value 
                                   is taken from the analyse settings of the project
  - `callbackUrl` - consumer callback

Job restrictions:
  - job must belong to project specified in path (`projectUid`)
  - job `UID` must be from the first workflow step
  - job cannot be split
  - job cannot be continuous
  - job cannot originate in a connector
  - status in any of the job's workflow steps cannot be a final
    status (`COMPLETED_BY_LINGUIST`, `COMPLETED`, `CANCELLED`)
  - job UIDs must be from the same multilingual file if a multilingual file is updated
  - multiple multilingual files or a mixture of multilingual and other jobs cannot be updated in one call

File restrictions:
  - file cannot be a `.zip` file

Example:

```
{
  "jobs": [
    {
        "uid": "jobIn1stWfStepAndNonFinalStatusUid"
    }
  ],
  "preTranslate": false,
  "allowAutomaticPostAnalysis": false
  "callbackUrl": "https://my-shiny-service.com/consumeCallback"
}
```





## OpenAPI

````yaml /openapi/phrase-tms-latest.json post /api2/v1/projects/{projectUid}/jobs/source
openapi: 3.0.0
info:
  description: |-
    Welcome to Phrase's TMS API documentation. 

     Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. 

     If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). 

     Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers:
     > User-Agent: Example mobile app (example@phrase.com) <br/> User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact)
  version: Latest
  title: Phrase TMS API
servers:
  - url: https://cloud.memsource.com/web
security:
  - ApiToken: []
  - OAuth2: []
tags:
  - name: Additional Workflow Step
  - name: Analysis
  - name: Async Request
  - name: Authentication
  - name: Automations
  - name: Bilingual File
  - name: Business Unit
  - name: Buyer
  - name: Client
  - name: Connections
  - name: Connector
  - name: Conversations
  - name: Cost Center
  - name: Custom Fields
  - name: Custom File Type
  - name: Domain
  - name: Due Date Scheme
  - name: Email Template
  - name: File
  - name: Glossary
  - name: Import settings
  - name: Job
  - name: Language AI
  - name: Language Assets
  - name: Language Quality Assessment
  - name: Machine Translation
  - name: Machine Translation Settings
  - name: Mapping
  - name: Metabase
  - name: Net Rate Scheme
  - name: Notifications
  - name: Price List
  - name: Project
  - name: Project Template
  - name: Provider
  - name: Quality Assurance
  - name: Quality Profile
  - name: Quote
  - name: Reference File
  - name: Segment
  - name: Segmentation Rules
  - name: Service
  - name: Setup
  - name: Spell Check
  - name: SubDomain
  - name: Supported Languages
  - name: Term Base
  - name: Translation
  - name: Translation Memory
  - name: User
  - name: User Profile
  - name: Vendor
  - name: Webhook
  - name: Workflow Step
  - name: Workflow changes
  - name: XML Assistant
paths:
  /api2/v1/projects/{projectUid}/jobs/source:
    post:
      tags:
        - Job
      summary: Update source
      description: >+

        Reimports an already-imported job by replacing its source file with a
        new one. This is a job-level operation, distinct from the
        organization-level import settings templates managed via the import
        settings API.


        API updated source file for specified job


        Job file can be provided directly in the message body. 


        Please supply jobs in `Memsource` header. 


        For file in the request body provide also the filename in
        `Content-Disposition` header. A folder in the filename (e.g.
        `dir/sub/file.txt`) replaces the job directory. A plain filename, an
        absolute name (leading slash or drive letter) or a folder made only of
        `.`/`..` segments leaves the existing directory unchanged. A folder
        longer than 4096 characters is rejected.


        If a job from a multilingual file is updated, all jobs from the same
        file are update too even if their UIDs aren't 

        listed in the jobs field.


        Accepted metadata: 

          - `jobs` - **required** - list of jobs UID reference (maximum size `100`)
          - `preTranslate` - pre translate flag (default `false`)
          - `allowAutomaticPostAnalysis` - if automatic post editing analysis should be created. If not specified then value 
                                           is taken from the analyse settings of the project
          - `callbackUrl` - consumer callback

        Job restrictions:
          - job must belong to project specified in path (`projectUid`)
          - job `UID` must be from the first workflow step
          - job cannot be split
          - job cannot be continuous
          - job cannot originate in a connector
          - status in any of the job's workflow steps cannot be a final
            status (`COMPLETED_BY_LINGUIST`, `COMPLETED`, `CANCELLED`)
          - job UIDs must be from the same multilingual file if a multilingual file is updated
          - multiple multilingual files or a mixture of multilingual and other jobs cannot be updated in one call

        File restrictions:
          - file cannot be a `.zip` file

        Example:


        ```

        {
          "jobs": [
            {
                "uid": "jobIn1stWfStepAndNonFinalStatusUid"
            }
          ],
          "preTranslate": false,
          "allowAutomaticPostAnalysis": false
          "callbackUrl": "https://my-shiny-service.com/consumeCallback"
        }

        ```

      operationId: updateSource
      parameters:
        - name: projectUid
          in: path
          description: Project UID
          required: true
          schema:
            type: string
        - name: Memsource
          in: header
          description: Update source metadata JSON (see endpoint description)
          required: true
          schema:
            type: string
            format: application/json
        - name: Content-Disposition
          in: header
          description: >-
            must match pattern `((inline|attachment);
            )?(filename\*=UTF-8''(.+)|filename="?(.+)"?)`
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/octet-stream:
            schema:
              $ref: '#/components/schemas/InputStream'
        description: Source file binary
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobUpdateSourceResponseDtoV1'
        '400':
          description: Bad Request
        '401':
          description: Not authorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '405':
          description: Method not allowed
        '408':
          description: Timeout
        '410':
          description: Gone
        '415':
          description: Unsupported media type
        '429':
          description: Too many requests
        '500':
          description: Internal server error
        '501':
          description: Not implemented
components:
  schemas:
    InputStream:
      type: object
    JobUpdateSourceResponseDtoV1:
      type: object
      properties:
        asyncRequest:
          $ref: '#/components/schemas/AsyncRequestReferenceV1'
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/JobPartUpdateSourceDtoV1'
    AsyncRequestReferenceV1:
      type: object
      properties:
        action:
          type: string
          enum:
            - PRE_ANALYSE
            - POST_ANALYSE
            - CONTINUOUS_PRE_ANALYSE
            - CONTINUOUS_POST_ANALYSE
            - COMPARE_ANALYSE
            - PARENT_ANALYSE
            - PRE_TRANSLATE
            - ASYNC_TRANSLATE
            - IMPORT_JOB
            - IMPORT_FILE
            - IMPORT_DOCX
            - IMPORT_MXLF
            - IMPORT_XLF
            - ALIGN
            - EXPORT_TMX_BY_QUERY
            - EXPORT_TMX
            - IMPORT_TMX
            - IMPORT_MXLF_INTO_TM
            - STORE_BILINGUAL_FILE_TO_TM
            - IMPORT_TBX
            - IMPORT_TBX_TB3
            - INSERT_INTO_TM
            - DELETE_TM
            - CLEAR_TM
            - QA
            - QA_V3
            - UPDATE_CONTINUOUS_JOB
            - UPDATE_SOURCE
            - UPDATE_TARGET
            - EXTRACT_CLEANED_TMS
            - GLOSSARY_PUT
            - GLOSSARY_DELETE
            - ASYNC_TRANSLATE_VERIFY
            - CREATE_PROJECT
            - UPLOAD_BILINGUAL_FILES
            - EXPORT_COMPLETE_FILE
            - IMPORT_ANNOTATIONS
            - FILE_FLOW_CONVERTER_IMPORT
            - FILE_FLOW_MT_PRETRANSLATE
            - FILE_FLOW_QUALITY_ESTIMATION
            - AUTO_LQA
            - ADOPT_SEGMENT_DATA
            - ADOPT_SEGMENT_SET_DATA
            - QP_EVALUATION
            - QP_EVALUATION_V2
            - QUALITY_EVALUATION
            - QUALITY_SIGNAL
            - AUTO_ADAPT
            - MT_OPTIMIZE
        dateCreated:
          type: string
          format: date-time
        id:
          type: string
    JobPartUpdateSourceDtoV1:
      type: object
      properties:
        filename:
          type: string
        status:
          type: string
          enum:
            - NEW
            - ACCEPTED
            - DECLINED
            - REJECTED
            - DELIVERED
            - EMAILED
            - COMPLETED
            - CANCELLED
        targetLang:
          type: string
        uid:
          type: string
        workflowLevel:
          type: integer
          format: int32
        workflowStep:
          $ref: '#/components/schemas/WorkflowStepReferenceV1'
    WorkflowStepReferenceV1:
      type: object
      properties:
        id:
          type: string
        lqaEnabled:
          type: boolean
        name:
          type: string
        order:
          type: integer
          format: int32
        uid:
          type: string
  securitySchemes:
    ApiToken:
      description: >-
        Get a token from `auth/login` [endpoint](#operation/login) and then pass
        it in the `Authorization` HTTP header in every subsequent API call. For
        more information visit our [help
        center](https://support.phrase.com/hc/en-us/articles/5709662181404-API-Authentication-TMS-#token-0-0).
      type: apiKey
      name: Authorization
      in: header
    OAuth2:
      description: >-
        A standard OAuth 2.0 authorization code flow. For more information visit
        our [help
        center](https://support.phrase.com/hc/en-us/articles/5709662181404-API-Authentication-TMS-#oauth-2-0-0-1).
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://cloud.memsource.com/web/oauth/authorize
          tokenUrl: https://cloud.memsource.com/web/oauth/token
          scopes: {}

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.