Count comments per entity
GET
/v1/comments/counts
const url = 'https://api.varman.io/v1/comments/counts?entityType=task';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.varman.io/v1/comments/counts?entityType=task' \ --header 'X-API-Key: <X-API-Key>'Returns how many comments each policy, task, vendor, risk or finding of one type has, keyed by entity ID. Use it to show comment counts on a list without loading every thread.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”entityType
required
string
Example
policyType of entity to count comments for
Responses
Section titled “Responses”Media typeapplication/json
object
counts
required
Comment count keyed by entity ID. Entities without comments are omitted.
object
key
additional properties
number
Example
{ "counts": { "pol_abc123": 3, "pol_def456": 1 }}