# BusinessUnits

Business units are used for advanced access policies where users have different permissions on different entities in the system depending on the business units they are part of and how these business units are related to the entities.

## GET /v1/businessunits

> Get all business units

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"BusinessUnits","description":"Business units are used for advanced access policies where users have different permissions on different entities in the system depending on the business units they are part of and how these business units are related to the entities."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.BusinessUnit.BusinessUnitModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique identifier of the business unit","format":"uuid"},"Alias":{"type":"string","description":"Alias of the business unit","nullable":true},"Name":{"type":"string","description":"Name of the business unit","nullable":true},"Created":{"type":"string","description":"When the business unit was created","format":"date-time"},"CreatedBy":{"type":"string","description":"Who created the business unit","nullable":true},"LastModified":{"type":"string","description":"When the business unit was last modified","format":"date-time"},"LastModifiedBy":{"type":"string","description":"Who last modified the business unit","nullable":true}},"additionalProperties":false,"description":"Represents a business unit model"}}},"paths":{"/v1/businessunits":{"get":{"tags":["BusinessUnits"],"summary":"Get all business units","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.BusinessUnit.BusinessUnitModel"}}}}}}}}}}
```

## POST /v1/businessunits

> Create a business unit

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"BusinessUnits","description":"Business units are used for advanced access policies where users have different permissions on different entities in the system depending on the business units they are part of and how these business units are related to the entities."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.BusinessUnit.CreateBusinessUnitModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique identifier of the business unit","format":"uuid"},"Alias":{"type":"string","description":"Alias of the business unit","nullable":true},"Name":{"type":"string","description":"Name of the business unit","nullable":true}},"additionalProperties":false,"description":"Model for creating a business unit"}}},"paths":{"/v1/businessunits":{"post":{"tags":["BusinessUnits"],"summary":"Create a business unit","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.BusinessUnit.CreateBusinessUnitModel"}}}},"responses":{"200":{"description":"OK"}}}}}}
```

## PUT /v1/businessunits

> Update a business unit

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"BusinessUnits","description":"Business units are used for advanced access policies where users have different permissions on different entities in the system depending on the business units they are part of and how these business units are related to the entities."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.BusinessUnit.UpdateBusinessUnitModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique identifier of the business unit","format":"uuid"},"Alias":{"type":"string","description":"Alias of the business unit","nullable":true},"Name":{"type":"string","description":"Name of the business unit","nullable":true}},"additionalProperties":false,"description":"Model for updating a business unit"}}},"paths":{"/v1/businessunits":{"put":{"tags":["BusinessUnits"],"summary":"Update a business unit","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.BusinessUnit.UpdateBusinessUnitModel"}}}},"responses":{"200":{"description":"OK"}}}}}}
```

## GET /v1/businessunits/{uid}

> Get a specific business unit

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"BusinessUnits","description":"Business units are used for advanced access policies where users have different permissions on different entities in the system depending on the business units they are part of and how these business units are related to the entities."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.BusinessUnit.BusinessUnitModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique identifier of the business unit","format":"uuid"},"Alias":{"type":"string","description":"Alias of the business unit","nullable":true},"Name":{"type":"string","description":"Name of the business unit","nullable":true},"Created":{"type":"string","description":"When the business unit was created","format":"date-time"},"CreatedBy":{"type":"string","description":"Who created the business unit","nullable":true},"LastModified":{"type":"string","description":"When the business unit was last modified","format":"date-time"},"LastModifiedBy":{"type":"string","description":"Who last modified the business unit","nullable":true}},"additionalProperties":false,"description":"Represents a business unit model"},"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/businessunits/{uid}":{"get":{"tags":["BusinessUnits"],"summary":"Get a specific business unit","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.BusinessUnit.BusinessUnitModel"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## DELETE /v1/businessunits/{uid}

> Delete a business unit

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"BusinessUnits","description":"Business units are used for advanced access policies where users have different permissions on different entities in the system depending on the business units they are part of and how these business units are related to the entities."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}}},"paths":{"/v1/businessunits/{uid}":{"delete":{"tags":["BusinessUnits"],"summary":"Delete a business unit","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}}}}
```
