Get CRM Form Placement Options crm.form.embedding.get
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
Scope:
crmWho can execute the method: a user with permission to view CRM forms
The method belongs to REST 3.0. The call specifics and response format of the new API version are described in the REST 3.0 overview.
The method crm.form.embedding.get returns the code for placing a CRM form on a website and the public link to the form.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
id* |
CRM form identifier. The identifier can be obtained using the crm.form.list method |
|
variant |
The placement option to return. If the parameter is not passed, the method returns all options. Possible values:
|
|
buttonText |
Text of the button or link that opens the form. The value is inserted only into the returned code and is not saved in the form. Use it if |
|
buttonType |
Type of the element that opens the form. The value is inserted only into the returned code and is not saved in the form. Possible values:
Default: Use it if |
|
delay |
Auto-display delay of the form in seconds. The value is inserted only into the returned code and is not saved in the form. Allowed values are listed in Use it if |
Code Examples
How to Use Examples in Documentation
The new API call differs by adding the /api/ segment to the request URL:
https://{installation_address}/rest/api/{user_id}/{webhook_token}/crm.form.embedding.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":45}' \
https://**put_your_bitrix24_address**/rest/api/**put_your_user_id_here**/**put_your_webhook_here**/crm.form.embedding.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":45,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/api/crm.form.embedding.get
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
type EmbeddingVariant = {
code: string | null
previewUrl: string
settings: Record<string, unknown> | null
options: Record<string, unknown> | null
}
type FormEmbeddingGetResult = {
item: {
formActive: boolean
resourcesReady: boolean
publicUrl: string
inline: EmbeddingVariant
click: EmbeddingVariant
auto: EmbeddingVariant
}
}
try {
const response = await $b24.actions.v3.call.make<FormEmbeddingGetResult>({
method: 'crm.form.embedding.get',
params: {
id: 45,
},
requestId: Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info(result.item.publicUrl, result.item.inline.code)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function getFormEmbedding() {
try {
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v3.call.make({
method: 'crm.form.embedding.get',
params: {
id: 45,
},
requestId: B24Js.Text.getUuidRfc4122()
})
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info(result.item.publicUrl, result.item.inline.code)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getFormEmbedding)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.crm.form.embedding.get(
id=45,
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
SDKs do not yet support the /rest/api/ address in calls. Use direct HTTP requests, for example, via curl or fetch.
try {
$response = $b24Service
->core
->call(
'crm.form.embedding.get',
[
'id' => 45,
]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
error_log($result->error());
} else {
echo 'Success: ' . print_r($result->data(), true);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
SDKs do not yet support the /rest/api/ address in calls. Use direct HTTP requests, for example, via curl or fetch.
BX24.callMethod(
'crm.form.embedding.get',
{
id: 45,
},
result => {
if (result.error())
console.error(result.error());
else
console.dir(result.data());
}
);
SDKs do not yet support the /rest/api/ address in calls. Use direct HTTP requests, for example, via curl or fetch.
require_once('crest.php');
$result = CRest::call(
'crm.form.embedding.get',
[
'id' => 45,
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
res, err := client.Core().Call(ctx, "crm.form.embedding.get", b24.Params{
"id": 45,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("crm.form.embedding.get: %w", err)
}
raw, ok := b24.Unwrap(res.Result, "item")
if !ok {
return fmt.Errorf("no item key in the response")
}
var item struct {
FormActive bool `json:"formActive"`
ResourcesReady bool `json:"resourcesReady"`
PublicURL string `json:"publicUrl"`
Inline struct {
Code *string `json:"code"`
PreviewURL string `json:"previewUrl"`
} `json:"inline"`
}
if err := json.Unmarshal(raw, &item); err != nil {
return fmt.Errorf("parsing the response: %w", err)
}
fmt.Println(item.PublicURL)
Response Handling
HTTP status: 200
Response without the variant parameter:
{
"result": {
"item": {
"formActive": true,
"resourcesReady": true,
"publicUrl": "https://example.bitrix24site.com/crm_form_nscnl/?telemetry_sign=v1%3A45%3Adirect_link.0960d174ab4aa87739668fbe63deae0a790b4f7254670a3b36d646588fa04242",
"inline": {
"code": "<script data-b24-form=\"inline/45/6el0zj\" data-b24-form-telemetry-sign=\"v1:45:site.d77c41d60d0649b2310bbe359cfd319772d16a2387b2e14f10c9e830ae76eb39\" data-skip-moving=\"true\">\n\t(function(w,d,u){\n\t\tvar s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/180000|0);\n\t\tvar h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);\n\t})(window,document,'https://cdn-com.bitrix24.com/b1234567/crm/form/loader_45.js');\n</script>",
"previewUrl": "https://test.bitrix24.com/pub/form/45/6el0zj/?view=preview&preview=inline",
"settings": null,
"options": null
},
"click": {
"code": "<script data-b24-form=\"click/45/6el0zj\" data-b24-form-telemetry-sign=\"v1:45:site.d77c41d60d0649b2310bbe359cfd319772d16a2387b2e14f10c9e830ae76eb39\" data-skip-moving=\"true\">\n\t(function(w,d,u){\n\t\tvar s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/180000|0);\n\t\tvar h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);\n\t})(window,document,'https://cdn-com.bitrix24.com/b1234567/crm/form/loader_45.js');\n</script>",
"previewUrl": "https://test.bitrix24.com/pub/form/45/6el0zj/?view=preview&preview=click",
"settings": {
"type": "panel",
"position": "right",
"vertical": "bottom",
"button": {
"use": false,
"text": null,
"font": null,
"align": null,
"plain": false,
"rounded": false,
"outlined": false,
"decoration": null,
"color": {
"text": null,
"textHover": null,
"background": null,
"backgroundHover": null
}
}
},
"options": {
"type": ["popup", "panel"],
"position": ["left", "center", "right"],
"vertical": ["bottom", "top"],
"button": {
"font": ["modern", "classic", "elegant"],
"align": ["inline", "left", "center", "right"]
}
}
},
"auto": {
"code": "<script data-b24-form=\"auto/45/6el0zj\" data-b24-form-telemetry-sign=\"v1:45:site.d77c41d60d0649b2310bbe359cfd319772d16a2387b2e14f10c9e830ae76eb39\" data-skip-moving=\"true\">\n\t(function(w,d,u){\n\t\tvar s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/180000|0);\n\t\tvar h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);\n\t})(window,document,'https://cdn-com.bitrix24.com/b1234567/crm/form/loader_45.js');\n</script>",
"previewUrl": "https://test.bitrix24.com/pub/form/45/6el0zj/?view=preview&preview=auto",
"settings": {
"type": "popup",
"position": "center",
"vertical": "bottom",
"delay": 5
},
"options": {
"type": ["popup", "panel"],
"position": ["left", "center", "right"],
"vertical": ["bottom", "top"],
"delay": [3, 5, 7, 10, 15, 20, 25, 30, 40, 60, 120]
}
}
}
},
"time": {
"start": 1792593809,
"finish": 1792593809.843669,
"duration": 0.8436689376831055,
"processing": 0,
"date_start": "2026-10-21T17:43:29+02:00",
"date_finish": "2026-10-21T17:43:29+02:00",
"operating_reset_at": 1792594380,
"operating": 0
}
}
Response with the "variant":"auto" and "delay":10 parameters:
{
"result": {
"item": {
"variant": "auto",
"code": "<script id=\"bx24_form_delay\" data-skip-moving=\"true\">\n\t(function(w,d,u,b){w['Bitrix24FormObject']=b;w[b] = w[b] || function(){arguments[0].ref=u;\n\t\t(w[b].forms=w[b].forms||[]).push(arguments[0])};\n\t\tif(w[b]['forms']) return;\n\t\tvar s=d.createElement('script');s.async=1;s.src=u+'?'+(1*new Date());\n\t\tvar h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);\n\t})(window,document,'https://test.bitrix24.com/bitrix/js/crm/form_loader.js','b24form');\n\n\tb24form({\"id\":45,\"lang\":\"en\",\"sec\":\"6el0zj\",\"type\":\"delay\",\"delay\":10});\n</script>"
}
},
"time": {
"start": 1792594117,
"finish": 1792594117.571196,
"duration": 0.5711960792541504,
"processing": 0,
"date_start": "2026-10-21T17:48:37+02:00",
"date_finish": "2026-10-21T17:48:37+02:00",
"operating_reset_at": 1792594680,
"operating": 0.4092140197753906
}
}
Response with the "variant":"link" parameter:
{
"result": {
"item": {
"variant": "link",
"url": "https://example.bitrix24site.com/crm_form_nscnl/?telemetry_sign=v1%3A45%3Adirect_link.0960d174ab4aa87739668fbe63deae0a790b4f7254670a3b36d646588fa04242"
}
},
"time": {
"start": 1792594113,
"finish": 1792594113.75192,
"duration": 0.7519199848175049,
"processing": 0,
"date_start": "2026-10-21T17:48:33+02:00",
"date_finish": "2026-10-21T17:48:33+02:00",
"operating_reset_at": 1792594680,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Object with the response data |
|
item |
Form placement options. The content depends on the
|
|
time |
Information about the request execution time |
Item Object Without the variant Parameter
|
Name |
Description |
|
formActive |
Whether the form is active. Possible values:
|
|
resourcesReady |
Whether the form files are built for publication. Possible values:
|
|
publicUrl |
Public link to the form |
|
inline |
Option for embedding the form in a website page. This option has no settings, so |
|
click |
Option for showing the form when a button or link is clicked, detailed description |
|
auto |
Option for showing the form automatically after a set delay, detailed description |
Inline, Click, Auto Objects
|
Name |
Description |
|
code |
HTML code to insert on a website. It is |
|
previewUrl |
Link to the form preview in this placement option |
|
settings |
Current display settings. Present only for the |
|
options |
Allowed values of the display settings. Present only for the |
Settings Object
If a setting value is not saved in the form, null is returned. In this case, the default value is applied on the website.
|
Name |
Description |
|
type |
Form window type. Possible values:
|
|
position |
Horizontal position of the window. Possible values:
|
|
vertical |
Vertical position of the window. Possible values:
|
|
delay |
Auto-display delay in seconds. Present only for the |
|
button |
Settings of the button that opens the form. Present only for the |
Button Object
|
Name |
Description |
|
use |
Whether to show the Bitrix24 button on the website. Possible values:
|
|
text |
Button text |
|
font |
Button font. Allowed values are listed in |
|
align |
Button alignment. Allowed values are listed in |
|
plain |
Indicates a button without a background. Possible values:
|
|
rounded |
Indicates rounded corners. Possible values:
|
|
outlined |
Indicates a button outline. Possible values:
|
|
decoration |
Button text underline. The interface offers the values |
|
color |
Button colors in HEX format, for example
|
Options Object
|
Name |
Description |
|
type |
Allowed values of |
|
position |
Allowed values of |
|
vertical |
Allowed values of |
|
delay |
Allowed values of |
|
button |
Allowed values of the button settings: |
Item Object with the variant Parameter
|
Name |
Description |
|
variant |
Selected placement option: |
|
code |
HTML code to insert on a website. Returned for the |
|
url |
Public link to the form. Returned for the |
Error Handling
HTTP status: 400
{
"error": {
"code": "BITRIX_REST_V3_EXCEPTION_VALIDATION_REQUESTVALIDATIONEXCEPTION",
"message": "Error validating request object.",
"validation": [
{
"message": "delay is available only for the auto embedding variant.",
"field": "delay"
}
]
}
}
|
Name |
Description |
|
error.code |
String error code. Use it to identify the type of exception |
|
error.message |
Text description of the error |
|
error.validation |
Array with error details. Present only in data validation errors |
|
error.validation[].field |
Name of the field where the validation error occurred |
|
error.validation[].message |
Description of the error related to the specified field |
Possible Error Codes
Request Validation Errors
HTTP status: 400
Error Code: BITRIX_REST_V3_EXCEPTION_VALIDATION_REQUESTVALIDATIONEXCEPTION
|
Field |
Error description |
How to Fix |
|
|
Required field |
Pass the form |
|
|
Field value is not one of the possible values: inline, click, auto, link |
Pass one of the values |
|
|
Field value is not one of the possible values: button, link |
Pass |
|
|
buttonText is available only for the click embedding variant. |
Pass |
|
|
buttonType is available only for the click embedding variant. |
Pass |
|
|
delay is available only for the auto embedding variant. |
Pass |
|
|
Embedding delay |
Pass a value from |
Form Not Found Error
HTTP status: 404
Error Code: BITRIX_REST_V3_EXCEPTION_ENTITYNOTFOUNDEXCEPTION
|
Field |
Error description |
How to Fix |
|
|
Entity with ID |
Check the form identifier with the crm.form.list method |
Access Errors
HTTP status: 403
Error Code: BITRIX_REST_V3_EXCEPTION_ACCESSDENIEDEXCEPTION
|
Field |
Error description |
How to Fix |
|
|
Access denied |
Check that the user has permission to view CRM forms |
Error Code: BITRIX_CRM_V2_INFRASTRUCTURE_REST_EXCEPTION_FORM_PHONEVERIFICATIONREQUIREDEXCEPTION
|
Field |
Error description |
How to Fix |
|
|
Confirm your phone number to add CRM forms |
Verify the phone number in Bitrix24 and repeat the request |
Statuses and System Error Codes
HTTP Status: 4xx, 5xx
The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit |
|
|
|
The request contains no authorization data: neither an access token nor a webhook code was passed |
|
|
|
Methods are called over the HTTPS protocol only |
|
|
|
The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support |
|
|
|
REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — |
|
|
|
No active webhook with the specified user identifier and secret code was found |
|
|
|
No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope |
|
|
|
The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with |
|
|
|
The access token has expired |
|
|
|
The application is installed, but the Bitrix24 administrator has granted access to it only to specific users |
|
|
|
The public part of the site is closed. To open it on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |