# UserRoles

Endpoint for managing Roles

## GET /v1/Roles

> Get all usersRoles in the tenant

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserRoles","description":"Endpoint for managing Roles"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.Roles.RoleModel":{"type":"object","properties":{"Created":{"type":"string","format":"date-time"},"LastModified":{"type":"string","format":"date-time"},"CreatedBy":{"type":"string","nullable":true},"LastModifiedBy":{"type":"string","nullable":true},"Uid":{"type":"string","format":"uuid"},"Name":{"type":"string","nullable":true},"PermissionSetup":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.PermissionSetup"}},"additionalProperties":false},"Struct.App.Api.Models.Roles.PermissionSetup":{"type":"object","properties":{"AssignedPermissions":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true}},"additionalProperties":false},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/Roles":{"get":{"tags":["UserRoles"],"summary":"Get all usersRoles in the tenant","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.RoleModel"}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## POST /v1/Roles

> Creates a new user role

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserRoles","description":"Endpoint for managing Roles"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.Roles.CreateRoleModel":{"type":"object","properties":{"Uid":{"type":"string","format":"uuid"},"Name":{"type":"string","nullable":true},"PermissionSetup":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.PermissionSetup"}},"additionalProperties":false},"Struct.App.Api.Models.Roles.PermissionSetup":{"type":"object","properties":{"AssignedPermissions":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true}},"additionalProperties":false},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/Roles":{"post":{"tags":["UserRoles"],"summary":"Creates a new user role","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.CreateRoleModel"}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## PUT /v1/Roles

> Updates an existing role

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserRoles","description":"Endpoint for managing Roles"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.Roles.UpdateRoleModel":{"type":"object","properties":{"Uid":{"type":"string","format":"uuid"},"Name":{"type":"string","nullable":true},"PermissionSetup":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.PermissionSetup"}},"additionalProperties":false},"Struct.App.Api.Models.Roles.PermissionSetup":{"type":"object","properties":{"AssignedPermissions":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true}},"additionalProperties":false},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/Roles":{"put":{"tags":["UserRoles"],"summary":"Updates an existing role","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.UpdateRoleModel"}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## GET /v1/Roles/{uid}

> Returns a single userRoles from the tenant

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserRoles","description":"Endpoint for managing Roles"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.Roles.RoleModel":{"type":"object","properties":{"Created":{"type":"string","format":"date-time"},"LastModified":{"type":"string","format":"date-time"},"CreatedBy":{"type":"string","nullable":true},"LastModifiedBy":{"type":"string","nullable":true},"Uid":{"type":"string","format":"uuid"},"Name":{"type":"string","nullable":true},"PermissionSetup":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.PermissionSetup"}},"additionalProperties":false},"Struct.App.Api.Models.Roles.PermissionSetup":{"type":"object","properties":{"AssignedPermissions":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true}},"additionalProperties":false},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/Roles/{uid}":{"get":{"tags":["UserRoles"],"summary":"Returns a single userRoles from the tenant","parameters":[{"name":"uid","in":"path","description":"","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.Roles.RoleModel"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## DELETE /v1/Roles/{uid}

> Deletes an existing role

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserRoles","description":"Endpoint for managing Roles"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/Roles/{uid}":{"delete":{"tags":["UserRoles"],"summary":"Deletes an existing role","parameters":[{"name":"uid","in":"path","description":"","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```
