
## Address fields

`GET /v1/addresses/fields`

Returns the address field schema — a list of all valid fields with their types, required flags, and whether they are writable.

## Examples

### curl — personal key

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

### curl — OAuth app

```bash
curl "https://vibecode.bitrix24.com/v1/addresses/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/addresses/fields', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
const fieldNames = Object.keys(data.fields)
```

### JavaScript — OAuth app

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

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

## Response fields

| Field | Bitrix24 | Type | RO | Description |
|------|-----------|-----|----|---------|
| `typeId` | `TYPE_ID` | number | — | Address type. Required, immutable after creation |
| `entityTypeId` | `ENTITY_TYPE_ID` | number | — | Address owner type. Required, immutable after creation |
| `entityId` | `ENTITY_ID` | number | — | Address owner ID. Required, immutable after creation |
| `address1` | `ADDRESS_1` | string | — | Street, building, block, structure |
| `address2` | `ADDRESS_2` | string | — | Apartment, office |
| `city` | `CITY` | string | — | City |
| `postalCode` | `POSTAL_CODE` | string | — | Postal code |
| `region` | `REGION` | string | — | District |
| `province` | `PROVINCE` | string | — | Province |
| `country` | `COUNTRY` | string | — | Country |
| `countryCode` | `COUNTRY_CODE` | string | — | Country code |
| `locAddrId` | `LOC_ADDR_ID` | number | — | Location address identifier |
| `anchorTypeId` | `ANCHOR_TYPE_ID` | number | yes | Type of the entity the address is linked to |
| `anchorId` | `ANCHOR_ID` | number | yes | ID of the entity the address is linked to |

RO — the field is read-only. The "Bitrix24" column is the name of the same field in Bitrix24.

## Response example

```json
{
  "success": true,
  "data": {
    "fields": {
      "typeId": {
        "type": "integer",
        "isRequired": true,
        "isReadOnly": false,
        "isImmutable": true,
        "isMultiple": false,
        "isDynamic": false,
        "title": "TYPE_ID"
      },
      "entityTypeId": {
        "type": "integer",
        "isRequired": true,
        "isReadOnly": false,
        "isImmutable": true,
        "isMultiple": false,
        "isDynamic": false,
        "title": "ENTITY_TYPE_ID"
      },
      "entityId": {
        "type": "integer",
        "isRequired": true,
        "isReadOnly": false,
        "isImmutable": true,
        "isMultiple": false,
        "isDynamic": false,
        "title": "ENTITY_ID"
      },
      "address1": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "Street, building, block, structure"
      },
      "address2": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "Apartment / office"
      },
      "city": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "City"
      },
      "postalCode": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "Postal code"
      },
      "region": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "District"
      },
      "province": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "Province"
      },
      "country": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "Country"
      },
      "countryCode": {
        "type": "string",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "COUNTRY_CODE"
      },
      "locAddrId": {
        "type": "integer",
        "isRequired": false,
        "isReadOnly": false,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "Location address identifier"
      },
      "anchorTypeId": {
        "type": "integer",
        "isRequired": false,
        "isReadOnly": true,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "ANCHOR_TYPE_ID"
      },
      "anchorId": {
        "type": "integer",
        "isRequired": false,
        "isReadOnly": true,
        "isImmutable": false,
        "isMultiple": false,
        "isDynamic": false,
        "title": "ANCHOR_ID"
      }
    }
  }
}
```

## Error response example

403 — the API key lacks the `crm` scope:

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

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 403 | `SCOPE_DENIED` | The API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## Known specifics

**The fields `typeId`, `entityTypeId`, `entityId` are immutable.** The `isImmutable: true` flag means these fields cannot be changed after the address is created. They form the composite key and are not passed in the body of update requests.

## See also

- [Get address](/docs/entities/addresses/get)
- [List addresses](/docs/entities/addresses/list)
- [Requisite fields](/docs/entities/requisites/fields)
- [Addresses](/docs/entities/addresses)
