Skip to content
Start here

List sessions.

client.BrowserRendering.Devtools.Session.List(ctx, params) (*[]DevtoolSessionListResponse, error)
GET/accounts/{account_id}/browser-rendering/devtools/session

List active browser sessions.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Browser Rendering WriteBrowser Rendering Read
ParametersExpand Collapse
params DevtoolSessionListParams
AccountID param.Field[string]

Path param: Account ID.

Limit param.Field[float64]Optional

Query param

maximum200
minimum1
Offset param.Field[float64]Optional

Query param

minimum0
ReturnsExpand Collapse
type DevtoolSessionListResponse []DevtoolSessionListResponse
SessionID string

Session ID.

formatuuid
CloseReason stringOptional

Reason for session closure.

CloseReasonText stringOptional

Human-readable close reason.

ConnectionEndTime float64Optional

Connection end time.

ConnectionID stringOptional

Connection ID.

ConnectionStartTime float64Optional

Connection start time.

DevtoolsFrontendURL stringOptional

DevTools frontend URL.

EndTime float64Optional

Session end time.

LastUpdated float64Optional

Last updated timestamp.

StartTime float64Optional

Session start time.

WebSocketDebuggerURL stringOptional

WebSocket URL for debugging this target.

List sessions.

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/browser_rendering"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  sessions, err := client.BrowserRendering.Devtools.Session.List(context.TODO(), browser_rendering.DevtoolSessionListParams{
    AccountID: cloudflare.F("account_id"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", sessions)
}
[
  {
    "sessionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "closeReason": "closeReason",
    "closeReasonText": "closeReasonText",
    "connectionEndTime": 0,
    "connectionId": "connectionId",
    "connectionStartTime": 0,
    "devtoolsFrontendUrl": "devtoolsFrontendUrl",
    "endTime": 0,
    "lastUpdated": 0,
    "startTime": 0,
    "webSocketDebuggerUrl": "webSocketDebuggerUrl"
  }
]
Returns Examples
[
  {
    "sessionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "closeReason": "closeReason",
    "closeReasonText": "closeReasonText",
    "connectionEndTime": 0,
    "connectionId": "connectionId",
    "connectionStartTime": 0,
    "devtoolsFrontendUrl": "devtoolsFrontendUrl",
    "endTime": 0,
    "lastUpdated": 0,
    "startTime": 0,
    "webSocketDebuggerUrl": "webSocketDebuggerUrl"
  }
]