# SDK Domain Modules

`createClient()` returns a `MoltlazyClient` with 7 domain modules. Each module wraps a set of related Admin HTTP RPC methods with typed parameters and response types.

## config

```ts
client.config.get()                        // config.get
client.config.set(params: ConfigSetParams)  // config.set
client.config.apply(params: ConfigApplyParams) // config.apply
```

`ConfigSetParams` and `ConfigApplyParams` both accept:

```ts
{
  raw: string;        // serialised JSON config fragment
  baseHash?: string;  // optional optimistic concurrency token
}
```

Example — set session DM scope:

```ts
await client.config.set({
  raw: JSON.stringify({ session: { dmScope: 'per-channel-peer' } }),
});
```

## agents

```ts
client.agents.list()
client.agents.create(params: AgentCreateParams)
client.agents.update(params: AgentUpdateParams)
client.agents.delete(params: AgentDeleteParams)
```

`AgentCreateParams` requires `name` and `workspace`:

```ts
await client.agents.create({
  name: 'coder',
  workspace: '/home/openclaw/workspace',
  model: 'claude-opus-4', // optional
});
```

## channels

```ts
client.channels.status(params?: ChannelStatusParams)
client.channels.start(params)
client.channels.stop(params)
```

`ChannelStatus` includes `ts`, `channelOrder`, `channels`, `channelAccounts`, and `channelDefaultAccountId`.

## devices

```ts
client.devices.list()
client.devices.approve(params: DevicePairActionParams)
client.devices.reject(params: DevicePairActionParams)
client.devices.remove(params: DevicePairActionParams)
```

`DevicePairRequest` fields: `requestId`, `deviceId`, `displayName`, `publicKey`, `ts`.

## cron

```ts
client.cron.list()
client.cron.get(params: { name: string })
client.cron.add(params: CronAddParams)
client.cron.update(params: CronUpdateParams)
client.cron.remove(params: CronRemoveParams)
client.cron.run(params: CronRunParams)
```

`CronAddParams` requires a discriminated `CronSchedule` union (`at` / `every` / `cron`) plus `name`, `sessionTarget`, `wakeMode`, and a `payload` union (`systemEvent` | `agentTurn`).

## models

```ts
client.models.list();
client.models.authStatus();
```

`ModelInfo` has required fields `id` and `name`.

## gateway

```ts
client.gateway.health()
client.gateway.status()
client.gateway.restart()
client.gateway.logsTail(params?)
```

`HealthResponse` and `GatewayStatus` are moltlazy-defined types with no direct upstream equivalent.
