# Submit visitor values

`POST /v1/crm-forms/:id/results`

Submits a CRM form result on behalf of a visitor. This is a write: Bitrix24 may create a lead or deal, start automation and notify responsible users. It does not change form configuration.

Scope: `crm`. Requires a READWRITE key.

## Parameters

`id` is a positive form ID from [list forms](/docs/entities/crm-forms/list).

| Body field | Type | Required | Description |
|---|---|---|---|
| `fields` | object | yes | Non-empty values object. Keys are native field names such as `LEAD_NAME`, `LEAD_PHONE`. See [get a form](/docs/entities/crm-forms/get) for its fields |
| `presets` | object | no | Preset values, forwarded to Bitrix24 without transformation |
| `fromUrl` | string | no | Address of the page where the form was completed |

Other parameters are rejected. Bitrix24 validates the fields and their values; this method does not support `file` fields.

## Example

```bash
curl -X POST 'https://vibecode.bitrix24.com/v1/crm-forms/8/results' \
  -H 'X-Api-Key: YOUR_API_KEY' -H 'Content-Type: application/json' \
  -d '{"fields":{"LEAD_NAME":"Alex","LEAD_PHONE":"+12025550123"},"fromUrl":"https://example.com/contact"}'
```

For an OAuth application, use its key and the `Authorization: Bearer USER_SESSION_TOKEN` header.

Success is HTTP 201:

```json
{"success":true,"data":{"resultId":227}}
```

`resultId` identifies the CRM form result, not the lead or deal it created.

## Errors

| HTTP | Code | Reason |
|---|---|---|
| 400 | `MISSING_REQUIRED_FIELDS` | `fields` is absent, empty or not an object |
| 400 | `INVALID_PARAMS` | Invalid id, body shape, `presets`, `fromUrl` or an extra parameter |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | READONLY key |
| 403 | `SCOPE_DENIED` | Missing `crm` scope |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 refused access |
| 404 | `ENTITY_NOT_FOUND` | `Form not found.` |
| 422 | `BITRIX_ERROR` | `Form is not active.`, a field validation error or an unsupported `file` field; the Bitrix24 message is retained |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 returned no valid result ID |

Do not retry blindly after a disconnected request or ambiguous response: the result may have been saved and triggered automation. Automatic write retries are disabled.

See [limits](/docs/optimization) for common errors and rate limits. To send a form link to a customer, see [Send a CRM form to a customer](/docs/openlines/send-form).
