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

# Sessions

> TypeScript SDK reference for the Sessions resource

## listSessions

`GET /v1/sessions` — List Sessions History Page

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.listSessions();
console.log(result);
```

## createSession

`POST /v1/sessions` — Start Browser Session

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.createSession();
console.log(result);
```

## createSessionAsync

`POST /v1/sessions/async` — Start Browser Session (async)

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.createSessionAsync();
console.log(result);
```

## getAsyncSessionStatus

`GET /v1/sessions/async/{request_id}/status` — Async Session Status

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getAsyncSessionStatus({
  path: {
    request_id: 'your-request-id'
  }
});
console.log(result);
```

## deleteAllSessions

`DELETE /v1/sessions/all` — End All Sessions

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.deleteAllSessions();
console.log(result);
```

## getAllSessionsStatus

`GET /v1/sessions/all/status` — List All Sessions Status

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getAllSessionsStatus();
console.log(result);
```

## getSessionsHistory

`GET /v1/sessions/history` — Get Sessions History

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getSessionsHistory();
console.log(result);
```

## getSession

`GET /v1/sessions/{session_id}` — Get Browser Session

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getSession({
  path: {
    session_id: 'your-session-id'
  }
});
console.log(result);
```

## deleteSession

`DELETE /v1/sessions/{session_id}` — End Browser Session

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.deleteSession({
  path: {
    session_id: 'your-session-id'
  }
});
console.log(result);
```

## getSessionPages

`GET /v1/sessions/{session_id}/pages` — Get Browser Session Pages

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getSessionPages({
  path: {
    session_id: 'your-session-id'
  }
});
console.log(result);
```

## uploadFile

`POST /v1/sessions/{sessionId}/uploads` — Upload Files

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.uploadFile({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    file: new File(['file content'], 'file.txt')
  }
});
console.log(result);
```

## getSessionDownloads

`GET /v1/sessions/{session_id}/downloads` — List Session Downloads

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getSessionDownloads({
  path: {
    session_id: 'your-session-id'
  }
});
console.log(result);
```

## getSessionScreenshot

`GET /v1/sessions/{sessionId}/screenshot` — Take Screenshot

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getSessionScreenshot({
  path: {
    sessionId: 'your-sessionId'
  }
});
console.log(result);
```

## mouseClick

`POST /v1/sessions/{sessionId}/mouse/click` — Mouse Click

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.mouseClick({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {}
});
console.log(result);
```

## mouseDoubleClick

`POST /v1/sessions/{sessionId}/mouse/doubleClick` — Mouse Double Click

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.mouseDoubleClick({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    x: 1,
    y: 1
  }
});
console.log(result);
```

## mouseDown

`POST /v1/sessions/{sessionId}/mouse/down` — Mouse Down

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.mouseDown({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    x: 1,
    y: 1
  }
});
console.log(result);
```

## mouseUp

`POST /v1/sessions/{sessionId}/mouse/up` — Mouse Up

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.mouseUp({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    x: 1,
    y: 1
  }
});
console.log(result);
```

## mouseMove

`POST /v1/sessions/{sessionId}/mouse/move` — Mouse Move

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.mouseMove({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    x: 1,
    y: 1
  }
});
console.log(result);
```

## dragAndDrop

`POST /v1/sessions/{sessionId}/drag-and-drop` — Drag and Drop

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.dragAndDrop({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    startX: 1,
    startY: 1,
    endX: 1,
    endY: 1
  }
});
console.log(result);
```

## scroll

`POST /v1/sessions/{sessionId}/scroll` — Scroll

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.scroll({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    x: 1,
    y: 1,
    deltaY: 1
  }
});
console.log(result);
```

## keyboardType

`POST /v1/sessions/{sessionId}/keyboard/type` — Type Text

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.keyboardType({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    text: 'string'
  }
});
console.log(result);
```

## keyboardShortcut

`POST /v1/sessions/{sessionId}/keyboard/shortcut` — Keyboard Shortcut

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.keyboardShortcut({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    keys: ['string']
  }
});
console.log(result);
```

## getClipboard

`GET /v1/sessions/{sessionId}/clipboard` — Get Clipboard Content

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.getClipboard({
  path: {
    sessionId: 'your-sessionId'
  }
});
console.log(result);
```

## setClipboard

`POST /v1/sessions/{sessionId}/clipboard` — Set Clipboard Content

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.setClipboard({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    text: 'string'
  }
});
console.log(result);
```

## copy

`POST /v1/sessions/{sessionId}/copy` — Copy Selected Text

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.copy({
  path: {
    sessionId: 'your-sessionId'
  }
});
console.log(result);
```

## paste

`POST /v1/sessions/{sessionId}/paste` — Paste Text

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.paste({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    text: 'string'
  }
});
console.log(result);
```

## goto

`POST /v1/sessions/{sessionId}/goto` — Navigate to URL

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const result = await Sessions.goto({
  path: {
    sessionId: 'your-sessionId'
  },
  body: {
    url: 'string'
  }
});
console.log(result);
```
