> ## Documentation Index
> Fetch the complete documentation index at: https://docs.h3aven.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Request Schemas

> Request body schemas for invite-user, assign-role, revoke-role, and policy endpoints.

This page centralizes the **request schemas** for a few commonly-used endpoints.
The canonical source is `api-reference/openapi.yml`.

## invite-user

**Endpoint**: `POST /v1/invites`
**Schema**: `InviteUserRequestSchema`
**Body**: `application/json`

### Schema (OpenAPI-style)

```json theme={null}
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "email": "string",
    "name": "string",
    "role": "string",
    "policy": "string"
  }
}
```

### Example

```json theme={null}
{
  "email": "john@doe.com",
  "name": "John Doe",
  "role": "Admin",
  "policy": "Admin"
}
```

## assign-role

**Endpoint**: `POST /v1/roles/assign`
**Schema**: `AssignRoleRequestSchema`
**Body**: `application/json`

### Schema (OpenAPI-style)

```json theme={null}
{
  "type": "object",
  "additionalProperties": false,
  "required": ["role", "userId"],
  "properties": {
    "role": "string",
    "userId": "string"
  }
}
```

### Required fields

* **role**: `string`
* **userId**: `string`

### Example

```json theme={null}
{
  "role": "Admin",
  "userId": "uuid"
}
```

## revoke-role

**Endpoint**: `POST /v1/roles/revoke`
**Schema**: `RevokeRoleRequestSchema`
**Body**: `application/json`

### Schema (OpenAPI-style)

```json theme={null}
{
  "type": "object",
  "additionalProperties": false,
  "required": ["role", "userId"],
  "properties": {
    "role": "string",
    "userId": "string"
  }
}
```

### Required fields

* **role**: `string`
* **userId**: `string`

### Example

```json theme={null}
{
  "role": "Admin",
  "userId": "uuid"
}
```

## create-policy

**Endpoint**: `POST /v1/users/policies`
**Schema**: `CreatePolicyRequestSchema`
**Body**: `application/json`

### Schema (OpenAPI-style)

```json theme={null}
{
  "type": "object",
  "additionalProperties": false,
  "required": ["name"],
  "properties": {
    "name": "string",
    "roles": "string[]",
    "functions": "string[]"
  }
}
```

### Required fields

* **name**: `string`

### Optional fields

* **roles**: `string[]`
* **functions**: `string[]`

### Example

```json theme={null}
{
  "name": "toManage",
  "roles": ["Admin"],
  "functions": ["fullDbPermission"]
}
```

## update-policy

**Endpoint**: `PATCH /v1/users/policies/{id}`
**Schema**: `UpdatePolicyRequestSchema`
**Path params**:

* **id**: `string` (required)

**Body**: `application/json`

### Schema (OpenAPI-style)

```json theme={null}
{
  "type": "object",
  "additionalProperties": false,
  "required": ["name"],
  "properties": {
    "oldPolicyName": "string",
    "name": "string",
    "roles": "string[]",
    "functions": "string[]"
  }
}
```

### Required fields

* **name**: `string`

### Optional fields

* **oldPolicyName**: `string`
* **roles**: `string[]`
* **functions**: `string[]`

### Example

```json theme={null}
{
  "oldPolicyName": "toManage (old)",
  "name": "toManage",
  "roles": ["Admin"],
  "functions": ["fullDbPermission"]
}
```

## delete-policy

**Endpoint**: `DELETE /v1/users/policies/{id}`
**Path params** (from `components.parameters.Id`):

* **id**: `string` (required)

**Body**: none
