
## Tracking settings

`GET /v1/workday/settings`

Returns the work time tracking settings in effect in the Bitrix24 account for the current user: whether work time is allowed, whether the schedule is flexible, the permitted day start and finish, and the minimum duration.

## Parameters

No parameters.

## Examples

### curl — personal key

```bash
curl -H "X-Api-Key: YOUR_API_KEY" \
  https://vibecode.bitrix24.com/v1/workday/settings
```

### curl — OAuth application

```bash
curl -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  https://vibecode.bitrix24.com/v1/workday/settings
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workday/settings', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
console.log('Time tracking enabled:', data.ufTimeman)
console.log('Flexible schedule:', data.ufTmFree)
console.log('Permitted start up to:', data.ufTmMaxStart)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workday/settings', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const { data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on a successful response |
| `data.ufTimeman` | boolean | Whether work time tracking is enabled for the user |
| `data.ufTmFree` | boolean | Flexible schedule. `true` — no restrictions on the day start and finish; `false` — the fields `ufTmMaxStart`/`ufTmMinFinish`/`ufTmMinDuration` apply |
| `data.ufTmMaxStart` | string | The latest permitted day start time in `HH:MM:SS` format |
| `data.ufTmMinFinish` | string | The earliest permitted day finish time in `HH:MM:SS` format |
| `data.ufTmMinDuration` | string | The minimum workday duration in `HH:MM:SS` format |
| `data.ufTmAllowedDelta` | string | The permitted deviation from the set start and finish time in `HH:MM:SS` format |
| `data.admin` | boolean | Whether the user is a work time tracking administrator |

## Response example

```json
{
  "success": true,
  "data": {
    "ufTimeman": true,
    "ufTmFree": true,
    "ufTmMaxStart": "09:15:00",
    "ufTmMinFinish": "17:45:00",
    "ufTmMinDuration": "08:00:00",
    "ufTmAllowedDelta": "00:15:00",
    "admin": true
  }
}
```

## Error response example

403 — the key lacks the `timeman` scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'timeman' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |
| 401 | `INVALID_API_KEY` | Invalid API key |
| 401 | `KEY_EXPIRED` | The API key has expired |
| 401 | `TOKEN_MISSING` | The key has no OAuth tokens configured for the portal |
| 402 | `ACCOUNT_FROZEN` | The portal balance is frozen |
| 403 | `SCOPE_DENIED` | The key lacks the `timeman` scope |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request — text is in `message` |
| 429 | `RATE_LIMITED` | The request limit to Bitrix24 was exceeded |
| 502 | `BITRIX_UNAVAILABLE` | The Bitrix24 portal is unavailable |

The full list of common API errors — [Errors](/docs/errors).

## Known specifics

- **Tied to the key's tokens.** The response corresponds to the user who owns the key's tokens. Values may differ across employees if they have different work schedules configured.

## See also

- [Work schedule](/docs/workday/schedule) — `GET /v1/workday/schedule`.
- [Current status](/docs/workday/status) — `GET /v1/workday/status`.
- [Workday](/docs/workday) — section overview.
