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

# Assign Translator to Folder Orders

> Batch assign a translator to eligible orders in a folder with optional language filters

Assigns a translator to all eligible (unassigned, completed) orders in the specified folder. Optionally filter by `sourceLanguage` and/or `targetLanguage` to only assign orders matching a specific language pair.

When no language filters are provided, all eligible orders in the folder are assigned.

<RequestExample>
  ```bash cURL (all orders) theme={null}
  curl -X POST "https://api-integration.ollang.com/integration/folder/60b8d6f1e1b9b1d8c6c0d8e1/assign-translator-to-orders" \
    -H "X-Api-Key: <your-api-key>" \
    -H "Content-Type: application/json" \
    -d '{
      "translatorId": "507f1f77bcf86cd799439011"
    }'
  ```

  ```bash cURL (filtered by language pair) theme={null}
  curl -X POST "https://api-integration.ollang.com/integration/folder/60b8d6f1e1b9b1d8c6c0d8e1/assign-translator-to-orders" \
    -H "X-Api-Key: <your-api-key>" \
    -H "Content-Type: application/json" \
    -d '{
      "translatorId": "507f1f77bcf86cd799439011",
      "deadline": "2026-07-01T00:00:00.000Z",
      "sourceLanguage": "en",
      "targetLanguage": "fr"
    }'
  ```

  ```javascript JavaScript theme={null}
  const folderId = "60b8d6f1e1b9b1d8c6c0d8e1";

  const response = await fetch(
    `https://api-integration.ollang.com/integration/folder/${folderId}/assign-translator-to-orders`,
    {
      method: "POST",
      headers: {
        "X-Api-Key": "<your-api-key>",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        translatorId: "507f1f77bcf86cd799439011",
        sourceLanguage: "en",
        targetLanguage: "fr",
      }),
    },
  );

  const data = await response.json();
  console.log(`Assigned ${data.assignedCount} orders`);
  ```

  ```python Python theme={null}
  import requests

  folder_id = "60b8d6f1e1b9b1d8c6c0d8e1"

  response = requests.post(
      f"https://api-integration.ollang.com/integration/folder/{folder_id}/assign-translator-to-orders",
      headers={
          "X-Api-Key": "<your-api-key>",
          "Content-Type": "application/json",
      },
      json={
          "translatorId": "507f1f77bcf86cd799439011",
          "sourceLanguage": "en",
          "targetLanguage": "fr",
      },
  )

  data = response.json()
  print(f"Assigned {data['assignedCount']} orders")
  ```
</RequestExample>

## Authorizations

This endpoint requires API key authentication. Include your API key in the request header:

* **Header name**: `X-Api-Key`
* **Header value**: Your API key from the Ollang dashboard

## Path Parameters

<ParamField path="folderId" type="string" required>
  The unique identifier of the folder containing the orders.
</ParamField>

## Body Parameters

<ParamField body="translatorId" type="string" required>
  The translator ID to assign to the orders.
</ParamField>

<ParamField body="deadline" type="string">
  Optional deadline for the assignment in ISO 8601 format (e.g., `2026-07-01T00:00:00.000Z`).
</ParamField>

<ParamField body="sourceLanguage" type="string">
  Filter by source language code (e.g., `en`). Only orders with this source language will be assigned.
</ParamField>

<ParamField body="targetLanguage" type="string">
  Filter by target language code (e.g., `fr`). Only orders with this target language will be assigned.
</ParamField>

## Response

<ResponseField name="assignedCount" type="number">
  The number of orders that were successfully assigned.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "assignedCount": 12
  }
  ```

  ```json 400 theme={null}
  {
    "statusCode": 400,
    "message": [
      "translatorId must be a string"
    ],
    "error": "Bad Request"
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Unauthorized",
    "message": "Invalid or missing API key",
    "code": "UNAUTHORIZED"
  }
  ```
</ResponseExample>
