# Sessions

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

# Sessions

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

### `soat.sessions.createSession()`

Create a session

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

```ts
await soat.sessions.createSession({
  body: { agent_id, /* + optional */ },
});
```

→ [Request & response schema](/docs/api/sessions/create-session)

### `soat.sessions.listSessions()`

List sessions

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

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

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

### `soat.sessions.getSession()`

Get a session

- Method: `GET`
- Path: `/api/v1/sessions/{session_id}`

```ts
await soat.sessions.getSession();
```

→ [Request & response schema](/docs/api/sessions/get-session)

### `soat.sessions.updateSession()`

Update a session

- Method: `PATCH`
- Path: `/api/v1/sessions/{session_id}`

```ts
await soat.sessions.updateSession({
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/sessions/update-session)

### `soat.sessions.deleteSession()`

Delete a session

- Method: `DELETE`
- Path: `/api/v1/sessions/{session_id}`

```ts
await soat.sessions.deleteSession();
```

→ [Request & response schema](/docs/api/sessions/delete-session)

### `soat.sessions.addSessionMessage()`

Add a user message

- Method: `POST`
- Path: `/api/v1/sessions/{session_id}/messages`

```ts
await soat.sessions.addSessionMessage({
  body,
});
```

→ [Request & response schema](/docs/api/sessions/add-session-message)

### `soat.sessions.generateSessionResponse()`

Trigger agent generation

- Method: `POST`
- Path: `/api/v1/sessions/{session_id}/generate`

```ts
await soat.sessions.generateSessionResponse({
  query: { /* + optional */ },
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/sessions/generate-session-response)

### `soat.sessions.submitSessionToolOutputs()`

Submit tool outputs

- Method: `POST`
- Path: `/api/v1/sessions/{session_id}/tool-outputs`

```ts
await soat.sessions.submitSessionToolOutputs({
  body: { generation_id, tool_outputs },
});
```

→ [Request & response schema](/docs/api/sessions/submit-session-tool-outputs)

### `soat.sessions.forkSession()`

Fork a session

- Method: `POST`
- Path: `/api/v1/sessions/{session_id}/fork`

```ts
await soat.sessions.forkSession({
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/sessions/fork-session)

### `soat.sessions.listSessionForks()`

List a session's forks

- Method: `GET`
- Path: `/api/v1/sessions/{session_id}/forks`

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

→ [Request & response schema](/docs/api/sessions/list-session-forks)

### `soat.sessions.getSessionTags()`

Get session tags

- Method: `GET`
- Path: `/api/v1/sessions/{session_id}/tags`

```ts
await soat.sessions.getSessionTags();
```

→ [Request & response schema](/docs/api/sessions/get-session-tags)

### `soat.sessions.replaceSessionTags()`

Replace session tags

- Method: `PUT`
- Path: `/api/v1/sessions/{session_id}/tags`

```ts
await soat.sessions.replaceSessionTags({
  body,
});
```

→ [Request & response schema](/docs/api/sessions/replace-session-tags)

### `soat.sessions.mergeSessionTags()`

Merge session tags

- Method: `PATCH`
- Path: `/api/v1/sessions/{session_id}/tags`

```ts
await soat.sessions.mergeSessionTags({
  body,
});
```

→ [Request & response schema](/docs/api/sessions/merge-session-tags)
