Certificates
Aggregate Certificates
Aggregate certificates with GROUP BY operations.
Allows grouping by status, type, and other fields with aggregation functions like COUNT, SUM, AVG, MIN, MAX. Uses the same base filters and company scoping as the search endpoint for consistent behavior.
post/v1/certificate/aggregate
Request
- Base URLhttps://developer.beta.salussafety.io
- URLhttps://developer.beta.salussafety.io/v1/certificate/aggregate
- Auth
- HTTP bearer
- or OAuth 2Client credentialsToken URL: https://guardian.beta.salussafety.io/token
- or OAuth 2Authorization code: https://guardian.beta.salussafety.io/authorizeToken URL: https://guardian.beta.salussafety.io/token
Request body
Example request
{
"aggregations": [
{
"alias": "total_certs",
"column": "id",
"operator": "count"
},
{
"alias": "unique_holders",
"column": "user_id",
"operator": "count_distinct"
}
],
"archived": false,
"date_filter_column": "updated_at",
"group_by": [
"company_certification_type_id",
"offline"
],
"limit": 100,
"project_is_archived": false,
"query": "safety",
"skip": 0,
"sort_column": "company_certification_type_id",
"sort_direction": "desc"
}Response
Successful Response
Example response
{
"data": {
"data": [
{
"company_certification_type_id": 1,
"offline": false,
"total_certs": 45,
"unique_holders": 38
},
{
"company_certification_type_id": 1,
"offline": true,
"total_certs": 12,
"unique_holders": 10
},
{
"company_certification_type_id": 2,
"offline": false,
"total_certs": 28,
"unique_holders": 28
}
],
"metadata": {
"aggregations": [
{
"alias": "total_certs",
"column": "id",
"operator": "count"
},
{
"alias": "unique_holders",
"column": "user_id",
"operator": "count_distinct"
}
],
"group_by_columns": [
"company_certification_type_id",
"offline"
]
},
"total_groups": 3
}
}Changes
No recorded changes to this operation across all 2 revisions of this API.