
## Calendar section fields

`GET /v1/calendar-sections/fields`

Returns the field reference for a calendar section: the value type, the read-only flag, whether the field is required on create, and the list of allowed values for fields with a fixed set.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/calendar-sections/fields" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/calendar-sections/fields', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Fields:', Object.keys(data.fields).length)
```

### JavaScript — OAuth application

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

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.fields` | object | The section field reference. The key is the field name in camelCase, the value is its description |
| `data.fields.<name>.type` | string | The field value type: `number`, `string`, `boolean`, `object`, or `datetime` |
| `data.fields.<name>.readonly` | boolean | `true` — the field is filled in by the system; on create and update it is rejected with `400 READONLY_FIELD` |
| `data.fields.<name>.required` | boolean | Present on fields that are required on create |
| `data.batch` | array | Section operations available in a [batch request](/docs/batch): `create`, `update`, `delete` |

A field with a fixed set of values also carries an `enum` array — every element holds a `value` to pass in the request and a `label` caption.

The reference describes fourteen fields:

| Field | Type | RO | Description |
|------|-----|:--:|---------|
| `id` | number | yes | Section identifier |
| `name` | string | | Section name. Required on create |
| `description` | string | | Section description |
| `type` | string | | Calendar type. Required on create. The allowed values are listed in `enum`: `user` — a user calendar, `group` — a workgroup calendar, `company_calendar` — a company calendar, `location` — a meeting-room calendar |
| `ownerId` | number | | Calendar owner identifier. Required on create. For the `user` type — the employee identifier from `GET /v1/users`. The owner of the remaining types is described in [Calendar sections](/docs/entities/calendar-sections) |
| `color` | string | | Section color in `#RRGGBB` format |
| `textColor` | string | | Text color in `#RRGGBB` format |
| `export` | object | | Export parameters in iCal format. The keys inside the object are uppercase |
| `access` | object | yes | Section access-rights map |
| `perm` | object | yes | Permission map of the current employee |
| `isCollab` | boolean | yes | Whether the section belongs to a collab |
| `createdBy` | number | yes | The employee who created the section. List: `GET /v1/users` |
| `dateCreate` | datetime | yes | Section creation date |
| `updatedAt` | datetime | yes | Date the section was last modified |

## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true },
      "name": { "type": "string", "readonly": false, "required": true },
      "description": { "type": "string", "readonly": false },
      "type": {
        "type": "string",
        "readonly": false,
        "required": true,
        "enum": [
          { "value": "user", "label": "User calendar" },
          { "value": "group", "label": "Workgroup calendar" },
          { "value": "company_calendar", "label": "Company calendar" },
          { "value": "location", "label": "Location calendar" }
        ]
      },
      "ownerId": { "type": "number", "readonly": false, "required": true },
      "color": { "type": "string", "readonly": false },
      "textColor": { "type": "string", "readonly": false },
      "export": { "type": "object", "readonly": false },
      "access": { "type": "object", "readonly": true },
      "perm": { "type": "object", "readonly": true },
      "isCollab": { "type": "boolean", "readonly": true },
      "createdBy": { "type": "number", "readonly": true },
      "dateCreate": { "type": "datetime", "readonly": true },
      "updatedAt": { "type": "datetime", "readonly": true }
    },
    "batch": ["create", "update", "delete"]
  }
}
```

## Error response example

403 — the scope is missing:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The key is missing the `calendar` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal, all API keys of the portal share one limit. The exact value arrives in the `x-ratelimit-limit` header (the cap is divided across replicas). Retry after the delay in the `Retry-After` header |

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

## Known specifics

**The reference is identical on every Bitrix24 account.** The response is assembled from the entity description on the Vibecode platform side and is never requested from the account. So the field set, the field types, and the `enum` values depend neither on the settings of a particular account nor on Bitrix24 availability, and custom fields do not appear in the reference.

## See also

- [List sections](/docs/entities/calendar-sections/list)
- [Create a section](/docs/entities/calendar-sections/create)
- [Update section](/docs/entities/calendar-sections/update)
- [Calendar sections](/docs/entities/calendar-sections)
- [API reference](/docs/api-reference)
