Skip to main content
PATCH
/
proxies
/
{id}
JavaScript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});

const proxy = await client.proxies.update('id', { name: 'my-renamed-proxy' });

console.log(proxy.id);
import os
from kernel import Kernel

client = Kernel(
api_key=os.environ.get("KERNEL_API_KEY"), # This is the default and can be omitted
)
proxy = client.proxies.update(
id="id",
name="my-renamed-proxy",
)
print(proxy.id)
package main

import (
"context"
"fmt"

"github.com/kernel/kernel-go-sdk"
"github.com/kernel/kernel-go-sdk/option"
)

func main() {
client := kernel.NewClient(
option.WithAPIKey("My API Key"),
)
proxy, err := client.Proxies.Update(
context.TODO(),
"id",
kernel.ProxyUpdateParams{
Name: "my-renamed-proxy",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", proxy.ID)
}
curl --request PATCH \
--url https://api.onkernel.com/proxies/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-renamed-proxy"
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onkernel.com/proxies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'my-renamed-proxy'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.patch("https://api.onkernel.com/proxies/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-renamed-proxy\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.onkernel.com/proxies/{id}")

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 = "{\n \"name\": \"my-renamed-proxy\"\n}"

response = http.request(request)
puts response.read_body
{
  "country": "US",
  "id": "<string>",
  "name": "<string>",
  "protocol": "https",
  "bypass_hosts": [
    "<string>"
  ],
  "last_checked": "2023-11-07T05:31:56Z",
  "ip_address": "192.168.1.1",
  "config": {
    "country": "US"
  }
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}
{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json
name
string
required

New proxy name. Proxy names are trimmed and length-checked only; duplicates are allowed because proxies are updated by ID, not by name.

Required string length: 1 - 255
Example:

"my-renamed-proxy"

Response

Proxy updated

Configuration for routing traffic through a proxy.

type
enum<string>
required

Proxy type to use. In terms of quality for avoiding bot-detection, from best to worst: mobile > residential > isp > datacenter.

Available options:
datacenter,
isp,
residential,
mobile,
custom
country
string

ISO 3166 country code. Defaults to US if not provided.

Example:

"US"

id
string
name
string

Readable name of the proxy.

protocol
enum<string>
default:https

Protocol to use for the proxy connection.

Available options:
http,
https
bypass_hosts
string[]

Hostnames that should bypass the parent proxy and connect directly.

status
enum<string>

Current health status of the proxy.

Available options:
available,
unavailable
last_checked
string<date-time>

Timestamp of the last health check performed on this proxy.

ip_address
string

IP address that the proxy uses when making requests.

Example:

"192.168.1.1"

config
Datacenter · object

Configuration specific to the selected proxy type.