For AI agents: markdown of this page — /docs-content-en/sign-b2e/send-template.md documentation index — /llms.txt

Send a document from a template

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.

POST /v1/sign-b2e/templates/send

Creates a document from an available template and sends it to an employee. Requires permission to add, read and edit documents, and access to the template. Sending has legal consequences.

Scopes: sign.b2e, crm.

Request body fields

Parameter Type Required Description
ParametertemplateUid Typestring Requiredyes DescriptionTemplate ID from the list of templates.
ParametersignerUserId Typeinteger | string Requiredyes DescriptionID of an active employee or candidate from the list of users.
ParameterresponsibleUserId Typeinteger | string | null Requiredno DescriptionID of an active responsible person from the list of users. Defaults to the key owner; null is allowed.
ParameterexternalSettings Typeobject | null Requiredno DescriptionExternal system settings; null is allowed when sending from a template.
ParameterexternalSettings.externalId Typestring Requiredno DescriptionDocument ID in the external system, up to 255 characters.
ParameterexternalSettings.externalDateCreate Typestring Requiredno DescriptionCreation date in the external system in ISO 8601 format. Sending from a template requires ATOM format with a numeric time zone offset.

Examples

curl — personal key

Terminal
curl -X POST 'https://vibecode.bitrix24.com/v1/sign-b2e/templates/send' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"templateUid": "DUMMY_TEMPLATE_UID", "signerUserId": 7}'

curl — OAuth application

Terminal
curl -X POST 'https://vibecode.bitrix24.com/v1/sign-b2e/templates/send' \
  -H 'X-Api-Key: YOUR_APP_KEY' \
  -H 'Authorization: Bearer USER_SESSION_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"templateUid": "DUMMY_TEMPLATE_UID", "signerUserId": 7}'

JavaScript — personal key

javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/sign-b2e/templates/send', {
  "method": "POST",
  "headers": {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({"templateUid": "DUMMY_TEMPLATE_UID", "signerUserId": 7})
});
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/templates/send', {
  "method": "POST",
  "headers": {
    "X-Api-Key": "YOUR_APP_KEY",
    "Authorization": "Bearer USER_SESSION_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({"templateUid": "DUMMY_TEMPLATE_UID", "signerUserId": 7})
});
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
Fieldsuccess Typeboolean DescriptionWhether the request succeeded.
Fielddata Typeobject DescriptionOperation data.
Fielddata.uid Typestring DescriptionDocument UID.
Fielddata.state Typeobject DescriptionObject state.
Fielddata.state.code Typestring DescriptionMachine-readable code.
Fielddata.state.name Typestring DescriptionLocalized signing state name.
Fielddata.members Typearray DescriptionDocument members.
Fielddata.members[].uid Typestring DescriptionSigning member UID.
Fielddata.members[].role Typestring DescriptionMember role.
Fielddata.members[].state Typeobject DescriptionObject state.
Fielddata.members[].state.code Typestring DescriptionMachine-readable code.
Fielddata.members[].state.name Typestring DescriptionLocalized signing state name.
Fielddata.members[].user Typeobject DescriptionThe member's user.
Fielddata.members[].party Typeinteger DescriptionThe member's signing party number.
Fielddata.members[].user.employeeCode Typestring | null DescriptionHCM Link employee code; null for a regular user.
Fielddata.members[].user.employeeId Typeinteger | null DescriptionNumeric HCM Link employee ID; null for a regular user.
Fielddata.members[].user.userId Typeinteger | null DescriptionUser ID.
Fieldmeta.redacted Typearray DescriptionPresent 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": {
    "uid": "DUMMY_DOCUMENT_UID",
    "state": {
      "code": "ready",
      "name": "Ready"
    },
    "members": []
  }
}

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
HTTP400 CodeINVALID_PARAMS ReasonInvalid request shape: types, required fields or an unknown query string parameter.
HTTP401 CodeTOKEN_MISSING ReasonNo credentials for the Bitrix24 connection.
HTTP403 CodeSCOPE_DENIED ReasonOne of the required scopes is not granted.
HTTP422 CodeBITRIX_ERROR ReasonBitrix24 rejected the operation; the code is in error.b24Code, the text in error.message.
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY ReasonThe key is read-only.
HTTP422 CodeMETHOD_NOT_YET_AVAILABLE ReasonThe method is not yet available on the Bitrix24 account; the release is in error.release.

Common API 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.

The operation is not retried automatically. If the outcome is unknown, check the state in the Bitrix24 account first; resending can create another document.

The Idempotency-Key header is passed to Bitrix24 without generating a new value. It does not enable automatic retries. externalSettings.externalDateCreate requires strict ATOM format with a numeric time zone offset.

See also