
## Site fields

`GET /v1/sites/fields`

Returns a map of all site fields with their type, read-only flag, label and description. Fields without that flag are writable on create and update.

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/sites/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/sites/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/sites/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 | Map of site fields: the key is the field name, the value describes the field. The fields are listed in the table below |
| `data.fields.<field>.type` | string | Value type: `number`, `string`, `boolean` or `datetime` |
| `data.fields.<field>.readonly` | boolean | `true` — the field is read-only and is not sent on create or update |
| `data.fields.<field>.required` | boolean | Present and set to `true` on the fields required on create: `title` and `code` |
| `data.fields.<field>.nullable` | boolean | Present and set to `true` on the fields whose value may be absent |
| `data.fields.<field>.label` | string | Field label |
| `data.fields.<field>.description` | string | Field description |
| `data.fields.type.enum` | array | Allowed values of the `type` field. Each value is an object with the `value` and `label` keys |
| `data.aggregatable` | array | Fields you can group by in [aggregation](./aggregate.md) |
| `data.batch` | array | Operations available in batch mode |

All 22 fields carry a `label` and a `description`. The `nullable: true` key is present on eight fields: `description`, `xmlId`, `landingIdIndex`, `landingId404`, `landingId503`, `tplCode`, `smnSiteId`, `lang`. What an absent value looks like for each of them is shown in the table below.

The `label` and `description` values are returned in English. Request headers do not switch the language.

Site fields in the `data.fields` map:

| Field | Type | RO | Description |
|------|-----|:--:|---------|
| `id` | number | yes | Site identifier |
| `title` | string | | Name, up to 255 characters |
| `code` | string | | Symbolic code in the URL |
| `type` | string | | Site type: `PAGE`, `STORE`, `KNOWLEDGE` — created via the API. Responses may also contain `VIBE` and `SMN` |
| `active` | boolean | yes | Whether the site is active. Read-only: Bitrix24 does not store the value on create or on update, so sending the field is refused with `400 READONLY_FIELD`. A site is activated by `POST /v1/sites/:id/publication` or by publishing it in the interface |
| `domainId` | number | | Domain identifier |
| `description` | string \| null | | Description, up to 255 characters. `null` if not set |
| `xmlId` | string \| null | | External identifier. `null` if not set |
| `landingIdIndex` | number \| null | | Home page. Set on update, after the pages are created |
| `landingId404` | number \| null | | 404 error page. If not assigned — `0` or `null` |
| `landingId503` | number \| null | | 503 error page. If not assigned — `0` or `null` |
| `deleted` | string | yes | Recycle bin flag: `"Y"` / `"N"` |
| `createdById` | number | yes | Creator. Lookup: `GET /v1/users` |
| `modifiedById` | number | yes | Last editor. Lookup: `GET /v1/users` |
| `dateCreate` | datetime | yes | Creation date. Bitrix24 locale format, not ISO 8601 |
| `dateModify` | datetime | yes | Last modification date. Bitrix24 locale format |
| `tplId` | number | yes | Site template identifier |
| `tplCode` | string \| null | yes | Template symbolic code. `null` if the template has no code |
| `smnSiteId` | string \| null | yes | Linked "Site Management" site of type `SMN`. `null` for regular sites |
| `lang` | string \| null | yes | Language code, for example `en`. `null` if not set |
| `special` | string | yes | Bitrix24 service flag: `"Y"` / `"N"` |
| `version` | number | yes | Version of the site's internal structure |

## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "id": {
        "type": "number",
        "readonly": true,
        "label": "Site ID",
        "description": "Unique numeric identifier of the site."
      },
      "title": {
        "type": "string",
        "readonly": false,
        "required": true,
        "label": "Title",
        "description": "Site name, up to 255 characters. Required on create."
      },
      "type": {
        "type": "string",
        "readonly": false,
        "label": "Site type",
        "description": "Site type. PAGE/STORE/KNOWLEDGE are creatable via the API (KNOWLEDGE needs scope: \"KNOWLEDGE\" on create and update). VIBE (a site built in the constructor) and SMN (a link with the \"Site Management\" module) appear in responses only and are read-only.",
        "enum": [
          { "value": "PAGE", "label": "Landing" },
          { "value": "STORE", "label": "Online store" },
          { "value": "KNOWLEDGE", "label": "Knowledge base 2.0" },
          { "value": "VIBE", "label": "Constructor site (read-only)" },
          { "value": "SMN", "label": "Site Management link (read-only)" }
        ]
      },
      "active": {
        "type": "boolean",
        "readonly": true,
        "label": "Active",
        "description": "Whether the site is active. Read-only: Bitrix24 stores the value neither on create nor on update — landing.site.add and landing.site.update do not declare the field, a new site is always created inactive, and a live round-trip on both verbs answered with a success while the flag stayed off. A site is activated by POST /v1/sites/:id/publication or by publishing it in the Bitrix24 interface."
      },
      "description": {
        "type": "string",
        "readonly": false,
        "nullable": true,
        "label": "Description",
        "description": "Site description, up to 255 characters. Comes back as null when not set."
      }
    },
    "aggregatable": ["type", "active", "deleted", "lang", "tplId", "domainId", "createdById", "modifiedById"],
    "batch": ["create", "update", "delete"]
  }
}
```

5 of 22 fields are shown. The full list is in the table above.

## Error response example

403 — no scope:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |

For the full list of common API errors, see [Errors](/docs/errors).

## See also

- [Create a site](/docs/entities/sites/create)
- [Update a site](/docs/entities/sites/update)
- [Sites](/docs/entities/sites)
- [Entity API](/docs/entity-api)
