curl -X POST https://api.electronhub.ai/v1/auth/proxy/toggle \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"proxy_key": "ek-proxy-1234567890abcdef"}'
import httpx
response = httpx.post(
"https://api.electronhub.ai/v1/auth/proxy/toggle",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={"proxy_key": "ek-proxy-1234567890abcdef"},
)
result = response.json()
print(f"Status updated: {result['message']}")
print(f"New status: {'Active' if result['status'] else 'Inactive'}")
const response = await fetch('https://api.electronhub.ai/v1/auth/proxy/toggle', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ proxy_key: 'ek-proxy-1234567890abcdef' }),
});
const result = await response.json();
console.log(`Status updated: ${result.message}`);
console.log(`New status: ${result.status ? 'Active' : 'Inactive'}`);
{
"message": "Proxy key status updated",
"status": true
}
{
"message": "Proxy key status updated",
"status": false
}
Proxy Keys
Toggle Proxy Key Status
Enable or disable a proxy key without deleting it
POST
/
auth
/
proxy
/
toggle
curl -X POST https://api.electronhub.ai/v1/auth/proxy/toggle \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"proxy_key": "ek-proxy-1234567890abcdef"}'
import httpx
response = httpx.post(
"https://api.electronhub.ai/v1/auth/proxy/toggle",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={"proxy_key": "ek-proxy-1234567890abcdef"},
)
result = response.json()
print(f"Status updated: {result['message']}")
print(f"New status: {'Active' if result['status'] else 'Inactive'}")
const response = await fetch('https://api.electronhub.ai/v1/auth/proxy/toggle', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ proxy_key: 'ek-proxy-1234567890abcdef' }),
});
const result = await response.json();
console.log(`Status updated: ${result.message}`);
console.log(`New status: ${result.status ? 'Active' : 'Inactive'}`);
{
"message": "Proxy key status updated",
"status": true
}
{
"message": "Proxy key status updated",
"status": false
}
Identify the key with body field proxy_key. Legacy POST /v1/auth/proxy/toggle/ still works but is discouraged.
curl -X POST https://api.electronhub.ai/v1/auth/proxy/toggle \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"proxy_key": "ek-proxy-1234567890abcdef"}'
import httpx
response = httpx.post(
"https://api.electronhub.ai/v1/auth/proxy/toggle",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={"proxy_key": "ek-proxy-1234567890abcdef"},
)
result = response.json()
print(f"Status updated: {result['message']}")
print(f"New status: {'Active' if result['status'] else 'Inactive'}")
const response = await fetch('https://api.electronhub.ai/v1/auth/proxy/toggle', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ proxy_key: 'ek-proxy-1234567890abcdef' }),
});
const result = await response.json();
console.log(`Status updated: ${result.message}`);
console.log(`New status: ${result.status ? 'Active' : 'Inactive'}`);
{
"message": "Proxy key status updated",
"status": true
}
{
"message": "Proxy key status updated",
"status": false
}
Authorizations
Enter your API key (starts with 'ek-')
Body
application/json
The proxy key to look up / toggle / delete (must be one you own)
Required string length:
1 - 256Example:
"ek-proxy-1234567890abcdef"
⌘I
