# Users

## GET /v1/users

> Get all users in the tenant

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"Users","description":""}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.User.UserModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique identifier for the user","nullable":true},"Email":{"type":"string","description":"Email address for the user","nullable":true},"Firstname":{"type":"string","description":"Firstname of the user","nullable":true},"Lastname":{"type":"string","description":"Lastname of the user","nullable":true},"Status":{"$ref":"#/components/schemas/Struct.App.Api.Models.User.UserStatus"},"UserGroups":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Groups the user is a member of","nullable":true},"Roles":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Roles the user is a member of","nullable":true}},"additionalProperties":false,"description":"Represents a user in the tenant"},"Struct.App.Api.Models.User.UserStatus":{"enum":[0,1,2],"type":"integer","description":"Represents a status for a user \n\n- `0` = **Invited**: User has been invited but not yet activated\n- `1` = **Active**: User is active and can log in\n- `2` = **Disabled**: User is disabled and cannot log in","format":"int32"},"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/users":{"get":{"tags":["Users"],"summary":"Get all users in the tenant","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.User.UserModel"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## POST /v1/users

> Invites a user to the tenant

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"Users","description":""}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.User.InviteUserModel":{"type":"object","properties":{"UserEmail":{"type":"string","description":"Email of the user to invite","nullable":true},"TenantRoleUids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Roles to assign to the user","nullable":true},"TenantUserGroupUids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"User groups to assign to the user","nullable":true},"Message":{"type":"string","description":"Message to include in the invitation","nullable":true}},"additionalProperties":false,"description":"Model for inviting a user to a tenant"},"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/users":{"post":{"tags":["Users"],"summary":"Invites a user to the tenant","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.User.InviteUserModel"}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## PUT /v1/users

>

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"Users","description":""}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.User.UpdateUserModel":{"type":"object","properties":{"UserUid":{"type":"string","description":"The unique identifier of the user","nullable":true},"Roles":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The roles to assign to the user","nullable":true},"UserGroups":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The user groups to assign to the user","nullable":true}},"additionalProperties":false,"description":"Represents a model for updating a user"},"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/users":{"put":{"tags":["Users"],"summary":"","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.User.UpdateUserModel"}}}},"responses":{"200":{"description":"OK"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## GET /v1/users/{uid}

> Returns a single user from the tenant

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"Users","description":""}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.User.UserModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique identifier for the user","nullable":true},"Email":{"type":"string","description":"Email address for the user","nullable":true},"Firstname":{"type":"string","description":"Firstname of the user","nullable":true},"Lastname":{"type":"string","description":"Lastname of the user","nullable":true},"Status":{"$ref":"#/components/schemas/Struct.App.Api.Models.User.UserStatus"},"UserGroups":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Groups the user is a member of","nullable":true},"Roles":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Roles the user is a member of","nullable":true}},"additionalProperties":false,"description":"Represents a user in the tenant"},"Struct.App.Api.Models.User.UserStatus":{"enum":[0,1,2],"type":"integer","description":"Represents a status for a user \n\n- `0` = **Invited**: User has been invited but not yet activated\n- `1` = **Active**: User is active and can log in\n- `2` = **Disabled**: User is disabled and cannot log in","format":"int32"},"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/users/{uid}":{"get":{"tags":["Users"],"summary":"Returns a single user from the tenant","parameters":[{"name":"uid","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.User.UserModel"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## DELETE /v1/users/{uid}

>

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"Users","description":""}],"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/users/{uid}":{"delete":{"tags":["Users"],"summary":"","parameters":[{"name":"uid","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.struct.com/api-reference/endpoints/users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
