
## Current status

`GET /v1/workday/status`

Returns the current state of an employee's workday: status, start and finish time, duration, breaks.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|--------------|---------|
| `userId` | number | no | Employee identifier. Defaults to the user who owns the key's tokens. Other employees' `userId` is available only to Bitrix24 account administrators and the employee's direct managers — otherwise Bitrix24 returns an access error |

## Examples

### curl — personal key

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

### curl — another employee's status

```bash
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://vibecode.bitrix24.com/v1/workday/status?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/status
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workday/status', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
console.log('Status:', data.status)
console.log('Active day:', data.active)
console.log('Duration:', data.duration)
```

### JavaScript — another employee's status

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workday/status?userId=503', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/workday/status', {
  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.status` | string | Day status: `OPENED`, `CLOSED`, `PAUSED`, `EXPIRED` |
| `data.timeStart` | string | Start date and time of the current or last day (ISO 8601) |
| `data.timeFinish` | string \| null | Finish date and time. `null` for a day that is not closed. For a day in `PAUSED` — the start of the current pause |
| `data.duration` | string | Day duration in `HH:MM:SS` format |
| `data.timeLeaks` | string | Total duration of pauses for the day in `HH:MM:SS` format |
| `data.active` | boolean | Active workday record flag |
| `data.ipOpen` | string | IP address of the day start. Empty string if the day was started without IP capture |
| `data.ipClose` | string | IP address of the day finish. Empty string for a day that is not closed |
| `data.latOpen` | number | Geographic latitude of the start point. `0` — coordinates were not passed |
| `data.lonOpen` | number | Geographic longitude of the start point |
| `data.latClose` | number | Geographic latitude of the finish point |
| `data.lonClose` | number | Geographic longitude of the finish point |
| `data.tzOffset` | number | Employee's time zone offset in seconds (depends on the employee's settings in the Bitrix24 account — the example `0` corresponds to UTC) |

When the requested employee has no workday record, `data` contains only `status` — the other fields are absent. See "Degenerate response with no workday record" under "Known specifics".

## Possible `status` values

| Status | Description |
|--------|---------|
| `OPENED` | The workday is open |
| `CLOSED` | The workday is closed |
| `PAUSED` | The workday is paused |
| `EXPIRED` | The workday was not closed before the start of the next calendar day |

## Response example

```json
{
  "success": true,
  "data": {
    "status": "OPENED",
    "timeStart": "2026-05-05T09:00:00+00:00",
    "timeFinish": null,
    "duration": "04:00:00",
    "timeLeaks": "00:30:00",
    "active": true,
    "ipOpen": "203.0.113.10",
    "ipClose": "",
    "latOpen": 0,
    "lonOpen": 0,
    "latClose": 0,
    "lonClose": 0,
    "tzOffset": 0
  }
}
```

An employee with no workday record — the response collapses to a single `status` field:

```json
{
  "success": true,
  "data": {
    "status": "CLOSED"
  }
}
```

## 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` | 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` (for example, no permission for another user's `userId`) |
| 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

- **State after closing.** After the day is closed, the endpoint keeps returning the details of the last day (`CLOSED`, with `timeFinish` filled in) until the next one is opened — the report for the closed day is available through the same request.
- **The record may be from any date — check `timeStart` against today.** `status` and `timeStart` describe the employee's *most recent* workday record, which can be arbitrarily old: Bitrix24 `timeman.status` returns the last record regardless of age. A day `CLOSED` three years ago, or a day left `EXPIRED` (opened and never closed) five days ago, are both returned verbatim — neither means "today". This endpoint has no "today only" filter, so to decide whether the day belongs to the current date, compare the date part of `timeStart` with the current date on your side before trusting `status`. For a team-status dashboard, treat a record whose `timeStart` is not today as "no workday started today".
- **Degenerate response with no workday record.** When the requested employee has no workday record, `data` contains only the `status` field. The other fields (`timeStart`, `timeFinish`, `duration`, and the rest) are absent from the response, so check that a field is present before reading it. There is no record, for example, for an employee whose day has never been opened.
- **Closing an expired day.** In the `EXPIRED` status the day is closed retroactively. Pass the `time` parameter to [`POST /v1/workday/close`](/docs/workday/close) with a date equal to the day's start date — the `timeStart` value from this endpoint's response — together with the required `report`. A `time` date other than the start date returns `422`.

## See also

- [Open workday](/docs/workday/open) — `POST /v1/workday/open`.
- [Close workday](/docs/workday/close) — `POST /v1/workday/close`.
- [Pause](/docs/workday/pause) — `POST /v1/workday/pause`.
- [Tracking settings](/docs/workday/settings) — `GET /v1/workday/settings`.
- [Workday](/docs/workday) — section overview.
