> For the complete documentation index, see [llms.txt](https://api-docs.myhappyforce.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.myhappyforce.com/docs/api-reference/stats.md).

# Stats

Stats related operations

## GET /api/v1/public/company/stats/scores/{scoreId}

> Retrieves the Stats of a score for a given iteractions

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"happyforceAPIKey":[]}],"components":{"securitySchemes":{"happyforceAPIKey":{"type":"apiKey","description":"API Key for Happyforce API","name":"happyforceAPIKey","in":"header"}},"schemas":{"ScoreStats":{"type":"object","description":"Contains a Score stats during a period for a given period. It contains on the root of the object the last result, and on the dateResults field, the results for a given period","properties":{"scoreId":{"type":"string","description":"Id of the score"},"from":{"type":"string","format":"date-time","description":"Date from where the stats of this results start"},"to":{"type":"string","format":"date-time","description":"Date from where the stats of this results ends"},"result":{"type":"number","format":"double","description":"Result for the given score"},"std":{"type":"number","format":"double","description":"Standard deviation of score results"},"variance":{"type":"number","format":"double","description":"Variance of score results"},"p10":{"type":"number","format":"double","description":"10th percentile of score results"},"p25":{"type":"number","format":"double","description":"25th percentile of score results"},"p50":{"type":"number","format":"double","description":"50th percentile of score results"},"p75":{"type":"number","format":"double","description":"75th percentile of score results"},"p90":{"type":"number","format":"double","description":"90th percentile of score results"},"iqr":{"type":"number","format":"double","description":"Interquartile range of score results"},"cv":{"type":"number","format":"double","description":"Coefficient of variation of score results"},"outliersLow":{"type":"integer","format":"int32","description":"Number of low-end outliers in score results"},"outliersHigh":{"type":"integer","format":"int32","description":"Number of high-end outliers in score results"},"multimodal":{"type":"boolean","description":"Whether distribution appears multimodal"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"expectedParticipants":{"type":"integer","format":"int32","description":"The expected participants"},"dateResults":{"type":"array","description":"Results by date for the given score. (for each iteration requested)","items":{"$ref":"#/components/schemas/ScoreStatsDateResult"}},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"factors":{"type":"array","description":"Individual results for each factor composing the score","items":{"$ref":"#/components/schemas/ScoreFactorStats"}},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the score"}}},"ScoreStatsDateResult":{"type":"object","description":"Self contained model that contains the results for a given score","properties":{"date":{"type":"string","format":"date-time","description":"Date of beginning of the measurement on this result. Usually the period is one month"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"expectedParticipants":{"type":"integer","format":"int32","description":"The expected participants"},"result":{"type":"number","format":"double","description":"Result for the given score on that period"},"std":{"type":"number","format":"double","description":"Standard deviation of score results"},"variance":{"type":"number","format":"double","description":"Variance of score results"},"p10":{"type":"number","format":"double","description":"10th percentile of score results"},"p25":{"type":"number","format":"double","description":"25th percentile of score results"},"p50":{"type":"number","format":"double","description":"50th percentile of score results"},"p75":{"type":"number","format":"double","description":"75th percentile of score results"},"p90":{"type":"number","format":"double","description":"90th percentile of score results"},"iqr":{"type":"number","format":"double","description":"Interquartile range of score results"},"cv":{"type":"number","format":"double","description":"Coefficient of variation of score results"},"outliersLow":{"type":"integer","format":"int32","description":"Number of low-end outliers in score results"},"outliersHigh":{"type":"integer","format":"int32","description":"Number of high-end outliers in score results"},"multimodal":{"type":"boolean","description":"Whether distribution appears multimodal"},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"factors":{"type":"array","description":"Individual results for each factor composing the score","items":{"$ref":"#/components/schemas/ScoreFactorStats"},"uniqueItems":true},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the score"}}},"ScoreFactorStats":{"type":"object","description":"Self contained model that contains the results for a given score factor","properties":{"factorId":{"type":"string","description":"Id of the factor, so it can be matched on the metadata API"},"result":{"type":"number","format":"double","description":"Result for this factor"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the factor"},"questions":{"type":"array","description":"Questions used to compute the factor result","items":{"$ref":"#/components/schemas/ScoreQuestionStats"},"uniqueItems":true}}},"DataQuality":{"type":"string","description":"Quality of data of a specific field or metric","enum":["NO_DATA","LOW","WARNING","NORMAL","GOOD"]},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]},"ScoreQuestionStats":{"type":"object","description":"Self contained model that contains the metadata for a given score question result","properties":{"questionId":{"type":"string","description":"Id of the question, so it can be matched on the metadata API"},"result":{"type":"number","format":"double","description":"Result for the question"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the factor"}}}}},"paths":{"/api/v1/public/company/stats/scores/{scoreId}":{"get":{"tags":["Stats"],"summary":"Retrieves the Stats of a score for a given iteractions","operationId":"getCompanyScoreStats","parameters":[{"name":"scoreId","in":"path","description":"Score from which the stats should be retrieved","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"For which date from the results should be returned","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"For which date to the results should be returned","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"hierarchyId","in":"query","description":"Id of the area for which you want to retrive the stats. If null, all company data is returned","required":false,"schema":{"type":"string"}},{"name":"profile","in":"query","description":"Profile filter string. If not specified, no profile filtering will be applied. Check examples for details","required":false,"schema":{"type":"string"}},{"name":"groupId","in":"query","description":"One or more group ids for which you want to retrieve the stats. If not specified, no group filtering will be applied","required":false,"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ScoreStats"}}}}}}}}}
```

## GET /api/v1/public/company/stats/scores/stats/{scoreId}

> Retrieves the Stats of a score for a given iteractions

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"happyforceAPIKey":[]}],"components":{"securitySchemes":{"happyforceAPIKey":{"type":"apiKey","description":"API Key for Happyforce API","name":"happyforceAPIKey","in":"header"}},"schemas":{"ScoreStats":{"type":"object","description":"Contains a Score stats during a period for a given period. It contains on the root of the object the last result, and on the dateResults field, the results for a given period","properties":{"scoreId":{"type":"string","description":"Id of the score"},"from":{"type":"string","format":"date-time","description":"Date from where the stats of this results start"},"to":{"type":"string","format":"date-time","description":"Date from where the stats of this results ends"},"result":{"type":"number","format":"double","description":"Result for the given score"},"std":{"type":"number","format":"double","description":"Standard deviation of score results"},"variance":{"type":"number","format":"double","description":"Variance of score results"},"p10":{"type":"number","format":"double","description":"10th percentile of score results"},"p25":{"type":"number","format":"double","description":"25th percentile of score results"},"p50":{"type":"number","format":"double","description":"50th percentile of score results"},"p75":{"type":"number","format":"double","description":"75th percentile of score results"},"p90":{"type":"number","format":"double","description":"90th percentile of score results"},"iqr":{"type":"number","format":"double","description":"Interquartile range of score results"},"cv":{"type":"number","format":"double","description":"Coefficient of variation of score results"},"outliersLow":{"type":"integer","format":"int32","description":"Number of low-end outliers in score results"},"outliersHigh":{"type":"integer","format":"int32","description":"Number of high-end outliers in score results"},"multimodal":{"type":"boolean","description":"Whether distribution appears multimodal"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"expectedParticipants":{"type":"integer","format":"int32","description":"The expected participants"},"dateResults":{"type":"array","description":"Results by date for the given score. (for each iteration requested)","items":{"$ref":"#/components/schemas/ScoreStatsDateResult"}},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"factors":{"type":"array","description":"Individual results for each factor composing the score","items":{"$ref":"#/components/schemas/ScoreFactorStats"}},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the score"}}},"ScoreStatsDateResult":{"type":"object","description":"Self contained model that contains the results for a given score","properties":{"date":{"type":"string","format":"date-time","description":"Date of beginning of the measurement on this result. Usually the period is one month"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"expectedParticipants":{"type":"integer","format":"int32","description":"The expected participants"},"result":{"type":"number","format":"double","description":"Result for the given score on that period"},"std":{"type":"number","format":"double","description":"Standard deviation of score results"},"variance":{"type":"number","format":"double","description":"Variance of score results"},"p10":{"type":"number","format":"double","description":"10th percentile of score results"},"p25":{"type":"number","format":"double","description":"25th percentile of score results"},"p50":{"type":"number","format":"double","description":"50th percentile of score results"},"p75":{"type":"number","format":"double","description":"75th percentile of score results"},"p90":{"type":"number","format":"double","description":"90th percentile of score results"},"iqr":{"type":"number","format":"double","description":"Interquartile range of score results"},"cv":{"type":"number","format":"double","description":"Coefficient of variation of score results"},"outliersLow":{"type":"integer","format":"int32","description":"Number of low-end outliers in score results"},"outliersHigh":{"type":"integer","format":"int32","description":"Number of high-end outliers in score results"},"multimodal":{"type":"boolean","description":"Whether distribution appears multimodal"},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"factors":{"type":"array","description":"Individual results for each factor composing the score","items":{"$ref":"#/components/schemas/ScoreFactorStats"},"uniqueItems":true},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the score"}}},"ScoreFactorStats":{"type":"object","description":"Self contained model that contains the results for a given score factor","properties":{"factorId":{"type":"string","description":"Id of the factor, so it can be matched on the metadata API"},"result":{"type":"number","format":"double","description":"Result for this factor"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the factor"},"questions":{"type":"array","description":"Questions used to compute the factor result","items":{"$ref":"#/components/schemas/ScoreQuestionStats"},"uniqueItems":true}}},"DataQuality":{"type":"string","description":"Quality of data of a specific field or metric","enum":["NO_DATA","LOW","WARNING","NORMAL","GOOD"]},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]},"ScoreQuestionStats":{"type":"object","description":"Self contained model that contains the metadata for a given score question result","properties":{"questionId":{"type":"string","description":"Id of the question, so it can be matched on the metadata API"},"result":{"type":"number","format":"double","description":"Result for the question"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"How the votes of each participants are distributed"},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the factor"}}}}},"paths":{"/api/v1/public/company/stats/scores/stats/{scoreId}":{"get":{"tags":["Stats"],"summary":"Retrieves the Stats of a score for a given iteractions","operationId":"getCompanyScoreStats_1","parameters":[{"name":"scoreId","in":"path","description":"Score from which the stats should be retrieved","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"For which date from the results should be returned","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"For which date to the results should be returned","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"hierarchyId","in":"query","description":"Id of the area for which you want to retrive the stats. If null, all company data is returned","required":false,"schema":{"type":"string"}},{"name":"profile","in":"query","description":"Profile filter string. If not specified, no profile filtering will be applied. Check examples for details","required":false,"schema":{"type":"string"}},{"name":"groupId","in":"query","description":"One or more group ids for which you want to retrieve the stats. If not specified, no group filtering will be applied","required":false,"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ScoreStats"}}}}}}}}}
```

## GET /api/v1/public/company/stats/participation

> Retrieves the Participation stats for the requested period

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"happyforceAPIKey":[]}],"components":{"securitySchemes":{"happyforceAPIKey":{"type":"apiKey","description":"API Key for Happyforce API","name":"happyforceAPIKey","in":"header"}},"schemas":{"DateGroupingTypes":{"type":"string","description":"Types of date grouping intervals","enum":["DAY","WEEK","MONTH","QUARTER","NON_NATURAL_QUARTER","YEAR"]},"Participation Stats":{"type":"object","description":"\tContains a the participation stats for a given period.\n","properties":{"from":{"type":"string","format":"date-time","description":"Date from where the stats of this results start"},"to":{"type":"string","format":"date-time","description":"Date to where the stats of this results ends"},"participants":{"type":"integer","format":"int32","description":"Number of unique participants during the period"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the participation stats"},"newParticipants":{"type":"integer","format":"int64","description":"Number of unique participants during the period, that were not present in the previous period"},"lostParticipants":{"type":"integer","format":"int64","description":"Number of unique participants during the previous period, that are not present in the current period"},"dateResults":{"type":"array","description":"Results by date for participants","items":{"$ref":"#/components/schemas/ParticipationDateResultDTO"}}}},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]},"ParticipationDateResultDTO":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"Date of the stats"},"participants":{"type":"integer","format":"int64","description":"Number of participants on this date"}}}}},"paths":{"/api/v1/public/company/stats/participation":{"get":{"tags":["Stats"],"description":"Retrieves the Participation stats for the requested period","operationId":"getCompanyParticipationStats","parameters":[{"name":"from","in":"query","description":"Start date for retrieving stats (ddMMyyyy format). If null: Today minus one month","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"End date for retrieving stats  (ddMMyyyy format). If null: Today","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"hierarchyId","in":"query","description":"Id of the area for which you want to retrive the stats. If null, all company data is returned","required":false,"schema":{"type":"string"}},{"name":"profile","in":"query","description":"Profile filter string. If not specified, no profile filtering will be applied.","required":false,"schema":{"type":"string"}},{"name":"groupId","in":"query","description":"One or more group ids for which you want to retrieve the stats. If not specified, no group filtering will be applied","required":false,"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}},{"name":"grouping","in":"query","description":"The type of grouping for the results. Default is by moth","required":false,"schema":{"$ref":"#/components/schemas/DateGroupingTypes","default":"MONTH"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Participation Stats"}}}}}}}}}
```

## GET /api/v1/public/company/stats/hi

> Retrieves the HI stats for the requested period

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"happyforceAPIKey":[]}],"components":{"securitySchemes":{"happyforceAPIKey":{"type":"apiKey","description":"API Key for Happyforce API","name":"happyforceAPIKey","in":"header"}},"schemas":{"HIStats":{"type":"object","description":"Self contained model that contains the HI stats for a certain period","properties":{"title":{"type":"string","description":"Title of the HI question"},"values":{"type":"array","description":"Allowed values for the HI question","items":{"$ref":"#/components/schemas/QuestionValue"},"uniqueItems":true},"ratings":{"type":"object","additionalProperties":{"type":"integer","format":"int32"},"description":"Votes received per type during this period"},"participants":{"type":"integer","format":"int32","description":"Number of unique participants on the period"},"expectedParticipants":{"type":"integer","format":"int32","description":"Number of expected participants on the period"},"periodIndex":{"type":"number","format":"double","description":"HI of the given period"},"dateResults":{"type":"array","description":"HI by date given period","items":{"$ref":"#/components/schemas/HIStatsDate"}}}},"QuestionValue":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"score":{"type":"integer","format":"int32"},"label":{"$ref":"#/components/schemas/MultiLanguage"},"imageUrl":{"type":"string"},"color":{"type":"string"}},"required":["id","label","score"]},"MultiLanguage":{"type":"object","properties":{"defaultValue":{"type":"string","minLength":1},"langValues":{"type":"object","additionalProperties":{"type":"string"}},"valid":{"type":"boolean"}},"required":["defaultValue"]},"HIStatsDate":{"type":"object","description":"HI stats for a given date","properties":{"date":{"type":"string","format":"date-time"},"index":{"type":"number","format":"double"},"participants":{"type":"integer","format":"int32"}}}}},"paths":{"/api/v1/public/company/stats/hi":{"get":{"tags":["Stats"],"summary":"Retrieves the HI stats for the requested period","operationId":"getCompanyHIStats","parameters":[{"name":"from","in":"query","description":"Start date for retrieving stats (ddMMyyyy format). If null: Today minus one month","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"End date for retrieving stats  (ddMMyyyy format). If null: Today","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"hierarchyId","in":"query","description":"Id of the area for which you want to retrive the stats. If null, all company data is returned","required":false,"schema":{"type":"string"}},{"name":"profile","in":"query","description":"Profile filter string. If not specified, no profile filtering will be applied.","required":false,"schema":{"type":"string"}},{"name":"groupId","in":"query","description":"One or more group ids for which you want to retrieve the stats. If not specified, no group filtering will be applied","required":false,"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/HIStats"}}}}}}}}}
```

## GET /api/v1/public/company/stats/enps

> Retrieves the eNPS stats for the requested period

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"happyforceAPIKey":[]}],"components":{"securitySchemes":{"happyforceAPIKey":{"type":"apiKey","description":"API Key for Happyforce API","name":"happyforceAPIKey","in":"header"}},"schemas":{"ENPSStats":{"type":"object","description":"Contains the ENPS stats during a period for a given. It contains on the root of the object the last result, and on the dateResults field, the results for a given period","properties":{"from":{"type":"string","format":"date-time","description":"Date from where the stats of this results start"},"to":{"type":"string","format":"date-time","description":"Date to where the stats of this results ends"},"result":{"type":"number","format":"double","description":"Result for the eNPS"},"averageResult":{"type":"number","format":"double","description":"Result for the eNPS in average mode"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"expectedParticipants":{"type":"integer","format":"int32","description":"The expected participants"},"dateResults":{"type":"array","description":"Results by date for the given score. (for each iteration requested)","items":{"$ref":"#/components/schemas/ENPSStatsDateResult"}},"dectractors":{"type":"integer","format":"int32","description":"Number of detractors"},"neutral":{"type":"integer","format":"int32","description":"Number of neutral"},"promoters":{"type":"integer","format":"int32","description":"Number of promoters"},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the score"}}},"ENPSStatsDateResult":{"type":"object","description":"Self contained model that contains the metadata for the eNPS","properties":{"date":{"type":"string","format":"date-time","description":"Date of beginning of the measurement on this result. Usually the period is one month"},"participants":{"type":"integer","format":"int32","description":"The unique participants"},"expectedParticipants":{"type":"integer","format":"int32","description":"The expected participants"},"result":{"type":"number","format":"double","description":"Result for the eNPS on that period"},"averageResult":{"type":"number","format":"double","description":"Result for the eNPS in average mode"},"dectractors":{"type":"integer","format":"int32","description":"Number of detractors"},"neutral":{"type":"integer","format":"int32","description":"Number of neutral"},"promoters":{"type":"integer","format":"int32","description":"Number of promoters"},"quality":{"$ref":"#/components/schemas/DataQuality","description":"Quality of the measurement, based on the participation"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the eNPS"}}},"DataQuality":{"type":"string","description":"Quality of data of a specific field or metric","enum":["NO_DATA","LOW","WARNING","NORMAL","GOOD"]},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]}}},"paths":{"/api/v1/public/company/stats/enps":{"get":{"tags":["Stats"],"description":"Retrieves the eNPS stats for the requested period","operationId":"getCompanyENPSStats","parameters":[{"name":"from","in":"query","description":"Start date for retrieving stats (ddMMyyyy format). If null: Today minus one month","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"End date for retrieving stats  (ddMMyyyy format). If null: Today","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"hierarchyId","in":"query","description":"Id of the area for which you want to retrive the stats. If null, all company data is returned","required":false,"schema":{"type":"string"}},{"name":"profile","in":"query","description":"Profile filter string. If not specified, no profile filtering will be applied.","required":false,"schema":{"type":"string"}},{"name":"groupId","in":"query","description":"One or more group ids for which you want to retrieve the stats. If not specified, no group filtering will be applied","required":false,"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ENPSStats"}}}}}}}}}
```

## GET /api/v1/public/company/stats/activation

> Retrieves the Activation stats for the requested period

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"happyforceAPIKey":[]}],"components":{"securitySchemes":{"happyforceAPIKey":{"type":"apiKey","description":"API Key for Happyforce API","name":"happyforceAPIKey","in":"header"}},"schemas":{"Activation Stats":{"type":"object","description":"\tContains a the activations stats for a given period.\n\tIt contains information about the number of invited and activated users and the accumulated values.\n\tby date.\n","properties":{"from":{"type":"string","format":"date-time","description":"Date from where the stats of this results start"},"to":{"type":"string","format":"date-time","description":"Date from where the stats of this results ends"},"totalInvited":{"type":"integer","format":"int64","description":"The number of invited employees during the period"},"totalActivated":{"type":"integer","format":"int64","description":"The number of activated employees during the period"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation of the activation stats"},"dateResults":{"type":"array","description":"Results by date for activations & invitations","items":{"$ref":"#/components/schemas/ActivationStatsDateResultPublicDTO"}}}},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]},"ActivationStatsDateResultPublicDTO":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"Date of the stats"},"invited":{"type":"integer","format":"int64","description":"Number of invited employees on this date"},"invitedAccumulated":{"type":"integer","format":"int64","description":"Accumulated number of invited employees until this date"},"activated":{"type":"integer","format":"int64","description":"Number of activated employees on this date"},"activatedAccumulated":{"type":"integer","format":"int64","description":"Accumulated number of activated employees until this date"}}}}},"paths":{"/api/v1/public/company/stats/activation":{"get":{"tags":["Stats"],"description":"Retrieves the Activation stats for the requested period","operationId":"getCompanyActivationStats","parameters":[{"name":"from","in":"query","description":"Start date for retrieving stats (ddMMyyyy format). If null: Today minus one month","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"End date for retrieving stats  (ddMMyyyy format). If null: Today","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"hierarchyId","in":"query","description":"Id of the area for which you want to retrive the stats. If null, all company data is returned","required":false,"schema":{"type":"string"}},{"name":"profile","in":"query","description":"Profile filter string. If not specified, no profile filtering will be applied.","required":false,"schema":{"type":"string"}},{"name":"groupId","in":"query","description":"One or more group ids for which you want to retrieve the stats. If not specified, no group filtering will be applied","required":false,"schema":{"type":"array","items":{"type":"string"},"uniqueItems":true}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Activation Stats"}}}}}}}}}
```

## GET /api/v1/employee/stats/{employeeId}

> Get's the extended stats. Id is optional, so the default is all company stats

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"employeeAPISessionId":[]}],"components":{"securitySchemes":{},"schemas":{"GlobalStatsDTO":{"type":"object","description":"An extension of a the base Hierarchy Stats, containing the evolution, scores, votes distribution and sub children","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"id":{"type":"string"},"name":{"type":"string"},"hi":{"type":"number","format":"double"},"hiVariation":{"type":"number","format":"double"},"valuation":{"$ref":"#/components/schemas/ValuationType"},"participation":{"type":"number","format":"double"},"votes":{"type":"integer","format":"int64"},"hiEvolution":{"type":"array","items":{"$ref":"#/components/schemas/HIDateResultDTO"}},"votesDistribution":{"type":"array","items":{"$ref":"#/components/schemas/VotesDistributionDTO"}},"scores":{"type":"array","items":{"$ref":"#/components/schemas/ScoreStatsDTO"}},"children":{"type":"array","items":{"$ref":"#/components/schemas/HierarchyStatsDTO"}},"ranking":{"type":"array","items":{"$ref":"#/components/schemas/HIAreaRankingResultDTO"}}}},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]},"HIDateResultDTO":{"type":"object","description":"Date based results of the HI","properties":{"date":{"type":"string","format":"date-time"},"hi":{"type":"number","format":"double"},"valuation":{"$ref":"#/components/schemas/ValuationType"}}},"VotesDistributionDTO":{"type":"object","description":"How the votes are distributed","properties":{"value":{"$ref":"#/components/schemas/QuestionValueDTO"},"votesPercent":{"type":"number","format":"double"},"overallVotesPercent":{"type":"number","format":"double"}}},"QuestionValueDTO":{"type":"object","description":"Option or value for a question (e.g. scale value, choice): id, score, value, image, color.","properties":{"id":{"type":"integer","format":"int32","description":"Value identifier"},"score":{"type":"integer","format":"int32","description":"Numeric score when applicable (e.g. for scales)"},"value":{"type":"string","description":"Display value (label)"},"imageUrl":{"type":"string","description":"URL of the image for this value"},"color":{"type":"string","description":"Color code for this value (e.g. for UI)"}}},"ScoreStatsDTO":{"type":"object","description":"Score stats: score, value, valuation, variation, date range.","properties":{"score":{"$ref":"#/components/schemas/ScoreDTO","description":"Score definition"},"value":{"type":"number","format":"double","description":"Current value"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation type"},"variation":{"type":"number","format":"double","description":"Variation"},"from":{"type":"string","format":"date-time","description":"Start date"},"to":{"type":"string","format":"date-time","description":"End date"}}},"ScoreDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"$ref":"#/components/schemas/MultiLanguage"},"iconPath":{"type":"string"},"description":{"$ref":"#/components/schemas/MultiLanguage"},"shortDescription":{"$ref":"#/components/schemas/MultiLanguage"},"status":{"$ref":"#/components/schemas/ScoreStatuses"},"factors":{"type":"array","items":{"$ref":"#/components/schemas/ScoreFactorDTO"},"uniqueItems":true},"schedule":{"type":"string","enum":["MONTHLY","BIMONTHLY","QUARTERLY","FOURMONTHLY","BIANNUAL","YEARLY"]},"lastMeasure":{"type":"string","format":"date-time"},"nextMeasure":{"type":"string","format":"date-time"},"measuringNow":{"type":"boolean"},"numberMeasurements":{"type":"integer","format":"int32"},"derived":{"type":"boolean"}}},"MultiLanguage":{"type":"object","properties":{"defaultValue":{"type":"string","minLength":1},"langValues":{"type":"object","additionalProperties":{"type":"string"}},"valid":{"type":"boolean"}},"required":["defaultValue"]},"ScoreStatuses":{"type":"string","description":"Status of a score in the company (ACTIVATED or DISABLED)","enum":["ACTIVATED","DISABLED"]},"ScoreFactorDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"$ref":"#/components/schemas/MultiLanguage"},"shortName":{"$ref":"#/components/schemas/MultiLanguage"},"description":{"$ref":"#/components/schemas/MultiLanguage"},"longDescription":{"$ref":"#/components/schemas/MultiLanguage"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/ScoreQuestionDTO"}}}},"ScoreQuestionDTO":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/QuestionType"},"title":{"$ref":"#/components/schemas/MultiLanguage"},"first":{"$ref":"#/components/schemas/QuestionValue"},"last":{"$ref":"#/components/schemas/QuestionValue"},"inverted":{"type":"boolean"},"values":{"type":"array","items":{"$ref":"#/components/schemas/QuestionValue"}}}},"QuestionType":{"type":"string","description":"Type of question used in company surveys or questionnaires","enum":["GENERAL","TOPIC","OPEN","RANGE"]},"QuestionValue":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"score":{"type":"integer","format":"int32"},"label":{"$ref":"#/components/schemas/MultiLanguage"},"imageUrl":{"type":"string"},"color":{"type":"string"}},"required":["id","label","score"]},"HierarchyStatsDTO":{"type":"object","description":"Base Hierarchy / Segment stats DTO. It contains information about the HI, participation, votes, etc.","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"id":{"type":"string"},"name":{"type":"string"},"hi":{"type":"number","format":"double"},"hiVariation":{"type":"number","format":"double"},"valuation":{"$ref":"#/components/schemas/ValuationType"},"participation":{"type":"number","format":"double"},"votes":{"type":"integer","format":"int64"}}},"HIAreaRankingResultDTO":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"id":{"type":"string"},"name":{"type":"string"},"hi":{"type":"number","format":"double"},"hiVariation":{"type":"number","format":"double"},"valuation":{"$ref":"#/components/schemas/ValuationType"},"participation":{"type":"number","format":"double"},"votes":{"type":"integer","format":"int64"},"position":{"type":"integer","format":"int32"}}}}},"paths":{"/api/v1/employee/stats/{employeeId}":{"get":{"tags":["Stats"],"description":"Get's the extended stats. Id is optional, so the default is all company stats","operationId":"getHierarchyExtendedStats","parameters":[{"name":"hierarchyId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalStatsDTO"}}}}}}}}}
```

## GET /api/v1/employee/stats/{employeeId}/score/{scoreId}

> Get's the Score Detail of all the leaf departments of the company of an employee

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"employeeAPISessionId":[]}],"components":{"securitySchemes":{},"schemas":{"ScoreDetailedStatsDTO":{"allOf":[{"$ref":"#/components/schemas/ScoreStatsDTO"},{"type":"object","properties":{"score":{"$ref":"#/components/schemas/ScoreDTO","description":"Score definition"},"value":{"type":"number","format":"double","description":"Current value"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation type"},"variation":{"type":"number","format":"double","description":"Variation"},"from":{"type":"string","format":"date-time","description":"Start date"},"to":{"type":"string","format":"date-time","description":"End date"},"pendingQuestions":{"type":"integer","format":"int32","description":"Number of pending questions"},"factors":{"type":"array","description":"Results per factor","items":{"$ref":"#/components/schemas/ScoreFactorResultDTO"}},"lastValue":{"type":"number","format":"double","description":"Last submitted value"}}}],"description":"Detailed score stats: variation, pending questions, factor results, last value."},"ScoreStatsDTO":{"type":"object","description":"Score stats: score, value, valuation, variation, date range.","properties":{"score":{"$ref":"#/components/schemas/ScoreDTO","description":"Score definition"},"value":{"type":"number","format":"double","description":"Current value"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation type"},"variation":{"type":"number","format":"double","description":"Variation"},"from":{"type":"string","format":"date-time","description":"Start date"},"to":{"type":"string","format":"date-time","description":"End date"}}},"ScoreDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"$ref":"#/components/schemas/MultiLanguage"},"iconPath":{"type":"string"},"description":{"$ref":"#/components/schemas/MultiLanguage"},"shortDescription":{"$ref":"#/components/schemas/MultiLanguage"},"status":{"$ref":"#/components/schemas/ScoreStatuses"},"factors":{"type":"array","items":{"$ref":"#/components/schemas/ScoreFactorDTO"},"uniqueItems":true},"schedule":{"type":"string","enum":["MONTHLY","BIMONTHLY","QUARTERLY","FOURMONTHLY","BIANNUAL","YEARLY"]},"lastMeasure":{"type":"string","format":"date-time"},"nextMeasure":{"type":"string","format":"date-time"},"measuringNow":{"type":"boolean"},"numberMeasurements":{"type":"integer","format":"int32"},"derived":{"type":"boolean"}}},"MultiLanguage":{"type":"object","properties":{"defaultValue":{"type":"string","minLength":1},"langValues":{"type":"object","additionalProperties":{"type":"string"}},"valid":{"type":"boolean"}},"required":["defaultValue"]},"ScoreStatuses":{"type":"string","description":"Status of a score in the company (ACTIVATED or DISABLED)","enum":["ACTIVATED","DISABLED"]},"ScoreFactorDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"$ref":"#/components/schemas/MultiLanguage"},"shortName":{"$ref":"#/components/schemas/MultiLanguage"},"description":{"$ref":"#/components/schemas/MultiLanguage"},"longDescription":{"$ref":"#/components/schemas/MultiLanguage"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/ScoreQuestionDTO"}}}},"ScoreQuestionDTO":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/QuestionType"},"title":{"$ref":"#/components/schemas/MultiLanguage"},"first":{"$ref":"#/components/schemas/QuestionValue"},"last":{"$ref":"#/components/schemas/QuestionValue"},"inverted":{"type":"boolean"},"values":{"type":"array","items":{"$ref":"#/components/schemas/QuestionValue"}}}},"QuestionType":{"type":"string","description":"Type of question used in company surveys or questionnaires","enum":["GENERAL","TOPIC","OPEN","RANGE"]},"QuestionValue":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"score":{"type":"integer","format":"int32"},"label":{"$ref":"#/components/schemas/MultiLanguage"},"imageUrl":{"type":"string"},"color":{"type":"string"}},"required":["id","label","score"]},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]},"ScoreFactorResultDTO":{"type":"object","description":"Score factor result: factor, value, valuation, variation.","properties":{"factor":{"$ref":"#/components/schemas/ScoreFactorDTO","description":"Score factor definition"},"value":{"type":"number","format":"double","description":"Value"},"valuation":{"$ref":"#/components/schemas/ValuationType","description":"Valuation type"},"variation":{"type":"number","format":"double","description":"Variation"}}}}},"paths":{"/api/v1/employee/stats/{employeeId}/score/{scoreId}":{"get":{"tags":["Stats"],"description":"Get's the Score Detail of all the leaf departments of the company of an employee","operationId":"getScoreDetailedStats","parameters":[{"name":"scoreId","in":"path","required":true,"schema":{"type":"string"}},{"name":"hierarchyId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreDetailedStatsDTO"}}}}}}}}}
```

## GET /api/v1/employee/stats/{employeeId}/hierarchies

> Get's the HI of all the leaf departments of the company of an employee

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[{"name":"Stats","description":"Stats related operations"}],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"employeeAPISessionId":[]}],"components":{"securitySchemes":{},"schemas":{"HIHierarchyStatsDTO":{"type":"object","description":"HI stats per hierarchy: hierarchy, index rating, variation, valuation, votes.","properties":{"hierarchy":{"$ref":"#/components/schemas/EmployeeHierarchyDTO"},"indexRating":{"type":"number","format":"double"},"indexVariation":{"type":"number","format":"double"},"valuation":{"$ref":"#/components/schemas/ValuationType"},"votes":{"type":"integer","format":"int64"}}},"EmployeeHierarchyDTO":{"type":"object","description":"Employee hierarchy node: id, parent id, name, and children (recursive structure).","properties":{"id":{"type":"string","description":"Hierarchy node identifier"},"parentId":{"type":"string","description":"Parent node identifier"},"name":{"type":"string","description":"Display name of the hierarchy node"},"children":{"type":"array","description":"Child nodes","items":{"description":"Employee hierarchy node: id, parent id, name, and children (recursive structure)."},"uniqueItems":true}}},"ValuationType":{"type":"string","description":"Valuation of data of a specific field or metric; usually based on the participation of employees in a survey or the number of responses to a question.","enum":["NO_DATA","BAD","WARNING","NEUTRAL","GOOD","EXCELLENT"]}}},"paths":{"/api/v1/employee/stats/{employeeId}/hierarchies":{"get":{"tags":["Stats"],"description":"Get's the HI of all the leaf departments of the company of an employee","operationId":"getHierarchyStatsForQuestion_1","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"to","in":"query","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HIHierarchyStatsDTO"}}}}}},"deprecated":true}}}}
```
