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

Document fields

GET /v1/documents/fields

Returns the full document field schema: field name, type, read-only flag, and whether it is required on creation. Fields marked ★ are required in the request body when creating a document.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/documents/fields" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/documents/fields" \
  -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/documents/fields', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Total fields:', Object.keys(data.fields).length)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/documents/fields', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

Response fields

data.fields is an object keyed by field name, where each value contains type (the field type), readonly (true — the field cannot be passed on create or update), required (true — the field is required on create, other fields have no such key), nullable (true — the field can be returned with a null value), label (the display name), and description (a short description). The label/description values are returned in English. Request headers do not switch the language. data.batch is the array of document operations available in a batch request.

Field Bitrix24 Type RO Description
Fieldid Bitrix24id Typenumber ROyes DescriptionDocument identifier
Fieldtitle Bitrix24title Typestring RO DescriptionDocument title
Fieldnumber Bitrix24number Typestring RO DescriptionDocument number
FieldtemplateId Bitrix24templateId Typenumber RO Description★ Template identifier. List: GET /v1/doc-templates
FieldproviderClassName Bitrix24providerClassName Typestring RO Description★ Data provider class, for example Bitrix\DocumentGenerator\DataProvider\Rest
Fieldvalue Bitrix24value Typestring RO Description★ External identifier of the source object that data is pulled from
Fieldvalues Bitrix24values Typeobject RO DescriptionValues for the template placeholders
Fieldfields Bitrix24fields Typeobject RO DescriptionField formatting description
FieldcreateTime Bitrix24createTime Typedatetime ROyes DescriptionCreation date
FieldupdateTime Bitrix24updateTime Typedatetime ROyes DescriptionLast modified date
FieldfileId Bitrix24fileId Typenumber RO DescriptionDOCX file identifier
FieldpdfId Bitrix24pdfId Typenumber RO DescriptionPDF file identifier
FieldimageId Bitrix24imageId Typenumber RO DescriptionImage file identifier
FieldstampsEnabled Bitrix24stampsEnabled Typeboolean RO DescriptionWhether stamps and signatures are enabled
Fieldprovider Bitrix24provider Typestring ROyes DescriptionDocument data provider class
FielddownloadUrl Bitrix24downloadUrl Typestring ROyes DescriptionDOCX download link for the user
FieldpdfUrl Bitrix24pdfUrl Typestring ROyes DescriptionPDF download link for the user
FieldimageUrl Bitrix24imageUrl Typestring ROyes DescriptionImage link for the user
FielddownloadUrlMachine Bitrix24downloadUrlMachine Typestring ROyes DescriptionDOCX download URL through Vibecode: /v1/documents/:id/download. Requires X-Api-Key with the documentgenerator scope
FieldpdfUrlMachine Bitrix24pdfUrlMachine Typestring ROyes DescriptionPDF download URL through Vibecode: /v1/documents/:id/pdf. Requires X-Api-Key with the documentgenerator scope. Absent while the PDF is being generated
FieldimageUrlMachine Bitrix24imageUrlMachine Typestring ROyes DescriptionImage download URL through Vibecode: /v1/documents/:id/image. Requires X-Api-Key with the documentgenerator scope. Absent while the image is being generated
FieldcreatedBy Bitrix24createdBy Typenumber ROyes DescriptionIdentifier of the user who created the document. List: GET /v1/users
FieldupdatedBy Bitrix24updatedBy Typenumber | null ROyes DescriptionIdentifier of the user who last modified the document. null if the document has not been modified. List: GET /v1/users
FieldpublicUrl Bitrix24publicUrl Typestring | null ROyes DescriptionPublic link to the document. null if the public link has not been generated
FieldisTransformationError Bitrix24isTransformationError Typeboolean | null ROyes DescriptionWhether the document's PDF conversion failed
FieldtransformationErrorCode Bitrix24transformationErrorCode Typestring | null ROyes DescriptionError code for the PDF conversion. An empty string is returned as null
FieldtransformationErrorMessage Bitrix24transformationErrorMessage Typestring | null ROyes DescriptionError message for the PDF conversion. An empty string is returned as null
FieldtransformationCancelReason Bitrix24transformationCancelReason Typestring | null ROyes DescriptionReason the PDF conversion was canceled. An empty string is returned as null
FieldpullTag Bitrix24pullTag Typestring | null ROyes DescriptionSubscription tag for conversion-status updates

★ — the templateId, providerClassName and value fields are required in the request body when creating a document.

Response example

9 of 29 fields shown. The full list is in the table above.

JSON
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true, "label": "ID", "description": "Unique numeric identifier of the generated document." },
      "title": { "type": "string", "readonly": false, "label": "Title", "description": "Document title." },
      "number": { "type": "string", "readonly": false, "label": "Number", "description": "Document number as shown in the printed form." },
      "templateId": { "type": "number", "readonly": false, "required": true, "label": "Template", "description": "ID of the template the document is generated from. List: GET /v1/doc-templates." },
      "providerClassName": { "type": "string", "readonly": false, "required": true, "label": "Data provider", "description": "Class name of the data provider that supplies the values for the template." },
      "value": { "type": "string", "readonly": false, "required": true, "label": "Owner identifier", "description": "Identifier of the entity the data provider builds the document for (e.g. a deal ID)." },
      "createTime": { "type": "datetime", "readonly": true, "label": "Created at", "description": "Date and time the document was created." },
      "publicUrl": { "type": "string", "readonly": true, "label": "Public URL", "description": "Public URL for sharing the document." },
      "transformationErrorCode": { "type": "string", "readonly": true, "nullable": true, "label": "PDF conversion error code", "description": "Error code for the document's PDF conversion." }
    },
    "batch": ["create", "update", "delete"]
  }
}

Error response example

403 — the key does not have the required scope:

JSON
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'documentgenerator' scope"
  }
}

Errors

HTTP Code Description
HTTP403 CodeSCOPE_DENIED DescriptionThe API key is missing the documentgenerator scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not provided
HTTP429 CodeRATE_LIMITED DescriptionRate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the x-ratelimit-limit header. Retry after the delay in the Retry-After header

For the full list of common API errors, see Errors.

See also