# Update a machine (/docs/api-reference/machines/MachinesController_update)

`PATCH /api/factories/{factoryId}/machines/{id}`

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 | Machine ID |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Machine display name"
    },
    "factoryId": {
      "type": "string",
      "description": "Existing factory slug only. To change factories, use POST :id/transfer to preserve source history."
    },
    "machineType": {
      "type": "string",
      "description": "Type of machine"
    },
    "protocol": {
      "type": "string",
      "description": "Communication protocol (canonical vocabulary)",
      "enum": [
        "fanuc-focas",
        "opc-ua",
        "modbus-tcp",
        "mtconnect",
        "mqtt",
        "andon",
        "manual"
      ]
    },
    "connectionConfig": {
      "type": "object",
      "description": "Connection configuration"
    },
    "location": {
      "type": "string",
      "description": "Physical location"
    },
    "tier": {
      "type": "string",
      "description": "Subscription tier",
      "enum": [
        "basic",
        "iot",
        "ai"
      ]
    },
    "workAreaId": {
      "type": "string",
      "description": "Work area ID this machine belongs to"
    },
    "isActive": {
      "type": "boolean",
      "description": "Whether the machine is active"
    }
  }
}
```

## Responses

### 200: Machine updated

### 404: Machine not found