> For the complete documentation index, see [llms.txt](https://dev-docs.tasknet.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev-docs.tasknet.co/reference/api-reference/sessions.md).

# Sessions

## ListSessions

> Retrieves a list of all active browser sessions in your environment, including their status, VNC settings, and lease times.

```json
{"openapi":"3.0.1","info":{"title":"tasknet-api","version":"1.0.0"},"tags":[{"name":"Sessions","description":"For managing browser sessions lifecycle."}],"servers":[{"url":"https://api.tasknet.co"}],"security":[{"ApiKey":[],"ApiKeyUUID":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"schemas":{"Session":{"type":"object","required":["sessionUUID","fingerprintUUID","currentLeaseTime","driver","isVncEnabled","status","vncMode","createdAt","updatedAt"],"properties":{"sessionUUID":{"type":"string","format":"uuid"},"fingerprintUUID":{"type":"string","format":"uuid"},"currentLeaseTime":{"type":"integer","minimum":1,"maximum":60},"isVncEnabled":{"type":"boolean"},"vncPassword":{"type":"string","description":"VNC password for accessing the session"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"driver":{"$ref":"#/components/schemas/DriverType"},"status":{"$ref":"#/components/schemas/SessionStatus"},"vncMode":{"$ref":"#/components/schemas/VncMode"}}},"DriverType":{"type":"string","enum":["puppeteer","api"],"description":"Browser automation driver type"},"SessionStatus":{"type":"string","enum":["running","terminated"],"description":"The status of the session"},"VncMode":{"type":"string","enum":["rw","ro"],"description":"VNC access mode (read-write or read-only)"},"BaseError":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{}}}}},"paths":{"/{mode}/v1/sessions":{"get":{"tags":["Sessions"],"summary":"ListSessions","description":"Retrieves a list of all active browser sessions in your environment, including their status, VNC settings, and lease times.","parameters":[{"name":"mode","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List of active browser sessions","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}}}}}}}
```

## CreateSessionWithoutFingerprint

> Creates a new browser session using a specified fingerprint (OPTIONAL). Configure VNC access, lease time, and other session parameters.

```json
{"openapi":"3.0.1","info":{"title":"tasknet-api","version":"1.0.0"},"tags":[{"name":"Sessions","description":"For managing browser sessions lifecycle."}],"servers":[{"url":"https://api.tasknet.co"}],"security":[{"ApiKey":[],"ApiKeyUUID":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"schemas":{"CreateSessionRequestBody":{"type":"object","required":["leaseTime","isVncEnabled","vncMode","driver"],"properties":{"fingerprintUUID":{"type":"string","format":"uuid"},"leaseTime":{"type":"integer","minimum":1,"maximum":60,"description":"Duration of the session lease in minutes"},"isVncEnabled":{"type":"boolean","description":"Whether VNC access is enabled for this session"},"vncMode":{"$ref":"#/components/schemas/VncMode"},"driver":{"$ref":"#/components/schemas/DriverType"},"showMouse":{"type":"boolean","default":false,"description":"Whether to show mouse movements"},"isProxyEnabled":{"type":"boolean","default":false,"description":"Whether to enable proxy for this session"}}},"VncMode":{"type":"string","enum":["rw","ro"],"description":"VNC access mode (read-write or read-only)"},"DriverType":{"type":"string","enum":["puppeteer","api"],"description":"Browser automation driver type"},"Session":{"type":"object","required":["sessionUUID","fingerprintUUID","currentLeaseTime","driver","isVncEnabled","status","vncMode","createdAt","updatedAt"],"properties":{"sessionUUID":{"type":"string","format":"uuid"},"fingerprintUUID":{"type":"string","format":"uuid"},"currentLeaseTime":{"type":"integer","minimum":1,"maximum":60},"isVncEnabled":{"type":"boolean"},"vncPassword":{"type":"string","description":"VNC password for accessing the session"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"driver":{"$ref":"#/components/schemas/DriverType"},"status":{"$ref":"#/components/schemas/SessionStatus"},"vncMode":{"$ref":"#/components/schemas/VncMode"}}},"SessionStatus":{"type":"string","enum":["running","terminated"],"description":"The status of the session"},"BaseError":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{}}}}},"paths":{"/{mode}/v1/sessions":{"post":{"tags":["Sessions"],"summary":"CreateSessionWithoutFingerprint","description":"Creates a new browser session using a specified fingerprint (OPTIONAL). Configure VNC access, lease time, and other session parameters.","parameters":[{"name":"X-Fingerprint-Secret","in":"header","schema":{"type":"string"}},{"name":"X-Environment-Id","in":"header","schema":{"type":"string"}},{"name":"X-Environment-Secret","in":"header","schema":{"type":"string"}},{"name":"mode","in":"path","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequestBody"}}}},"responses":{"200":{"description":"Session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}}}}}}}
```

## GetSession

> Retrieves detailed information about a specific browser session, including its status, settings, and remaining lease time.

```json
{"openapi":"3.0.1","info":{"title":"tasknet-api","version":"1.0.0"},"tags":[{"name":"Sessions","description":"For managing browser sessions lifecycle."}],"servers":[{"url":"https://api.tasknet.co"}],"security":[{"ApiKey":[],"ApiKeyUUID":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"schemas":{"Session":{"type":"object","required":["sessionUUID","fingerprintUUID","currentLeaseTime","driver","isVncEnabled","status","vncMode","createdAt","updatedAt"],"properties":{"sessionUUID":{"type":"string","format":"uuid"},"fingerprintUUID":{"type":"string","format":"uuid"},"currentLeaseTime":{"type":"integer","minimum":1,"maximum":60},"isVncEnabled":{"type":"boolean"},"vncPassword":{"type":"string","description":"VNC password for accessing the session"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"driver":{"$ref":"#/components/schemas/DriverType"},"status":{"$ref":"#/components/schemas/SessionStatus"},"vncMode":{"$ref":"#/components/schemas/VncMode"}}},"DriverType":{"type":"string","enum":["puppeteer","api"],"description":"Browser automation driver type"},"SessionStatus":{"type":"string","enum":["running","terminated"],"description":"The status of the session"},"VncMode":{"type":"string","enum":["rw","ro"],"description":"VNC access mode (read-write or read-only)"},"BaseError":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{}}}}},"paths":{"/{mode}/v1/sessions/{sessionUUID}":{"get":{"tags":["Sessions"],"summary":"GetSession","description":"Retrieves detailed information about a specific browser session, including its status, settings, and remaining lease time.","parameters":[{"name":"mode","in":"path","schema":{"type":"string"},"required":true},{"name":"sessionUUID","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Session details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}}}}}}}
```

## EndSession

> Terminates a browser session immediately, releasing all associated resources and ending the lease.

```json
{"openapi":"3.0.1","info":{"title":"tasknet-api","version":"1.0.0"},"tags":[{"name":"Sessions","description":"For managing browser sessions lifecycle."}],"servers":[{"url":"https://api.tasknet.co"}],"security":[{"ApiKey":[],"ApiKeyUUID":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"schemas":{"BaseError":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{}}}}},"paths":{"/{mode}/v1/sessions/{sessionUUID}":{"delete":{"tags":["Sessions"],"summary":"EndSession","description":"Terminates a browser session immediately, releasing all associated resources and ending the lease.","parameters":[{"name":"mode","in":"path","schema":{"type":"string"},"required":true},{"name":"sessionUUID","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Session terminated successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}}}}}}}
```

## UpdateSession

> Updates the settings of an active browser session. Currently supports extending the lease time.

```json
{"openapi":"3.0.1","info":{"title":"tasknet-api","version":"1.0.0"},"tags":[{"name":"Sessions","description":"For managing browser sessions lifecycle."}],"servers":[{"url":"https://api.tasknet.co"}],"security":[{"ApiKey":[],"ApiKeyUUID":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"schemas":{"UpdateSessionRequestBody":{"type":"object","properties":{"newLeaseTime":{"type":"integer"}},"required":["newLeaseTime"]},"BaseError":{"type":"object","required":["message","code"],"properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{}}}}},"paths":{"/{mode}/v1/sessions/{sessionUUID}":{"patch":{"tags":["Sessions"],"summary":"UpdateSession","description":"Updates the settings of an active browser session. Currently supports extending the lease time.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSessionRequestBody"}}}},"parameters":[{"name":"mode","in":"path","schema":{"type":"string"},"required":true},{"name":"sessionUUID","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Session lease time updated successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseError"}}}}}}}}}
```
