
## Tracking settings

`GET /v1/workday/settings`

Returns the work time tracking settings that apply to the current user or to the specified employee in the Bitrix24 account: whether work time tracking is enabled, whether the schedule is flexible, the permitted day start and finish times, and the minimum duration.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|--------------|---------|
| `userId` | number | no | Employee identifier. Defaults to the user who owns the key's tokens. Bitrix24 returns another employee's settings only to a user with the right to manage work time of all employees. Without that right the request is rejected with `422 BITRIX_ERROR` |

## Examples

### curl — personal key

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

### curl — another employee's settings

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

### 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('Latest permitted start:', 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 `ufTmMaxStart`/`ufTmMinFinish`/`ufTmMinDuration` fields 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 configured start and finish times in `HH:MM:SS` format |
| `data.admin` | boolean | Whether the user is a work time tracking administrator. Returned only in the caller's own settings, absent for another employee |

## 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 |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `userId` is not a positive integer |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |
| 401 | `INVALID_API_KEY` | The key is not recognized — no such key exists on the platform |
| 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 |
| 409 | `TIMEMAN_MODULE_NOT_ENABLED` | Time Management is not available on this portal: the module is not installed (not included in the plan), or the tool is switched off in portal settings. Ask a portal administrator to enable it — until then every `timeman.*` method answers the same way |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request — text is in `message` |
| 429 | `RATE_LIMITED` | The rate limit for requests 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.** Without `userId` the response corresponds to the user who owns the key's tokens. Values may differ across employees if they have different work schedules configured.
- **Per-employee tracking flag.** To find out whether work time is tracked for a specific employee, pass their `userId` and read `data.ufTimeman`. A manager's right over their own subordinates is not enough: Bitrix24 requires the right over the work time of all employees.

## See also

- [Work schedule](/docs/workday/schedule)
- [Current status](/docs/workday/status)
- [Workday history](/docs/workday/records)
- [Workday](/docs/workday)
