> ## 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.

# Create job

> 
Upload a source file to create a translation job in the specified project.
An API call to create a [job](https://support.phrase.com/hc/en-us/articles/5709686763420-Jobs-TMS-)
within a specified [project](https://support.phrase.com/hc/en-us/articles/5709748435484-Projects-TMS-).
The source file can be uploaded directly in the message body or downloaded from connector.

**Job import is asynchronous.** The file is processed in the background after this call returns. The response
body includes an `asyncRequest` object; poll [Get asynchronous request](../async-request/get-asynchronous-request)
(action: `IMPORT_JOB`) to track import progress. To check whether individual jobs are ready, poll
[Get job](../job/get-job) and inspect the `importStatus.status` field (`RUNNING`, `ERROR`, `OK`).

Please supply job metadata in `Memsource` header. For file in the request body provide also the
filename in `Content-Disposition` header.

Accepted metadata:

- **targetLangs** - This parameter specifies what languages should the job be created in. Only languages that are
present in the project are supported, but this parameter accepts a subset of languages. When the file is uploaded, the
number of jobs created (and returned) corresponds to the number of target languages and the workflow steps of the
project. For example, `sample.json` imported for `EN>DE` and `EN>FR` language combination into a project with
`Translation` and `Review` workflow steps will result in 4 jobs being created, one for each language and step.
_Note_: Each time a file is uploaded, the resulting wordcount for each target language (not workflow step) is counted
towards the organization's allowance.
- **due** - ISO 8601
- **workflowSettings** - This parameter is used to set up assignments and due date for projects with workflow steps.
When a project is created, the global workflow steps available via [List workflow steps](../workflow-step/list-workflow-steps) are
instantiated for the given project at hand. To assign users or due dates, these project specific IDs need to be used
instead of the global ones.
- **assignments** - If a project does not contain workflow steps, this parameter can be used to assign users directly.
- **importSettings** - Re-usable [import settings](../import-settings/create-import-settings)
- **useProjectFileImportSettings** - When project is created, either global default setting or settings of a
[project template](https://support.phrase.com/hc/en-us/articles/5709647439772-Project-Templates-TMS-) are copied
into it. This parameter can be used to reference these project settings instead of using the API defaults.
Mutually exclusive with importSettings
- **callbackUrl** - A URL that can be notified when the job creation has been finished.
Unlike [webhooks](https://support.phrase.com/hc/en-us/articles/5709693398812-Webhooks-TMS-) which are global for the
entire account, the `callbackUrl` is set only for the specific operation at hand.
- **path** - A parameter that can be used to specify a location of the source file and preserved for later download.
This is automatically created when importing ZIP files.
- **preTranslate** - When `true`, the system automatically starts
[pre-translation](https://support.phrase.com/hc/en-us/articles/5709717749788-Pre-translation-TMS-)
after import completes. Recommended when pre-translation is the goal: the platform handles the
import-ready gate internally, removing the need to manually poll `importStatus.status`.
- **semanticMarkup** - Set semantic markup processing after import when enabled for organization
- **xmlAssistantProfile** - Apply XML import settings defined using XML assistant
- **jobPreviewPackageFileUidRef** - reference to a job preview package file to create a preview for the imported file
  
For remote file jobs also `remoteFile` can be added. To retrieve the information below,
use the [connector](../connector/list-connectors) APIs.
- **connectorToken** - Token of the connector for the purposes of the APIs
- **remoteFolder** - An encoded name of the folder, retrieved by e.g. [List files in a subfolder](../connector/list-files-in-a-subfolder)  
- **remoteFileName** - An encoded name of the file, retrieved similarly to above.
- **continuous** - Jobs created with files from a connector can be created
as [continuous](https://support.phrase.com/hc/en-us/articles/5709711922972-Continuous-Jobs-CJ-TMS-)

Create and assign job in project without workflow step:
```

{
  "targetLangs": [
    "cs_cz"
  ],
  "callbackUrl": "https://my-shiny-service.com/consumeCallback",
  "importSettings": {
    "uid": "abcd123"
  },
  "due": "2007-12-03T10:15:30.00Z",
  "path": "destination directory",
  "assignments": [
    {
      "targetLang": "cs_cz",
      "providers": [
        {
          "id": "4321",
          "type": "USER"
        }
      ]
    }
  ],
  "notifyProvider": {
    "organizationEmailTemplate": {
      "id": "39"
    },
    "notificationIntervalInMinutes": "10"
  }
}
```

Create job from remote file without workflow steps:
```

{
  "remoteFile": {
    "connectorToken": "948123ef-e1ef-4cd3-a90e-af1617848af3",
    "remoteFolder": "/",
    "remoteFileName": "Few words.docx",
    "continuous": false
  },
  "assignments": [],
  "workflowSettings": [],
  "targetLangs": [
    "cs"
  ]
}
```

Create and assign job in project with workflow step:
```

{
  "targetLangs": [
    "de"
  ],
  "useProjectFileImportSettings": "true",
  "workflowSettings": [
    {
      "id": "64",
      "due": "2007-12-03T10:15:30.00Z",
      "assignments": [
        {
          "targetLang": "de",
          "providers": [
            {
              "id": "3",
              "type": "VENDOR"
            }
          ]
        }
      ],
      "notifyProvider": {
        "organizationEmailTemplate": {
          "id": "39"
        },
        "notificationIntervalInMinutes": "10"
      }
    }
  ]
}
```

Create a job with job preview package reference:
```
{
  "targetLangs": [
    "de"
  ],
  "jobPreviewPackageFileUidRef": {"uid": "jobPreviewPackageFileUid123"}
}
```
    



## OpenAPI

````yaml /openapi/phrase-tms-latest.json post /api2/v1/projects/{projectUid}/jobs
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: 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: 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: SCIM
  - name: Segment
  - name: Segmentation Rules
  - name: Service
  - name: Spell Check
  - name: SubDomain
  - name: Supported Languages
  - name: Term Base
  - name: Translation
  - name: Translation Memory
  - name: User
  - name: Vendor
  - name: Webhook
  - name: Workflow Step
  - name: Workflow changes
  - name: XML Assistant
paths:
  /api2/v1/projects/{projectUid}/jobs:
    post:
      tags:
        - Job
      summary: Create job
      description: >-

        Upload a source file to create a translation job in the specified
        project.

        An API call to create a
        [job](https://support.phrase.com/hc/en-us/articles/5709686763420-Jobs-TMS-)

        within a specified
        [project](https://support.phrase.com/hc/en-us/articles/5709748435484-Projects-TMS-).

        The source file can be uploaded directly in the message body or
        downloaded from connector.


        **Job import is asynchronous.** The file is processed in the background
        after this call returns. The response

        body includes an `asyncRequest` object; poll [Get asynchronous
        request](../async-request/get-asynchronous-request)

        (action: `IMPORT_JOB`) to track import progress. To check whether
        individual jobs are ready, poll

        [Get job](../job/get-job) and inspect the `importStatus.status` field
        (`RUNNING`, `ERROR`, `OK`).


        Please supply job metadata in `Memsource` header. For file in the
        request body provide also the

        filename in `Content-Disposition` header.


        Accepted metadata:


        - **targetLangs** - This parameter specifies what languages should the
        job be created in. Only languages that are

        present in the project are supported, but this parameter accepts a
        subset of languages. When the file is uploaded, the

        number of jobs created (and returned) corresponds to the number of
        target languages and the workflow steps of the

        project. For example, `sample.json` imported for `EN>DE` and `EN>FR`
        language combination into a project with

        `Translation` and `Review` workflow steps will result in 4 jobs being
        created, one for each language and step.

        _Note_: Each time a file is uploaded, the resulting wordcount for each
        target language (not workflow step) is counted

        towards the organization's allowance.

        - **due** - ISO 8601

        - **workflowSettings** - This parameter is used to set up assignments
        and due date for projects with workflow steps.

        When a project is created, the global workflow steps available via [List
        workflow steps](../workflow-step/list-workflow-steps) are

        instantiated for the given project at hand. To assign users or due
        dates, these project specific IDs need to be used

        instead of the global ones.

        - **assignments** - If a project does not contain workflow steps, this
        parameter can be used to assign users directly.

        - **importSettings** - Re-usable [import
        settings](../import-settings/create-import-settings)

        - **useProjectFileImportSettings** - When project is created, either
        global default setting or settings of a

        [project
        template](https://support.phrase.com/hc/en-us/articles/5709647439772-Project-Templates-TMS-)
        are copied

        into it. This parameter can be used to reference these project settings
        instead of using the API defaults.

        Mutually exclusive with importSettings

        - **callbackUrl** - A URL that can be notified when the job creation has
        been finished.

        Unlike
        [webhooks](https://support.phrase.com/hc/en-us/articles/5709693398812-Webhooks-TMS-)
        which are global for the

        entire account, the `callbackUrl` is set only for the specific operation
        at hand.

        - **path** - A parameter that can be used to specify a location of the
        source file and preserved for later download.

        This is automatically created when importing ZIP files.

        - **preTranslate** - When `true`, the system automatically starts

        [pre-translation](https://support.phrase.com/hc/en-us/articles/5709717749788-Pre-translation-TMS-)

        after import completes. Recommended when pre-translation is the goal:
        the platform handles the

        import-ready gate internally, removing the need to manually poll
        `importStatus.status`.

        - **semanticMarkup** - Set semantic markup processing after import when
        enabled for organization

        - **xmlAssistantProfile** - Apply XML import settings defined using XML
        assistant

        - **jobPreviewPackageFileUidRef** - reference to a job preview package
        file to create a preview for the imported file
          
        For remote file jobs also `remoteFile` can be added. To retrieve the
        information below,

        use the [connector](../connector/list-connectors) APIs.

        - **connectorToken** - Token of the connector for the purposes of the
        APIs

        - **remoteFolder** - An encoded name of the folder, retrieved by e.g.
        [List files in a subfolder](../connector/list-files-in-a-subfolder)  

        - **remoteFileName** - An encoded name of the file, retrieved similarly
        to above.

        - **continuous** - Jobs created with files from a connector can be
        created

        as
        [continuous](https://support.phrase.com/hc/en-us/articles/5709711922972-Continuous-Jobs-CJ-TMS-)


        Create and assign job in project without workflow step:

        ```


        {
          "targetLangs": [
            "cs_cz"
          ],
          "callbackUrl": "https://my-shiny-service.com/consumeCallback",
          "importSettings": {
            "uid": "abcd123"
          },
          "due": "2007-12-03T10:15:30.00Z",
          "path": "destination directory",
          "assignments": [
            {
              "targetLang": "cs_cz",
              "providers": [
                {
                  "id": "4321",
                  "type": "USER"
                }
              ]
            }
          ],
          "notifyProvider": {
            "organizationEmailTemplate": {
              "id": "39"
            },
            "notificationIntervalInMinutes": "10"
          }
        }

        ```


        Create job from remote file without workflow steps:

        ```


        {
          "remoteFile": {
            "connectorToken": "948123ef-e1ef-4cd3-a90e-af1617848af3",
            "remoteFolder": "/",
            "remoteFileName": "Few words.docx",
            "continuous": false
          },
          "assignments": [],
          "workflowSettings": [],
          "targetLangs": [
            "cs"
          ]
        }

        ```


        Create and assign job in project with workflow step:

        ```


        {
          "targetLangs": [
            "de"
          ],
          "useProjectFileImportSettings": "true",
          "workflowSettings": [
            {
              "id": "64",
              "due": "2007-12-03T10:15:30.00Z",
              "assignments": [
                {
                  "targetLang": "de",
                  "providers": [
                    {
                      "id": "3",
                      "type": "VENDOR"
                    }
                  ]
                }
              ],
              "notifyProvider": {
                "organizationEmailTemplate": {
                  "id": "39"
                },
                "notificationIntervalInMinutes": "10"
              }
            }
          ]
        }

        ```


        Create a job with job preview package reference:

        ```

        {
          "targetLangs": [
            "de"
          ],
          "jobPreviewPackageFileUidRef": {"uid": "jobPreviewPackageFileUid123"}
        }

        ```
            
      operationId: createJob
      parameters:
        - name: projectUid
          in: path
          description: Project UID
          required: true
          schema:
            type: string
        - name: Memsource
          in: header
          description: Job metadata JSON (see endpoint description for accepted fields)
          required: true
          schema:
            type: string
            format: application/json
        - name: Content-Disposition
          in: header
          description: >-
            Required when `remoteFile` is empty. Must match pattern
            `((inline|attachment); )?(filename\*=UTF-8''(.+)|filename="?(.+)"?)`
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/octet-stream:
            schema:
              $ref: '#/components/schemas/InputStream'
        description: >-
          Source file binary; required when `remoteFile` is not supplied in the
          metadata
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobListDtoV1'
        '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
    JobListDtoV1:
      type: object
      properties:
        asyncRequest:
          $ref: '#/components/schemas/AsyncRequestReferenceV1'
        jobs:
          type: array
          description: Job parts created by the operation
          items:
            $ref: >-
              #/components/schemas/A_reference_to_a_job_part_workflow-step_instance_of_a_job_
        unsupportedFiles:
          type: array
          description: >-
            Filenames that could not be imported because their format is
            unsupported
          items:
            type: string
        warnings:
          type: array
          description: Warnings raised during import, grouped by domain
          items:
            $ref: '#/components/schemas/JobListWarningDtoV1'
    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
            - ALIGN
            - EXPORT_TMX_BY_QUERY
            - EXPORT_TMX
            - IMPORT_TMX
            - IMPORT_MXLF_INTO_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
            - 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
        dateCreated:
          type: string
          format: date-time
        id:
          type: string
    A_reference_to_a_job_part_workflow-step_instance_of_a_job_:
      type: object
      properties:
        continuous:
          type: boolean
          description: >-
            When true, this is a continuous job that automatically imports
            updated source files
        dateCreated:
          type: string
          format: date-time
          description: Date and time the job part was created
        dateDue:
          type: string
          format: date-time
          description: Due date of the job part; null if not set
        filename:
          type: string
          description: Original filename of the job
        imported:
          type: boolean
          description: >-
            When true, the file has been fully imported and is ready for
            translation
        jobAssignedEmailTemplate:
          $ref: '#/components/schemas/ObjectReference'
        notificationIntervalInMinutes:
          type: integer
          format: int32
          description: Minimum interval in minutes between assignment notification emails
        providers:
          type: array
          description: Providers assigned to this job part; empty for non-linguist callers
          items:
            $ref: '#/components/schemas/ProviderReferenceV1'
        sourceFileUid:
          type: string
          description: UID of the source file; null if unavailable
        status:
          type: string
          description: Current status of the job part
          enum:
            - NEW
            - ACCEPTED
            - DECLINED
            - REJECTED
            - DELIVERED
            - EMAILED
            - COMPLETED
            - CANCELLED
        targetLang:
          type: string
          description: Target language code
        uid:
          type: string
          description: Unique identifier used in API paths
        updateSourceDate:
          type: string
          format: date-time
          description: >-
            Date and time the source file was last updated; null if never
            updated
        workflowLevel:
          type: integer
          format: int32
          description: Position of the workflow step (1-based)
        workflowStep:
          $ref: '#/components/schemas/WorkflowStepReferenceV1'
    JobListWarningDtoV1:
      type: object
      properties:
        domain:
          type: string
          enum:
            - STYLEGUIDE
        jobPartIds:
          type: array
          items:
            type: string
        message:
          type: string
    ObjectReference:
      type: object
    ProviderReferenceV1:
      type: object
      required:
        - type
      discriminator:
        propertyName: type
      properties:
        id:
          type: string
        type:
          type: string
        uid:
          type: string
          description: UID of the provider
          readOnly: true
    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: {}

````