# Update a shift (/docs/api-reference/shifts/ShiftsController_updateShift)

`PATCH /api/factories/{factoryId}/shifts/{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 | Shift ID |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Shift name.",
      "example": "Morning"
    },
    "startTime": {
      "type": "string",
      "description": "Start time (HH:MM).",
      "example": "07:00"
    },
    "endTime": {
      "type": "string",
      "description": "End time (HH:MM).",
      "example": "15:00"
    },
    "daysOfWeek": {
      "description": "Days of week 0=Sun..6=Sat.",
      "example": [
        1,
        2,
        3,
        4,
        5
      ],
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "isActive": {
      "type": "boolean",
      "description": "Active flag.",
      "example": true
    }
  }
}
```

## Responses

### 200: Updated shift