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

# SessionsClient

## Constructor

```typescript
SessionsClient(options: BaseClientOptions): SessionsClient
```

### Parameters

**options** `BaseClientOptions` *required*

### Returns

`SessionsClient`

## Methods

### appendSessionTags()

```typescript
appendSessionTags(request: AppendSessionTagsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionTagsResponse>
```

Append tags to a session (deduplicating with existing tags).

```ts
await client.sessions.appendSessionTags({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456",
        body: {
            tags: ["tags"]
        }
    })
```

#### Parameters

**request** `AppendSessionTagsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionTagsResponse>`

### archiveSession()

```typescript
archiveSession(request: ArchiveSessionSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionResponse>
```

Archive session and put it to sleep if currently running

```ts
await client.sessions.archiveSession({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `ArchiveSessionSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionResponse>`

### createSession()

```typescript
createSession(request: SessionCreateRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionResponse>
```

Create a new session

```ts
await client.sessions.createSession({
        org_id: "org-abc123def456",
        prompt: "prompt"
    })
```

#### Parameters

**request** `SessionCreateRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionResponse>`

### generateSessionInsights()

```typescript
generateSessionInsights(request: GenerateSessionInsightsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionInsightsGenerateResponse>
```

Trigger on-demand generation of session insights.

Returns `already_exists` if insights have already been generated.
Otherwise kicks off generation in the background. Poll the
GET insights endpoint to retrieve results once generation completes.

```ts
await client.sessions.generateSessionInsights({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `GenerateSessionInsightsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionInsightsGenerateResponse>`

### getSession()

```typescript
getSession(request: GetSessionSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionResponse>
```

Get details of a specific session.

```ts
await client.sessions.getSession({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `GetSessionSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionResponse>`

### getSessionAttachments()

```typescript
getSessionAttachments(request: GetSessionAttachmentsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionAttachment[]>
```

List all attachments for a session.

```ts
await client.sessions.getSessionAttachments({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `GetSessionAttachmentsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionAttachment[]>`

### getSessionInsights()

```typescript
getSessionInsights(request: GetSessionInsightsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionInsightsResponse>
```

Get detailed insights for a specific session, including message counts,
session size classification, and AI-generated analysis.

```ts
await client.sessions.getSessionInsights({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `GetSessionInsightsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionInsightsResponse>`

### getSessionMessages()

```typescript
getSessionMessages(request: GetSessionMessagesSessionsRequest, requestOptions?: RequestOptions): Promise<Page<SessionMessage, PaginatedResponseSessionMessage>>
```

List all messages for a session with cursor-based pagination, ordered chronologically.

```ts
await client.sessions.getSessionMessages({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `GetSessionMessagesSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`Promise<Page<SessionMessage, PaginatedResponseSessionMessage>>`

### getSessions()

```typescript
getSessions(request: GetSessionsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<PaginatedResponseSessionResponse>
```

List sessions.

```ts
await client.sessions.getSessions({
        org_id: "org_id",
        qs: {}
    })
```

#### Parameters

**request** `GetSessionsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<PaginatedResponseSessionResponse>`

### getSessionsInsights()

```typescript
getSessionsInsights(request: GetSessionsInsightsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<PaginatedResponseSessionInsightsResponse>
```

List sessions with detailed insights including message counts,
session size classification, and AI-generated analysis.

```ts
await client.sessions.getSessionsInsights({
        org_id: "org_id",
        qs: {}
    })
```

#### Parameters

**request** `GetSessionsInsightsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<PaginatedResponseSessionInsightsResponse>`

### getSessionTags()

```typescript
getSessionTags(request: GetSessionTagsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionTagsResponse>
```

Get the tags for a specific session.

```ts
await client.sessions.getSessionTags({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `GetSessionTagsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionTagsResponse>`

### postMessage()

```typescript
postMessage(request: PostMessageSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionResponse>
```

Send a message to an active session. The session will be automatically resumed if suspended.

```ts
await client.sessions.postMessage({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456",
        body: {
            message: "message"
        }
    })
```

#### Parameters

**request** `PostMessageSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionResponse>`

### replaceSessionTags()

```typescript
replaceSessionTags(request: ReplaceSessionTagsSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionTagsResponse>
```

Replace all tags on a session.

```ts
await client.sessions.replaceSessionTags({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456",
        body: {
            tags: ["tags"]
        }
    })
```

#### Parameters

**request** `ReplaceSessionTagsSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionTagsResponse>`

### terminateSession()

```typescript
terminateSession(request: TerminateSessionSessionsRequest, requestOptions?: RequestOptions): HttpResponsePromise<SessionResponse>
```

Terminate session

```ts
await client.sessions.terminateSession({
        org_id: "org-abc123def456",
        devin_id: "devin-abc123def456"
    })
```

#### Parameters

**request** `TerminateSessionSessionsRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<SessionResponse>`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.