# Run auto-assign engine for a production order (/docs/api-reference/production-orders/ProductionOrdersController_autoAssign)

`POST /api/factories/{factoryId}/production-orders/{id}/auto-assign`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `factoryId` | path | yes | string | Factory ID |
| `id` | path | yes | string | Production Order ID |

## Responses

### 200: Auto-assign completed with sub-orders generated

### 400: Order must have a production method

### 404: Production order not found