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

Comment fields

GET /v1/tasks/:taskId/comments/fields

Returns the task comment field schema: for each of the six fields — its type, a read-only flag, a label, and a description. Useful for code generation and AI-agent hints.

Parameters

Parameter Type Required Description
taskId (path) number yes Task ID. The value is not validated — the schema is the same for any value, including a nonexistent task

Examples

curl — personal key

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

curl — OAuth application

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

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/comments/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; each value is { type, readonly, label, description }.

The label and description field captions are returned in English. Request headers do not switch the language.

Field Type RO Description
id number yes Comment identifier. May come back as null in the create response on the new card
taskId number yes Parent task identifier. Taken from the URL path
authorId number yes Comment author. Employee list: GET /v1/users
message string Comment text, up to 65,535 characters. The only writable field, required on create. Supports BB-code
createdAt datetime yes Creation date and time, UTC ISO 8601
attachments array yes Files attached to the comment. The key is always present; with no files it is an empty list. Each element: fileId (number), name and size (whenever Bitrix24 reported them), downloadUrl (root-relative path to the bytes)

The RO fields (readonly: true) are set by the platform and are not accepted on create or update. Only message is writable.

Response example

JSON
{
  "success": true,
  "data": {
    "fields": {
      "id": { "type": "number", "readonly": true, "label": "ID", "description": "Comment identifier.", "nullable": true },
      "taskId": { "type": "number", "readonly": true, "label": "Task ID", "description": "Identifier of the parent task (from the URL path)." },
      "authorId": { "type": "number", "readonly": true, "label": "Author ID", "description": "Id of the user who posted the comment — an id from GET /v1/users." },
      "message": { "type": "string", "readonly": false, "label": "Message", "description": "Comment text. Required on create." },
      "createdAt": { "type": "datetime", "readonly": true, "label": "Created at", "description": "Creation date, UTC ISO 8601." },
      "attachments": { "type": "array", "readonly": true, "label": "Attachments", "description": "Files attached to the comment. Always present; an empty array when there are none. Each element: fileId (number), name (string, when Bitrix24 provides it), size (number of bytes, when Bitrix24 provides it), downloadUrl (string, root-relative — join it with your account API base URL)." }
    }
  }
}

Error response example

403 — the key lacks the task scope:

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

Errors

HTTP Code Description
403 SCOPE_DENIED The API key does not have the task scope
401 MISSING_API_KEY The X-Api-Key header was not provided

Full list of common API errors — Errors.

See also