openapi: 3.1.0 info: title: BrowserStack Automate REST API description: | Best-effort OpenAPI 3.1 description of the BrowserStack Automate REST API for managing plans, projects, builds, sessions, browsers, devices, access keys, and media used in Selenium-based cross-browser automated testing on BrowserStack. Authentication uses HTTP Basic with your BrowserStack username and access key. version: "1.0" contact: name: BrowserStack url: https://www.browserstack.com/docs/automate/api-reference/selenium/introduction license: name: BrowserStack Terms of Service url: https://www.browserstack.com/terms servers: - url: https://api.browserstack.com description: BrowserStack Automate API base URL security: - basicAuth: [] tags: - name: Plan description: Operations describing the current Automate subscription plan and capacity. - name: Projects description: Operations on Automate projects. - name: Builds description: Operations on Automate builds. - name: Sessions description: Operations on Automate sessions. - name: Browsers description: Operations describing supported browsers and devices. - name: AccessKey description: Operations on Automate access keys. paths: /automate/plan.json: get: tags: [Plan] summary: Get plan details description: Returns details of the current Automate subscription plan including parallel session capacity and current usage. operationId: getPlan responses: "200": description: Plan details content: application/json: schema: $ref: "#/components/schemas/Plan" /automate/browsers.json: get: tags: [Browsers] summary: Get supported browsers and devices description: Returns the list of operating systems, browsers, and real mobile devices supported by Automate. operationId: getBrowsers responses: "200": description: List of supported browser and device configurations content: application/json: schema: type: array items: $ref: "#/components/schemas/Browser" /automate/projects.json: get: tags: [Projects] summary: List projects operationId: listProjects responses: "200": description: Array of project objects content: application/json: schema: type: array items: $ref: "#/components/schemas/Project" /automate/projects/{projectId}.json: parameters: - name: projectId in: path required: true schema: type: integer get: tags: [Projects] summary: Get project details operationId: getProject responses: "200": description: Project with associated builds content: application/json: schema: $ref: "#/components/schemas/ProjectDetail" put: tags: [Projects] summary: Update project operationId: updateProject requestBody: required: true content: application/json: schema: type: object properties: name: type: string responses: "200": description: Updated project content: application/json: schema: $ref: "#/components/schemas/Project" delete: tags: [Projects] summary: Delete project description: Deletes an Automate project. The project must be empty of builds and sessions. operationId: deleteProject responses: "200": description: Deletion confirmation content: application/json: schema: $ref: "#/components/schemas/StatusMessage" /automate/projects/{projectId}/badge_key: parameters: - name: projectId in: path required: true schema: type: integer get: tags: [Projects] summary: Get project status badge key operationId: getProjectBadgeKey responses: "200": description: Badge key string content: text/plain: schema: type: string /automate/builds.json: get: tags: [Builds] summary: List recent builds operationId: listBuilds parameters: - name: limit in: query schema: type: integer - name: offset in: query schema: type: integer - name: status in: query schema: type: string enum: [done, running, failed] responses: "200": description: Array of builds content: application/json: schema: type: array items: $ref: "#/components/schemas/Build" /automate/builds/{buildId}.json: parameters: - name: buildId in: path required: true schema: type: string put: tags: [Builds] summary: Update build operationId: updateBuild requestBody: required: true content: application/json: schema: type: object properties: name: type: string responses: "200": description: Updated build content: application/json: schema: $ref: "#/components/schemas/Build" delete: tags: [Builds] summary: Delete build operationId: deleteBuild responses: "200": description: Build deletion confirmation content: application/json: schema: $ref: "#/components/schemas/StatusMessage" /automate/builds/{buildId}/sessions.json: parameters: - name: buildId in: path required: true schema: type: string get: tags: [Sessions] summary: List sessions in a build operationId: listBuildSessions responses: "200": description: Array of sessions content: application/json: schema: type: array items: $ref: "#/components/schemas/Session" /automate/sessions/{sessionId}.json: parameters: - name: sessionId in: path required: true schema: type: string get: tags: [Sessions] summary: Get session details operationId: getSession responses: "200": description: Session details content: application/json: schema: $ref: "#/components/schemas/Session" put: tags: [Sessions] summary: Update session status / metadata operationId: updateSession requestBody: required: true content: application/json: schema: type: object properties: status: type: string enum: [passed, failed] reason: type: string name: type: string responses: "200": description: Updated session content: application/json: schema: $ref: "#/components/schemas/Session" delete: tags: [Sessions] summary: Delete session operationId: deleteSession responses: "200": description: Session deletion confirmation content: application/json: schema: $ref: "#/components/schemas/StatusMessage" /automate/sessions/{sessionId}/logs: parameters: - name: sessionId in: path required: true schema: type: string get: tags: [Sessions] summary: Download Selenium logs operationId: getSessionLogs responses: "200": description: Selenium log text content: text/plain: schema: type: string /automate/sessions/{sessionId}/networklogs: parameters: - name: sessionId in: path required: true schema: type: string get: tags: [Sessions] summary: Download network logs (HAR) operationId: getSessionNetworkLogs responses: "200": description: HAR file content: application/json: schema: type: object /automate/sessions/{sessionId}/consolelogs: parameters: - name: sessionId in: path required: true schema: type: string get: tags: [Sessions] summary: Download console logs operationId: getSessionConsoleLogs responses: "200": description: Console log text content: text/plain: schema: type: string /automate/recycle_key.json: put: tags: [AccessKey] summary: Recycle access key description: Generates a new access key, invalidating the old one. operationId: recycleAccessKey responses: "200": description: New access key content: application/json: schema: type: object properties: old_key: type: string new_key: type: string components: securitySchemes: basicAuth: type: http scheme: basic description: HTTP Basic auth using your BrowserStack username as username and your access key as password. schemas: Plan: type: object properties: automate_plan: type: string parallel_sessions_running: type: integer team_parallel_sessions_max_allowed: type: integer parallel_sessions_max_allowed: type: integer queued_sessions: type: integer queued_sessions_max_allowed: type: integer Browser: type: object properties: os: type: string os_version: type: string browser: type: string device: type: [string, "null"] browser_version: type: [string, "null"] real_mobile: type: boolean Project: type: object properties: id: type: integer name: type: string group_id: type: integer user_id: type: integer created_at: type: string format: date-time updated_at: type: string format: date-time sub_group_id: type: [integer, "null"] ProjectDetail: allOf: - $ref: "#/components/schemas/Project" - type: object properties: builds: type: array items: $ref: "#/components/schemas/Build" Build: type: object properties: hashed_id: type: string name: type: string duration: type: integer status: type: string tags: type: array items: type: string group_id: type: integer user_id: type: integer automation_project_id: type: integer created_at: type: string format: date-time updated_at: type: string format: date-time Session: type: object properties: hashed_id: type: string name: type: string duration: type: integer os: type: string os_version: type: string browser_version: type: string browser: type: string device: type: [string, "null"] status: type: string reason: type: [string, "null"] build_name: type: string project_name: type: string logs: type: string browser_url: type: string public_url: type: string appium_logs_url: type: string video_url: type: string browser_console_logs_url: type: string har_logs_url: type: string selenium_logs_url: type: string created_at: type: string format: date-time updated_at: type: string format: date-time StatusMessage: type: object properties: status: type: string message: type: string