Update Account
curl --request PATCH \
--url https://api.openxswitch.com/v2/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"name": "Sandbox Account"
}
'import requests
url = "https://api.openxswitch.com/v2/accounts"
payload = {
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"name": "Sandbox Account"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '123e4567-e89b-12d3-a456-426614174000', name: 'Sandbox Account'})
};
fetch('https://api.openxswitch.com/v2/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openxswitch.com/v2/accounts",
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([
'accountId' => '123e4567-e89b-12d3-a456-426614174000',
'name' => 'Sandbox Account'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openxswitch.com/v2/accounts"
payload := strings.NewReader("{\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Sandbox Account\"\n}")
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(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.openxswitch.com/v2/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Sandbox Account\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/accounts")
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 \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Sandbox Account\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "47900010-7a2f-487e-9d38-3fd790fc13dc",
"name": "OX App",
"type": "SETTLEMENT",
"state": "LIVE",
"network": "mainnet",
"evmDetails": {
"address": "0x1234567890123456789012345678901234567890",
"refId": "d34e1fa1-5313-4909-a707-a6c8c2bc9578"
},
"solanaDetails": {
"address": "0x1234567890123456789012345678901234567890",
"refId": "d34e1fa1-5313-4909-a707-a6c8c2bc9578"
},
"workspaceId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"createdAt": "2025-04-02T17:20:42.160Z",
"updatedAt": "2025-04-02T17:20:42.160Z"
}
}{
"statusCode": 400,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}{
"statusCode": 404,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "Cannot GET /v1/..."
}{
"statusCode": 422,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": [
"param is required"
]
}{
"statusCode": 500,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}Accounts
Update Account
Update settings of an existing account.
PATCH
/
v2
/
accounts
Update Account
curl --request PATCH \
--url https://api.openxswitch.com/v2/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"name": "Sandbox Account"
}
'import requests
url = "https://api.openxswitch.com/v2/accounts"
payload = {
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"name": "Sandbox Account"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '123e4567-e89b-12d3-a456-426614174000', name: 'Sandbox Account'})
};
fetch('https://api.openxswitch.com/v2/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openxswitch.com/v2/accounts",
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([
'accountId' => '123e4567-e89b-12d3-a456-426614174000',
'name' => 'Sandbox Account'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openxswitch.com/v2/accounts"
payload := strings.NewReader("{\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Sandbox Account\"\n}")
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(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.openxswitch.com/v2/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Sandbox Account\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/accounts")
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 \"accountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"name\": \"Sandbox Account\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "47900010-7a2f-487e-9d38-3fd790fc13dc",
"name": "OX App",
"type": "SETTLEMENT",
"state": "LIVE",
"network": "mainnet",
"evmDetails": {
"address": "0x1234567890123456789012345678901234567890",
"refId": "d34e1fa1-5313-4909-a707-a6c8c2bc9578"
},
"solanaDetails": {
"address": "0x1234567890123456789012345678901234567890",
"refId": "d34e1fa1-5313-4909-a707-a6c8c2bc9578"
},
"workspaceId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"createdAt": "2025-04-02T17:20:42.160Z",
"updatedAt": "2025-04-02T17:20:42.160Z"
}
}{
"statusCode": 400,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}{
"statusCode": 404,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "Cannot GET /v1/..."
}{
"statusCode": 422,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": [
"param is required"
]
}{
"statusCode": 500,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)