> 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/groups-resource.md).

# Groups Resource

## GET /api/v1/company/employees/groups/{groupId}

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"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":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"EmployeeGroupDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employeeCount":{"type":"integer","format":"int64"},"groupFlags":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupFlag"},"uniqueItems":true},"exitPolicies":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupExitPolicy"}},"allowedHierarchies":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"EmployeeGroupFlag":{"type":"string","description":"Employee group flag","enum":["NO_PRIMARY_VOTE","ONLY_GROUP_QUESTIONS_VOTE","NO_SCORES_VOTE","NO_ENPS_VOTE"]},"EmployeeGroupExitPolicy":{"type":"object","properties":{"policyType":{"$ref":"#/components/schemas/EmployeeGroupExitPolicyType"},"exitAction":{"$ref":"#/components/schemas/EmployeeGroupExitAction"},"days":{"type":"integer","format":"int32"}},"required":["exitAction","policyType"]},"EmployeeGroupExitPolicyType":{"type":"string","description":"Employee group exit policy type","enum":["NONE","ALL_QUESTIONS","ELAPSED_DAYS"]},"EmployeeGroupExitAction":{"type":"object","properties":{"actionType":{"$ref":"#/components/schemas/EmployeeGroupExitActionType"},"targetGroup":{"type":"string"}}},"EmployeeGroupExitActionType":{"type":"string","description":"Employee group exit action types","enum":["REMOVE_GROUP","DELETE_EMPLOYEE","MOVE_TO_GROUP","NONE"]}}},"paths":{"/api/v1/company/employees/groups/{groupId}":{"get":{"tags":["groups-resource"],"operationId":"getGroup","parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}},{"name":"active","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EmployeeGroupDTO"}}}}}}}}}
```

## PUT /api/v1/company/employees/groups/{groupId}

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"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":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"EmployeeGroupDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employeeCount":{"type":"integer","format":"int64"},"groupFlags":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupFlag"},"uniqueItems":true},"exitPolicies":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupExitPolicy"}},"allowedHierarchies":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"EmployeeGroupFlag":{"type":"string","description":"Employee group flag","enum":["NO_PRIMARY_VOTE","ONLY_GROUP_QUESTIONS_VOTE","NO_SCORES_VOTE","NO_ENPS_VOTE"]},"EmployeeGroupExitPolicy":{"type":"object","properties":{"policyType":{"$ref":"#/components/schemas/EmployeeGroupExitPolicyType"},"exitAction":{"$ref":"#/components/schemas/EmployeeGroupExitAction"},"days":{"type":"integer","format":"int32"}},"required":["exitAction","policyType"]},"EmployeeGroupExitPolicyType":{"type":"string","description":"Employee group exit policy type","enum":["NONE","ALL_QUESTIONS","ELAPSED_DAYS"]},"EmployeeGroupExitAction":{"type":"object","properties":{"actionType":{"$ref":"#/components/schemas/EmployeeGroupExitActionType"},"targetGroup":{"type":"string"}}},"EmployeeGroupExitActionType":{"type":"string","description":"Employee group exit action types","enum":["REMOVE_GROUP","DELETE_EMPLOYEE","MOVE_TO_GROUP","NONE"]}}},"paths":{"/api/v1/company/employees/groups/{groupId}":{"put":{"tags":["groups-resource"],"operationId":"updateGroup","parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/EmployeeGroupDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EmployeeGroupDTO"}}}}}}}}}
```

## DELETE /api/v1/company/employees/groups/{groupId}

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"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":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"EmployeeGroupDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employeeCount":{"type":"integer","format":"int64"},"groupFlags":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupFlag"},"uniqueItems":true},"exitPolicies":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupExitPolicy"}},"allowedHierarchies":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"EmployeeGroupFlag":{"type":"string","description":"Employee group flag","enum":["NO_PRIMARY_VOTE","ONLY_GROUP_QUESTIONS_VOTE","NO_SCORES_VOTE","NO_ENPS_VOTE"]},"EmployeeGroupExitPolicy":{"type":"object","properties":{"policyType":{"$ref":"#/components/schemas/EmployeeGroupExitPolicyType"},"exitAction":{"$ref":"#/components/schemas/EmployeeGroupExitAction"},"days":{"type":"integer","format":"int32"}},"required":["exitAction","policyType"]},"EmployeeGroupExitPolicyType":{"type":"string","description":"Employee group exit policy type","enum":["NONE","ALL_QUESTIONS","ELAPSED_DAYS"]},"EmployeeGroupExitAction":{"type":"object","properties":{"actionType":{"$ref":"#/components/schemas/EmployeeGroupExitActionType"},"targetGroup":{"type":"string"}}},"EmployeeGroupExitActionType":{"type":"string","description":"Employee group exit action types","enum":["REMOVE_GROUP","DELETE_EMPLOYEE","MOVE_TO_GROUP","NONE"]}}},"paths":{"/api/v1/company/employees/groups/{groupId}":{"delete":{"tags":["groups-resource"],"operationId":"deleteGroup","parameters":[{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EmployeeGroupDTO"}}}}}}}}}
```

## GET /api/v1/company/employees/groups

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"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":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"EmployeeGroupDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employeeCount":{"type":"integer","format":"int64"},"groupFlags":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupFlag"},"uniqueItems":true},"exitPolicies":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupExitPolicy"}},"allowedHierarchies":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"EmployeeGroupFlag":{"type":"string","description":"Employee group flag","enum":["NO_PRIMARY_VOTE","ONLY_GROUP_QUESTIONS_VOTE","NO_SCORES_VOTE","NO_ENPS_VOTE"]},"EmployeeGroupExitPolicy":{"type":"object","properties":{"policyType":{"$ref":"#/components/schemas/EmployeeGroupExitPolicyType"},"exitAction":{"$ref":"#/components/schemas/EmployeeGroupExitAction"},"days":{"type":"integer","format":"int32"}},"required":["exitAction","policyType"]},"EmployeeGroupExitPolicyType":{"type":"string","description":"Employee group exit policy type","enum":["NONE","ALL_QUESTIONS","ELAPSED_DAYS"]},"EmployeeGroupExitAction":{"type":"object","properties":{"actionType":{"$ref":"#/components/schemas/EmployeeGroupExitActionType"},"targetGroup":{"type":"string"}}},"EmployeeGroupExitActionType":{"type":"string","description":"Employee group exit action types","enum":["REMOVE_GROUP","DELETE_EMPLOYEE","MOVE_TO_GROUP","NONE"]}}},"paths":{"/api/v1/company/employees/groups":{"get":{"tags":["groups-resource"],"operationId":"getGroups","parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupDTO"}}}}}}}}}}
```

## POST /api/v1/company/employees/groups

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"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":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"EmployeeGroupDTO":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employeeCount":{"type":"integer","format":"int64"},"groupFlags":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupFlag"},"uniqueItems":true},"exitPolicies":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeGroupExitPolicy"}},"allowedHierarchies":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"EmployeeGroupFlag":{"type":"string","description":"Employee group flag","enum":["NO_PRIMARY_VOTE","ONLY_GROUP_QUESTIONS_VOTE","NO_SCORES_VOTE","NO_ENPS_VOTE"]},"EmployeeGroupExitPolicy":{"type":"object","properties":{"policyType":{"$ref":"#/components/schemas/EmployeeGroupExitPolicyType"},"exitAction":{"$ref":"#/components/schemas/EmployeeGroupExitAction"},"days":{"type":"integer","format":"int32"}},"required":["exitAction","policyType"]},"EmployeeGroupExitPolicyType":{"type":"string","description":"Employee group exit policy type","enum":["NONE","ALL_QUESTIONS","ELAPSED_DAYS"]},"EmployeeGroupExitAction":{"type":"object","properties":{"actionType":{"$ref":"#/components/schemas/EmployeeGroupExitActionType"},"targetGroup":{"type":"string"}}},"EmployeeGroupExitActionType":{"type":"string","description":"Employee group exit action types","enum":["REMOVE_GROUP","DELETE_EMPLOYEE","MOVE_TO_GROUP","NONE"]}}},"paths":{"/api/v1/company/employees/groups":{"post":{"tags":["groups-resource"],"operationId":"addGroup","requestBody":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/EmployeeGroupDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EmployeeGroupDTO"}}}}}}}}}
```
