> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# Update Runtime

PATCH https://api.bctrl.ai/v1/runtimes/{runtimeId}
Content-Type: application/json

Update a runtime: name and idleTimeoutMinutes any time, launch config only while the runtime is stopped.

Reference: https://platform.bctrl.ai/api/api-reference/runtimes/update

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: bctrl API
  version: 1.0.0
paths:
  /v1/runtimes/{runtimeId}:
    patch:
      operationId: update
      summary: Update a runtime
      description: >-
        Update a runtime: name and idleTimeoutMinutes any time, launch config
        only while the runtime is stopped.
      tags:
        - subpackage_runtimes
      parameters:
        - name: runtimeId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Use Bearer <api-key>.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuntimeDetail'
        '401':
          description: 'Authentication required: the API key is missing or invalid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: 'Forbidden: the API key cannot access this resource.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The requested resource was not found. Example code:
            `runtime.not_found`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded. Retry after the delay indicated by Retry-After.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuntimeUpdateRequest'
servers:
  - url: https://api.bctrl.ai
    description: Production
  - url: http://localhost:8787
    description: Local development gateway
components:
  schemas:
    BrowserRuntimeCreateConfigFingerprintBrowser:
      type: string
      enum:
        - chrome
        - edge
      title: BrowserRuntimeCreateConfigFingerprintBrowser
    BrowserRuntimeCreateConfigFingerprintLocale:
      type: string
      enum:
        - en-US
        - en-GB
        - de-DE
        - fr-FR
        - es-ES
        - es-MX
        - it-IT
        - nl-NL
        - pt-BR
        - pt-PT
        - pl-PL
        - tr-TR
        - sv-SE
        - da-DK
        - nb-NO
        - fi-FI
        - ja-JP
        - ko-KR
        - zh-CN
        - zh-TW
      title: BrowserRuntimeCreateConfigFingerprintLocale
    BrowserRuntimeCreateConfigFingerprint:
      type: object
      properties:
        browser:
          $ref: '#/components/schemas/BrowserRuntimeCreateConfigFingerprintBrowser'
        locale:
          $ref: '#/components/schemas/BrowserRuntimeCreateConfigFingerprintLocale'
      title: BrowserRuntimeCreateConfigFingerprint
    BrowserRuntimeCreateConfigNetworkTrafficBlockResourceTypesItems:
      type: string
      enum:
        - media
        - texttrack
        - font
        - image
        - ping
        - prefetch
        - beacon
      title: BrowserRuntimeCreateConfigNetworkTrafficBlockResourceTypesItems
    BrowserRuntimeCreateConfigNetworkTrafficSaver:
      type: string
      enum:
        - none
        - light
        - medium
        - high
      title: BrowserRuntimeCreateConfigNetworkTrafficSaver
    BrowserRuntimeCreateConfigNetworkTraffic:
      type: object
      properties:
        blockAds:
          type: boolean
        blockResourceTypes:
          type: array
          items:
            $ref: >-
              #/components/schemas/BrowserRuntimeCreateConfigNetworkTrafficBlockResourceTypesItems
        blockTrackers:
          type: boolean
        saver:
          $ref: '#/components/schemas/BrowserRuntimeCreateConfigNetworkTrafficSaver'
        urlAllowlist:
          type: array
          items:
            type: string
        urlBlocklist:
          type: array
          items:
            type: string
      title: BrowserRuntimeCreateConfigNetworkTraffic
    CustomProxyInputDnsResolution:
      type: string
      enum:
        - local
        - proxy
      title: CustomProxyInputDnsResolution
    CustomProxyInputProtocol:
      type: string
      enum:
        - http
        - socks5
      title: CustomProxyInputProtocol
    SavedProxyReferenceOverridesAffinity:
      oneOf:
        - type: object
          properties:
            strategy:
              type: string
              enum:
                - rotate
              description: 'Discriminator value: rotate'
          required:
            - strategy
          description: rotate variant
        - type: object
          properties:
            strategy:
              type: string
              enum:
                - sticky
              description: 'Discriminator value: sticky'
            key:
              type: string
          required:
            - strategy
          description: sticky variant
      discriminator:
        propertyName: strategy
      title: SavedProxyReferenceOverridesAffinity
    SavedProxyReferenceOverridesDevice:
      type: string
      enum:
        - windows
        - macos
        - linux
        - android
        - ios
      title: SavedProxyReferenceOverridesDevice
    SavedProxyReferenceOverridesDnsResolution:
      type: string
      enum:
        - local
        - proxy
      title: SavedProxyReferenceOverridesDnsResolution
    SavedProxyReferenceOverridesGeo:
      type: object
      properties:
        city:
          type: string
        country:
          type: string
        isp:
          type: string
        region:
          type: string
        state:
          type: string
      title: SavedProxyReferenceOverridesGeo
    SavedProxyReferenceOverridesIpFamily:
      type: string
      enum:
        - dual-stack
        - ipv4-only
      title: SavedProxyReferenceOverridesIpFamily
    SavedProxyReferenceOverridesPoolPreference:
      type: string
      enum:
        - quality
        - quality-speed
        - speed
        - max-pool
      title: SavedProxyReferenceOverridesPoolPreference
    SavedProxyReferenceOverridesPreference:
      type: string
      enum:
        - balanced
        - speed
        - quality
        - coverage
      title: SavedProxyReferenceOverridesPreference
    SavedProxyReferenceOverridesProtocol:
      type: string
      enum:
        - http
        - socks5
      title: SavedProxyReferenceOverridesProtocol
    SavedProxyReferenceOverrides:
      type: object
      properties:
        affinity:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesAffinity'
        device:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesDevice'
        deviceStrict:
          type: boolean
        dnsResolution:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesDnsResolution'
        geo:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesGeo'
        geoStrict:
          type: boolean
        ipFamily:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesIpFamily'
        poolPreference:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesPoolPreference'
        preference:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesPreference'
        protocol:
          $ref: '#/components/schemas/SavedProxyReferenceOverridesProtocol'
      title: SavedProxyReferenceOverrides
    BrowserRuntimeCreateConfigProxy:
      oneOf:
        - type: object
          properties:
            mode:
              type: string
              enum:
                - custom
            dnsResolution:
              $ref: '#/components/schemas/CustomProxyInputDnsResolution'
            host:
              type: string
            password:
              type: string
            port:
              type: integer
            protocol:
              $ref: '#/components/schemas/CustomProxyInputProtocol'
            username:
              type: string
          required:
            - mode
            - host
            - port
            - protocol
          description: custom variant
        - type: object
          properties:
            mode:
              type: string
              enum:
                - saved
            id:
              type: string
              format: uuid
            overrides:
              $ref: '#/components/schemas/SavedProxyReferenceOverrides'
          required:
            - mode
            - id
          description: saved variant
      discriminator:
        propertyName: mode
      title: BrowserRuntimeCreateConfigProxy
    BrowserRuntimeCreateConfigStealth:
      type: string
      enum:
        - medium
        - high
        - ultra
      title: BrowserRuntimeCreateConfigStealth
    BrowserRuntimeCreateConfig:
      type: object
      properties:
        autoUpgrade:
          type: boolean
        extensionIds:
          type: array
          items:
            type: string
        fingerprint:
          $ref: '#/components/schemas/BrowserRuntimeCreateConfigFingerprint'
        forceOpenShadowRoots:
          type: boolean
        idleTimeoutMinutes:
          type: integer
        networkTraffic:
          $ref: '#/components/schemas/BrowserRuntimeCreateConfigNetworkTraffic'
        profile:
          type: boolean
        proxy:
          oneOf:
            - $ref: '#/components/schemas/BrowserRuntimeCreateConfigProxy'
            - type: 'null'
        stealth:
          $ref: '#/components/schemas/BrowserRuntimeCreateConfigStealth'
        webRtcProxyOnly:
          type: boolean
      title: BrowserRuntimeCreateConfig
    RuntimeUpdateRequest:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/BrowserRuntimeCreateConfig'
        idleTimeoutMinutes:
          type: integer
        name:
          type: string
      title: RuntimeUpdateRequest
    RuntimeFingerprintViewport:
      type: object
      properties:
        height:
          type: integer
        width:
          type: integer
      required:
        - height
        - width
      title: RuntimeFingerprintViewport
    RuntimeFingerprint:
      type: object
      properties:
        browser:
          type: string
        locale:
          type: string
        timezone:
          type: string
        userAgent:
          type: string
        viewport:
          $ref: '#/components/schemas/RuntimeFingerprintViewport'
      title: RuntimeFingerprint
    BrowserRuntimeConfigNetworkTrafficBlockResourceTypesItems:
      type: string
      enum:
        - media
        - texttrack
        - font
        - image
        - ping
        - prefetch
        - beacon
      title: BrowserRuntimeConfigNetworkTrafficBlockResourceTypesItems
    BrowserRuntimeConfigNetworkTrafficSaver:
      type: string
      enum:
        - none
        - light
        - medium
        - high
      title: BrowserRuntimeConfigNetworkTrafficSaver
    BrowserRuntimeConfigNetworkTraffic:
      type: object
      properties:
        blockAds:
          type: boolean
        blockResourceTypes:
          type: array
          items:
            $ref: >-
              #/components/schemas/BrowserRuntimeConfigNetworkTrafficBlockResourceTypesItems
        blockTrackers:
          type: boolean
        saver:
          $ref: '#/components/schemas/BrowserRuntimeConfigNetworkTrafficSaver'
        urlAllowlist:
          type: array
          items:
            type: string
        urlBlocklist:
          type: array
          items:
            type: string
      title: BrowserRuntimeConfigNetworkTraffic
    BrowserRuntimeConfigProxyType:
      type: string
      enum:
        - custom
        - managed-rotating
        - managed-static
      title: BrowserRuntimeConfigProxyType
    BrowserRuntimeConfigProxy:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          $ref: '#/components/schemas/BrowserRuntimeConfigProxyType'
      required:
        - id
        - name
        - type
      title: BrowserRuntimeConfigProxy
    BrowserRuntimeConfigStealth:
      type: string
      enum:
        - medium
        - high
        - ultra
      title: BrowserRuntimeConfigStealth
    BrowserRuntimeConfig:
      type: object
      properties:
        autoUpgrade:
          type: boolean
        extensionIds:
          type: array
          items:
            type: string
        fingerprint:
          $ref: '#/components/schemas/RuntimeFingerprint'
        forceOpenShadowRoots:
          type: boolean
        idleTimeoutMinutes:
          type: integer
        networkTraffic:
          $ref: '#/components/schemas/BrowserRuntimeConfigNetworkTraffic'
        profile:
          type: boolean
        proxy:
          oneOf:
            - $ref: '#/components/schemas/BrowserRuntimeConfigProxy'
            - type: 'null'
        stealth:
          $ref: '#/components/schemas/BrowserRuntimeConfigStealth'
        webRtcProxyOnly:
          type: boolean
      required:
        - profile
      title: BrowserRuntimeConfig
    RuntimeDetailMetadata:
      type: object
      properties: {}
      title: RuntimeDetailMetadata
    RuntimeDetailProtocol:
      type: string
      enum:
        - cdp
      title: RuntimeDetailProtocol
    RuntimeDetailStatus:
      type: string
      enum:
        - active
        - stopped
        - failed
      title: RuntimeDetailStatus
    RuntimeDetail:
      type: object
      properties:
        activeRunId:
          type:
            - string
            - 'null'
          format: uuid
        config:
          $ref: '#/components/schemas/BrowserRuntimeConfig'
        connectUrl:
          type: string
          format: uri
        createdAt:
          type: string
          format: date-time
        id:
          type: string
          format: uuid
        lastActivityAt:
          type: string
          format: date-time
        metadata:
          oneOf:
            - $ref: '#/components/schemas/RuntimeDetailMetadata'
            - type: 'null'
        name:
          type: string
        protocol:
          $ref: '#/components/schemas/RuntimeDetailProtocol'
        spaceId:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/RuntimeDetailStatus'
        type:
          type: string
          enum:
            - browser
        updatedAt:
          type: string
          format: date-time
      required:
        - activeRunId
        - createdAt
        - id
        - name
        - spaceId
        - status
        - type
        - updatedAt
      title: RuntimeDetail
    ErrorResponseReasonClass:
      type: string
      enum:
        - invalid_input
        - unauthorized
        - capability_denied
        - capability_limit_exceeded
        - rate_limited
        - not_found
        - conflict
        - upstream
        - server
      description: Stable public error category for programmatic branching.
      title: ErrorResponseReasonClass
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: >-
            Stable, dot-namespaced error code, e.g. "runtime.not_found" or
            "request.invalid".
        details:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            Resource-specific structured context. Use `code` and `reasonClass`
            for branching.
        error:
          type: string
        hint:
          type: string
          description: Optional next action for recoverable errors, e.g. "retry after 2s".
        reasonClass:
          $ref: '#/components/schemas/ErrorResponseReasonClass'
          description: Stable public error category for programmatic branching.
        requestId:
          type: string
      required:
        - code
        - error
      title: ErrorResponse
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use Bearer <api-key>.

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "activeRunId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "createdAt": "2024-01-15T09:30:00Z",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Marketing Browser Runtime",
  "spaceId": "7e57d004-2b97-0e7a-b45f-5387367791cd",
  "status": "active",
  "type": "browser",
  "updatedAt": "2024-04-20T16:45:00Z",
  "config": {
    "profile": true,
    "autoUpgrade": true,
    "extensionIds": [
      "ext_adblocker123"
    ],
    "fingerprint": {
      "browser": "chrome",
      "locale": "en-US",
      "timezone": "America/New_York",
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
      "viewport": {
        "height": 1080,
        "width": 1920
      }
    },
    "forceOpenShadowRoots": false,
    "idleTimeoutMinutes": 15,
    "networkTraffic": {
      "blockAds": true,
      "blockResourceTypes": [
        "media",
        "image"
      ],
      "blockTrackers": true,
      "saver": "medium",
      "urlAllowlist": [
        "https://trustedsite.com"
      ],
      "urlBlocklist": [
        "https://malicioussite.com"
      ]
    },
    "proxy": {
      "id": "proxy-12345",
      "name": "Corporate Proxy",
      "type": "custom"
    },
    "stealth": "high",
    "webRtcProxyOnly": false
  },
  "connectUrl": "wss://runtime.bctrl.ai/connect/3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "lastActivityAt": "2024-04-20T16:45:00Z",
  "metadata": {},
  "protocol": "cdp"
}
```

**SDK Code**

```python
import requests

url = "https://api.bctrl.ai/v1/runtimes/runtimeId"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.bctrl.ai/v1/runtimes/runtimeId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bctrl.ai/v1/runtimes/runtimeId"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.bctrl.ai/v1/runtimes/runtimeId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.bctrl.ai/v1/runtimes/runtimeId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.bctrl.ai/v1/runtimes/runtimeId', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.bctrl.ai/v1/runtimes/runtimeId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bctrl.ai/v1/runtimes/runtimeId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```