Execute browser action
Executes a browser action on the session. Returns 200 if completed within wait_seconds, 202 if still in-flight.
Action types: navigate, observe, click, fill, select, press, scroll, wait_for, screenshot, batch.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.browserSessions.actions.create('id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.browser_sessions.actions.create(
id="id",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
action, err := client.BrowserSessions.Actions.New(
context.TODO(),
"id",
telnyx.BrowserSessionActionNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", action.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.browserSessions.actions.ActionCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionCreateParams params = ActionCreateParams.builder()
.build();
var response = client.browserSessions().actions().create("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.browser_sessions.actions.create("id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->browserSessions->actions->create(
'id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx browser-sessions:actions create \
--api-key 'My API Key' \
--id idcurl --request POST \
--url https://api.telnyx.com/v2/browser_sessions/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "navigate",
"url": "https://example.com/"
}
'{
"data": {
"id": "bact_075cfdc9-...",
"session_id": "<string>",
"seq": 123,
"type": "<string>",
"status": "queued",
"result": {
"url": "<string>",
"title": "<string>",
"observation": {
"observation_id": "<string>",
"url": "<string>",
"title": "<string>",
"refs": {},
"tree": "<string>",
"truncated": true,
"ref_count": 123
},
"artifact": {
"artifact_id": "<string>",
"content_type": "<string>",
"size_bytes": 123
},
"results": [
{}
]
},
"request": {},
"error": {
"code": "<string>",
"retryable": true
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
}{
"data": {
"id": "bact_075cfdc9-...",
"session_id": "<string>",
"seq": 123,
"type": "<string>",
"status": "queued",
"result": {
"url": "<string>",
"title": "<string>",
"observation": {
"observation_id": "<string>",
"url": "<string>",
"title": "<string>",
"refs": {},
"tree": "<string>",
"truncated": true,
"ref_count": 123
},
"artifact": {
"artifact_id": "<string>",
"content_type": "<string>",
"size_bytes": 123
},
"results": [
{}
]
},
"request": {},
"error": {
"code": "<string>",
"retryable": true
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "validation_error",
"message": "invalid request: policy.allowed_domains must have at least 1 item(s)",
"retryable": false
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not find any usable credentials in the request.",
"source": {
"pointer": "/"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"error": {
"code": "not_found",
"message": "session not found",
"retryable": false
}
}{
"error": {
"code": "session_not_ready",
"message": "session is provisioning",
"retryable": true
}
}{
"error": {
"code": "execution_lost",
"message": "Request could not be completed reliably",
"retryable": true
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Maximum seconds the submission request waits for completion, not an execution timeout. If still queued or running, returns 202 without cancelling execution; poll the returned action ID.
0 <= x <= 25Body
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
Discriminated union on type. Variants are strict: unknown fields are rejected with 400. Reusing an idempotency_key with an identical request replays the original resource; with a different request it returns 409 idempotency_conflict.
Response
Terminal action: succeeded, failed, or unknown. Inspect data.status and data.error; HTTP 200 does not imply successful execution.
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.browserSessions.actions.create('id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.browser_sessions.actions.create(
id="id",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
action, err := client.BrowserSessions.Actions.New(
context.TODO(),
"id",
telnyx.BrowserSessionActionNewParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", action.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.browserSessions.actions.ActionCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionCreateParams params = ActionCreateParams.builder()
.build();
var response = client.browserSessions().actions().create("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.browser_sessions.actions.create("id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->browserSessions->actions->create(
'id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx browser-sessions:actions create \
--api-key 'My API Key' \
--id idcurl --request POST \
--url https://api.telnyx.com/v2/browser_sessions/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "navigate",
"url": "https://example.com/"
}
'{
"data": {
"id": "bact_075cfdc9-...",
"session_id": "<string>",
"seq": 123,
"type": "<string>",
"status": "queued",
"result": {
"url": "<string>",
"title": "<string>",
"observation": {
"observation_id": "<string>",
"url": "<string>",
"title": "<string>",
"refs": {},
"tree": "<string>",
"truncated": true,
"ref_count": 123
},
"artifact": {
"artifact_id": "<string>",
"content_type": "<string>",
"size_bytes": 123
},
"results": [
{}
]
},
"request": {},
"error": {
"code": "<string>",
"retryable": true
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
}{
"data": {
"id": "bact_075cfdc9-...",
"session_id": "<string>",
"seq": 123,
"type": "<string>",
"status": "queued",
"result": {
"url": "<string>",
"title": "<string>",
"observation": {
"observation_id": "<string>",
"url": "<string>",
"title": "<string>",
"refs": {},
"tree": "<string>",
"truncated": true,
"ref_count": 123
},
"artifact": {
"artifact_id": "<string>",
"content_type": "<string>",
"size_bytes": 123
},
"results": [
{}
]
},
"request": {},
"error": {
"code": "<string>",
"retryable": true
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "validation_error",
"message": "invalid request: policy.allowed_domains must have at least 1 item(s)",
"retryable": false
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not find any usable credentials in the request.",
"source": {
"pointer": "/"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"error": {
"code": "not_found",
"message": "session not found",
"retryable": false
}
}{
"error": {
"code": "session_not_ready",
"message": "session is provisioning",
"retryable": true
}
}{
"error": {
"code": "execution_lost",
"message": "Request could not be completed reliably",
"retryable": true
}
}