# Groups

## List groups

> List groups in the same workspace.

```json
{"openapi":"3.1.0","info":{"title":"revault-api","version":"1.55.0"},"servers":[{"url":"/v1/rest"}],"security":[{"Authorization":[]}],"components":{"securitySchemes":{"Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"error.BAD_REQUEST":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Invalid input data error (400)","description":"The error information"},"error.UNAUTHORIZED":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Authorization not provided error (401)","description":"The error information"},"error.FORBIDDEN":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Insufficient access error (403)","description":"The error information"},"error.NOT_FOUND":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Not found error (404)","description":"The error information"},"error.INTERNAL_SERVER_ERROR":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Internal server error error (500)","description":"The error information"}}},"paths":{"/groups":{"get":{"operationId":"groups-list","summary":"List groups","description":"List groups in the same workspace.","tags":["group"],"parameters":[{"in":"query","name":"page","schema":{"default":1,"description":"Which page to fetch","type":"integer","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"pageSize","schema":{"default":30,"description":"Page size to use","type":"integer","minimum":1,"maximum":30}},{"in":"query","name":"status","schema":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"Group status"}},{"in":"query","name":"sortBy","schema":{"default":"createdAt","description":"Sort by attribute","type":"string","enum":["name","status","createdAt","updatedAt"]}},{"in":"query","name":"sortOrder","schema":{"default":"asc","description":"Sort order","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"number","description":"Current page"},"next":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Next page or null if there is none"},"prev":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Previous page or null if there is none"},"pageSize":{"type":"number","description":"Max count of items per page"},"total":{"type":"number","description":"Total count of items"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Internal unique identifier"},"legacyId":{"type":"number","description":"Legacy internal unique identifier (for retro-compatibility)"},"name":{"type":"string","description":"Group name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Group description"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"Group status"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Internal unique identifier"},"legacyId":{"type":"number","description":"Legacy internal unique identifier (for retro-compatibility)"},"legacyViewAll":{"type":"boolean","description":"If true, user can read all resources on the workspace"},"workspaceName":{"type":"string","description":"User's workspace name"},"name":{"type":"string","description":"User name"},"deviceUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User's device ID (for non-API users)"},"deviceType":{"type":"string","enum":["PSD","SOFT_PSD","API"],"description":"User's device type"},"role":{"type":"string","enum":["ADMIN","OPERATOR","READ_ONLY_API_KEY"],"description":"User role"},"pubKey":{"type":"string","description":"User public key"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"User status"},"isSuspended":{"type":"boolean","description":"Whether the user is suspended"},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last modification timestamp","type":"string"}},"required":["id","legacyId","legacyViewAll","workspaceName","name","deviceUserId","deviceType","role","pubKey","status","isSuspended","createdAt","updatedAt"],"additionalProperties":false},"description":"Group members"},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last modification timestamp","type":"string"}},"required":["id","legacyId","name","description","status","members","createdAt","updatedAt"],"additionalProperties":false},"description":"Array of results"}},"required":["page","next","prev","pageSize","total","results"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}}}}
```

## Get a single group

> Find a group by ID.

```json
{"openapi":"3.1.0","info":{"title":"revault-api","version":"1.55.0"},"servers":[{"url":"/v1/rest"}],"security":[{"Authorization":[]}],"components":{"securitySchemes":{"Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"error.BAD_REQUEST":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Invalid input data error (400)","description":"The error information"},"error.UNAUTHORIZED":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Authorization not provided error (401)","description":"The error information"},"error.FORBIDDEN":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Insufficient access error (403)","description":"The error information"},"error.NOT_FOUND":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Not found error (404)","description":"The error information"},"error.INTERNAL_SERVER_ERROR":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Internal server error error (500)","description":"The error information"}}},"paths":{"/groups/{id}":{"get":{"operationId":"groups-findById","summary":"Get a single group","description":"Find a group by ID.","tags":["group"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"Id of the target group"},"required":true,"description":"Id of the target group"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Internal unique identifier"},"legacyId":{"type":"number","description":"Legacy internal unique identifier (for retro-compatibility)"},"name":{"type":"string","description":"Group name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Group description"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"Group status"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Internal unique identifier"},"legacyId":{"type":"number","description":"Legacy internal unique identifier (for retro-compatibility)"},"legacyViewAll":{"type":"boolean","description":"If true, user can read all resources on the workspace"},"workspaceName":{"type":"string","description":"User's workspace name"},"name":{"type":"string","description":"User name"},"deviceUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User's device ID (for non-API users)"},"deviceType":{"type":"string","enum":["PSD","SOFT_PSD","API"],"description":"User's device type"},"role":{"type":"string","enum":["ADMIN","OPERATOR","READ_ONLY_API_KEY"],"description":"User role"},"pubKey":{"type":"string","description":"User public key"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"User status"},"isSuspended":{"type":"boolean","description":"Whether the user is suspended"},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last modification timestamp","type":"string"}},"required":["id","legacyId","legacyViewAll","workspaceName","name","deviceUserId","deviceType","role","pubKey","status","isSuspended","createdAt","updatedAt"],"additionalProperties":false},"description":"Group members"},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last modification timestamp","type":"string"}},"required":["id","legacyId","name","description","status","members","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}}}}
```
