For AI agents: markdown of this page — /docs-content-en/entities/crm-forms/publishing.md documentation index — /llms.txt

Publishing and results

Get the code that embeds a form on a website, configure click-triggered and automatic display, find out which website widgets and Open Channels the form is linked to, and submit visitor data to the form.

Bitrix24 API: crm.form.embedding.*, crm.form.sitebutton.list, crm.form.openline.list, crm.webform.result.add Scope: crm

Visitor data submission uses REST v2. Embedding and association lists use REST v3.

Get form embedding codes

GET /v1/crm-forms/:id/embedding

Get the form embed code or a public link to place on a website. Query parameters change the requested variant without saving settings.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionPositive form ID from List forms
Parametervariant (query) Typestring Requiredno Descriptioninline, click, auto, link. Omit to get all embedding settings
ParameterbuttonText (query) Typestring Requiredno DescriptionButton caption override, validated by Bitrix24
ParameterbuttonType (query) Typestring Requiredno DescriptionButton type override, such as button or link. Bitrix24 validates the value
Parameterdelay (query) Typeinteger Requiredno DescriptionDelay override in seconds. Bitrix24 validates the value and its combination with variant

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-forms/59/embedding?variant=link" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-forms/59/embedding?variant=link" \
  -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/crm-forms/59/embedding?variant=link', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-forms/59/embedding?variant=link', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata Typeobject DescriptionEmbedding object as returned by Bitrix24. Without variant, includes available variants and settings. With variant=link, contains {variant, url}
Fielddata.formActive Typeboolean DescriptionWhether the form is active
Fielddata.resourcesReady Typeboolean DescriptionWhether form resources are ready
Fielddata.publicUrl Typestring DescriptionPublic form URL, including its public signature
Fielddata.inline Typeobject DescriptionForm embedded in the page
Fielddata.click Typeobject DescriptionForm opened on click
Fielddata.auto Typeobject DescriptionForm opened after a delay
Fielddata.<variant>.code Typestring / null DescriptionHTML embed code, or null when resources are not ready
Fielddata.<variant>.previewUrl Typestring DescriptionPreview URL when supplied. Missing fields and null values are preserved
Fielddata.<variant>.settings Typeobject / null DescriptionCurrent settings. See Update embedding settings. Values are passed through, including null
Fielddata.<variant>.options Typeobject / null DescriptionAllowed setting values returned by Bitrix24, including null
Fielddata.<variant>.options.type Typestring[] Descriptionpopup, panel
Fielddata.<variant>.options.position Typestring[] Descriptionleft, center, right
Fielddata.<variant>.options.vertical Typestring[] Descriptionbottom, top
Fielddata.click.options.button.font Typestring[] Descriptionmodern, classic, elegant
Fielddata.click.options.button.align Typestring[] Descriptioninline, left, center, right
Fielddata.auto.options.delay Typenumber[] Description3, 5, 7, 10, 15, 20, 25, 30, 40, 60, 120
Fielddata.variant Typestring DescriptionSelected variant, only when variant is set
Fielddata.code Typestring / null DescriptionEmbed code for the selected HTML variant, including null when supplied
Fielddata.url Typestring DescriptionPublic URL when variant=link
Fieldmeta.redacted Typestring[] DescriptionPaths with connection credentials replaced. Such a response is not a complete configuration for saving back

Response example

Response for variant=link. The public domain and signature are placeholders.

JSON
{
  "success": true,
  "data": {
    "variant": "link",
    "url": "https://example.bitrix24.com/crm_form_tz6sk/?telemetry_sign=DUMMY_PUBLIC_SIGNATURE"
  }
}

Error response example

400 — the form ID is not a positive integer:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "id must be a positive safe integer"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionInvalid form ID or request structure
HTTP400 CodeINVALID_PARAMS DescriptionUnknown query parameter or invalid request structure
HTTP400 CodeINVALID_PARAMS DescriptionBitrix24 rejected a parameter or parameter combination. The original code is in error.b24Code, with field diagnostics in error.validation when supplied
HTTP409 CodeCRM_FORM_REST_NOT_ENABLED DescriptionCRM form REST methods are disabled on the Bitrix24 account. The original code for the missing method is in error.b24Code
HTTP403 CodeBITRIX_INSUFFICIENT_SCOPE DescriptionThe Bitrix24 token lacks the required scope. The original code is in error.b24Code
HTTP404 CodeENTITY_NOT_FOUND DescriptionForm not found
HTTP403 CodeSCOPE_DENIED DescriptionAPI key lacks the crm scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe user lacks access permissions
HTTP401 CodeTOKEN_MISSING DescriptionAPI key has no configured credentials
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionInvalid embedding response

Errors from Bitrix24 include the original error.b24Code and field diagnostics in error.validation, when supplied. For common API errors, see Errors.

Known specifics

When resources are not ready, the response remains successful with resourcesReady: false and any code: null supplied by Bitrix24. Missing fields are not filled in. Public signatures are preserved. Only credentials used for the current connection are replaced, with paths listed in meta.redacted.

See also