Share via


Browser Sessions - Get

Get a browser session for the specified session and workspace ID. Requires Bearer JWT access token provided by Entra ID.

GET {endpoint}/playwrightworkspaces/{workspaceId}/browser-sessions/{sessionId}?api-version=2026-04-01-preview

URI Parameters

Name In Required Type Description
endpoint
path True

string (uri)

Playwright Service API endpoint (protocol and hostname) formatted as https://{region}.api.playwright.microsoft.com. The region corresponds to your Azure Playwright workspace location. You can find this value in your Azure Playwright workspace properties under dataplaneUri.

sessionId
path True

string

minLength: 3
maxLength: 36
pattern: [A-Za-z0-9]+(-[A-Za-z0-9]+)+

The browser session ID in GUID format.

workspaceId
path True

string

minLength: 3
maxLength: 36
pattern: [A-Za-z0-9]+(-[A-Za-z0-9]+)+

The workspace ID in GUID format.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Header

Name Required Type Description
x-ms-client-request-id

string (uuid)

An opaque, globally-unique, client-generated string identifier for the request.

x-ms-useragent

string

Optional header to specify additional client information when the standard 'User-Agent' header cannot be explicitly set, such as when using Playwright Client. The value should follow the standard 'User-Agent' header format.

Responses

Name Type Description
200 OK

BrowserSession

The request has succeeded.

Headers

x-ms-client-request-id: string

Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

OAuth2Auth

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
https://playwright.microsoft.com/.default

Examples

BrowserSessions_Get

Sample request

GET {endpoint}/playwrightworkspaces/00000000-0000-0000-0000-000000000000/browser-sessions/00000000-0000-0000-0000-000000000000?api-version=2026-04-01-preview

Sample response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "displayName": "<BrowserSession_Timestamp>",
  "creatorId": "string",
  "source": {
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "PlaywrightWorkspacesTestRun"
  },
  "startTime": "2025-06-06T11:43:28.954Z",
  "endTime": "2025-06-06T11:43:28.954Z",
  "durationInMilliseconds": 0,
  "status": "Created",
  "browserType": "Chromium",
  "operatingSystem": "Windows"
}

Definitions

Name Description
Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

BrowserSession

Model of a browser session used for tracking purposes.

BrowserSessionSource

The browser session source details.

BrowserSessionSourceType

The browser session source type.

BrowserSessionStatus

The browser session status.

BrowserType

The browser type to configure for remote script execution.

OS

The operating system to configure for remote script execution.

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.

BrowserSession

Model of a browser session used for tracking purposes.

Name Type Description
browserType

BrowserType

The browser session browser type.

creatorId

string

The browser session creator's ID.

displayName

string

minLength: 1
maxLength: 200

The browser session display name.

durationInMilliseconds

integer (int64)

The browser session duration in milliseconds.

endTime

string (date-time)

The browser session end time in UTC.

id

string

minLength: 3
maxLength: 36
pattern: [A-Za-z0-9]+(-[A-Za-z0-9]+)+

The browser session ID in GUID format.

operatingSystem

OS

The browser session operating system.

source

BrowserSessionSource

The browser session source details.

startTime

string (date-time)

The browser session start time in UTC.

status

BrowserSessionStatus

The browser session status.

BrowserSessionSource

The browser session source details.

Name Type Default value Description
id

string

The browser session source ID, would be same as runId for test-runs.

type

BrowserSessionSourceType

Others

The browser session source type.

BrowserSessionSourceType

The browser session source type.

Value Description
PlaywrightWorkspacesTestRun

The browser session source is a Playwright Workspaces test run.

BrowserAutomationTool

The browser session source is a browser automation tool.

Others

The browser session source is of other types.

BrowserSessionStatus

The browser session status.

Value Description
Created

The browser session is created.

Active

The browser session is currently active.

Completed

The browser session has completed.

Failed

The browser session has failed.

BrowserType

The browser type to configure for remote script execution.

Value Description
Chromium

Chromium browser type.

Firefox

Firefox browser type.

Webkit

WebKit browser type.

OS

The operating system to configure for remote script execution.

Value Description
Linux

Linux operating system.

Windows

Windows operating system.