Browser Profiles API Docs (#4087)

This commit is contained in:
Marc Kelechava
2025-11-25 18:29:23 -08:00
committed by GitHub
parent 0a12f4dfb8
commit 849b715aee
3 changed files with 139 additions and 0 deletions

View File

@@ -12,6 +12,16 @@ from skyvern.exceptions import (
WorkflowRunNotFound,
)
from skyvern.forge import app
from skyvern.forge.sdk.routes.code_samples import (
CREATE_BROWSER_PROFILE_CODE_SAMPLE_PYTHON,
CREATE_BROWSER_PROFILE_CODE_SAMPLE_TS,
DELETE_BROWSER_PROFILE_CODE_SAMPLE_PYTHON,
DELETE_BROWSER_PROFILE_CODE_SAMPLE_TS,
GET_BROWSER_PROFILE_CODE_SAMPLE_PYTHON,
GET_BROWSER_PROFILE_CODE_SAMPLE_TS,
GET_BROWSER_PROFILES_CODE_SAMPLE_PYTHON,
GET_BROWSER_PROFILES_CODE_SAMPLE_TS,
)
from skyvern.forge.sdk.routes.routers import base_router
from skyvern.forge.sdk.schemas.browser_profiles import (
BrowserProfile,
@@ -41,6 +51,23 @@ def _handle_duplicate_profile_name(*, organization_id: str, name: str, exc: Inte
response_model=BrowserProfile,
tags=["Browser Profiles"],
summary="Create a browser profile",
description="Create a browser profile from a persistent browser session or workflow run.",
openapi_extra={
"x-fern-sdk-method-name": "create_browser_profile",
"x-fern-examples": [
{
"code-samples": [
{"sdk": "python", "code": CREATE_BROWSER_PROFILE_CODE_SAMPLE_PYTHON},
{"sdk": "typescript", "code": CREATE_BROWSER_PROFILE_CODE_SAMPLE_TS},
]
}
],
},
responses={
200: {"description": "Successfully created browser profile"},
400: {"description": "Invalid request - missing source or source not found"},
409: {"description": "Browser profile name already exists"},
},
)
@base_router.post(
"/browser_profiles/",
@@ -84,6 +111,20 @@ async def create_browser_profile(
tags=["Browser Profiles"],
summary="List browser profiles",
description="Get all browser profiles for the organization",
openapi_extra={
"x-fern-sdk-method-name": "list_browser_profiles",
"x-fern-examples": [
{
"code-samples": [
{"sdk": "python", "code": GET_BROWSER_PROFILES_CODE_SAMPLE_PYTHON},
{"sdk": "typescript", "code": GET_BROWSER_PROFILES_CODE_SAMPLE_TS},
]
}
],
},
responses={
200: {"description": "Successfully retrieved browser profiles"},
},
)
@base_router.get(
"/browser_profiles/",
@@ -125,6 +166,17 @@ async def list_browser_profiles(
200: {"description": "Successfully retrieved browser profile"},
404: {"description": "Browser profile not found"},
},
openapi_extra={
"x-fern-sdk-method-name": "get_browser_profile",
"x-fern-examples": [
{
"code-samples": [
{"sdk": "python", "code": GET_BROWSER_PROFILE_CODE_SAMPLE_PYTHON},
{"sdk": "typescript", "code": GET_BROWSER_PROFILE_CODE_SAMPLE_TS},
]
}
],
},
)
@base_router.get(
"/browser_profiles/{profile_id}/",
@@ -178,6 +230,17 @@ async def get_browser_profile(
204: {"description": "Successfully deleted browser profile"},
404: {"description": "Browser profile not found"},
},
openapi_extra={
"x-fern-sdk-method-name": "delete_browser_profile",
"x-fern-examples": [
{
"code-samples": [
{"sdk": "python", "code": DELETE_BROWSER_PROFILE_CODE_SAMPLE_PYTHON},
{"sdk": "typescript", "code": DELETE_BROWSER_PROFILE_CODE_SAMPLE_TS},
]
}
],
},
)
@base_router.delete(
"/browser_profiles/{profile_id}/",