# Users

> SDK methods for the Users module, accessed via `soat.users`. See the [Users module docs](/docs/modules/users) for permissions and data model, and each method's REST page for the full request/response schema.

# Users

SDK methods for the Users module, accessed via `soat.users`. See the [Users module docs](/docs/modules/users) for permissions and data model, and each method's REST page for the full request/response schema.

### `soat.users.getCurrentUser()`

Get the current authenticated user

- Method: `GET`
- Path: `/api/v1/users/me`

```ts
await soat.users.getCurrentUser();
```

→ [Request & response schema](/docs/api/users/get-current-user)

### `soat.users.listUsers()`

List all users

- Method: `GET`
- Path: `/api/v1/users`

```ts
await soat.users.listUsers({
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/users/list-users)

### `soat.users.createUser()`

Create a user

- Method: `POST`
- Path: `/api/v1/users`

```ts
await soat.users.createUser({
  body: { username, password, /* + optional */ },
});
```

→ [Request & response schema](/docs/api/users/create-user)

### `soat.users.getUser()`

Get a user by ID

- Method: `GET`
- Path: `/api/v1/users/{user_id}`

```ts
await soat.users.getUser({
  path: { user_id },
});
```

→ [Request & response schema](/docs/api/users/get-user)

### `soat.users.deleteUser()`

Delete a user by ID

- Method: `DELETE`
- Path: `/api/v1/users/{user_id}`

```ts
await soat.users.deleteUser({
  path: { user_id },
});
```

→ [Request & response schema](/docs/api/users/delete-user)

### `soat.users.bootstrapUser()`

Create the first admin user

- Method: `POST`
- Path: `/api/v1/users/bootstrap`

```ts
await soat.users.bootstrapUser({
  body: { username, password },
});
```

→ [Request & response schema](/docs/api/users/bootstrap-user)

### `soat.users.loginUser()`

Login user

- Method: `POST`
- Path: `/api/v1/users/login`

```ts
await soat.users.loginUser({
  body: { username, password },
});
```

→ [Request & response schema](/docs/api/users/login-user)

### `soat.users.attachUserPolicies()`

Attach policies to a user

- Method: `PUT`
- Path: `/api/v1/users/{user_id}/policies`

```ts
await soat.users.attachUserPolicies({
  path: { user_id },
  body: { policy_ids },
});
```

→ [Request & response schema](/docs/api/users/attach-user-policies)
