# List legal fields

> Available starting with the **sign 26.1300.0** module. On older self-hosted installations the method may be unavailable: the platform returns `422 METHOD_NOT_YET_AVAILABLE` with `error.release`.

`GET /v1/sign-b2e/legal-fields`

Returns the codes, formats, captions, writability and placeholders of legal fields. The key owner needs permission to view employee legal data.

**Scopes:** `sign.b2e`.

## Examples

### curl — personal key

```bash
curl -X GET 'https://vibecode.bitrix24.com/v1/sign-b2e/legal-fields' \
  -H 'X-Api-Key: YOUR_API_KEY'
```

### curl — OAuth application

```bash
curl -X GET 'https://vibecode.bitrix24.com/v1/sign-b2e/legal-fields' \
  -H 'X-Api-Key: YOUR_APP_KEY' \
  -H 'Authorization: Bearer USER_SESSION_TOKEN'
```

### JavaScript — personal key

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/sign-b2e/legal-fields', {
  "method": "GET",
  "headers": {
    "X-Api-Key": "YOUR_API_KEY"
  }
});
const result = await response.json();
if (!response.ok || !result.success) throw new Error(result.error?.message);
console.log(result.data);
```

### JavaScript — OAuth application

```javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/sign-b2e/legal-fields', {
  "method": "GET",
  "headers": {
    "X-Api-Key": "YOUR_APP_KEY",
    "Authorization": "Bearer USER_SESSION_TOKEN"
  }
});
const result = await response.json();
if (!response.ok || !result.success) throw new Error(result.error?.message);
console.log(result.data);
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | Whether the request succeeded. |
| `data` | array<object> | Operation data. |
| `data[].code` | string | Machine-readable code. |
| `data[].type` | string | Value format: string, snils, inn, date, address, url, enumeration, fullname. Treat an unknown format as not writable. |
| `data[].caption` | string | Field caption in the Bitrix24 account language. |
| `data[].writable` | boolean | Whether the field value can be written. |
| `data[].signerPlaceholder` | string \| null | Employee placeholder in DOCX; null if none. |
| `data[].assigneePlaceholder` | string \| null | Company representative placeholder in DOCX; null if none. |
| `data[].options` | array \| null | List options; null for other formats. |
| `data[].options[].id` | integer \| string | Object ID. |
| `data[].options[].value` | string | List option name. |
| `meta.redacted` | array<string> | Present when credentials are hidden; contains the paths of the replaced values. |

## Response example

Shape of a successful response; the data depends on the Bitrix24 account and the request.

```json
{
  "success": true,
  "data": []
}
```

## Error response example

403 — the key lacks a required scope:

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

## Errors

| HTTP | Code | Reason |
|---|---|---|
| 400 | `INVALID_PARAMS` | Invalid request shape: types, required fields or an unknown query string parameter. |
| 401 | `TOKEN_MISSING` | No credentials for the Bitrix24 connection. |
| 403 | `SCOPE_DENIED` | One of the required scopes is not granted. |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the operation; the code is in error.b24Code, the text in error.message. |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The method is not yet available on the Bitrix24 account; the release is in error.release. |

[Common API errors](/docs/errors).

## Known specifics

Bitrix24 checks user permissions, HR e-signature availability, business rules, page sizes and field contents. Values are passed through without local correction. Response text is JSON-encoded; credential-bearing links are hidden.

## See also

- [Employee signatures](/docs/sign-b2e)
- [API errors](/docs/errors)
