Before you start
- A FalconProxy account with at least one proxy. If you have none yet, follow the setup guide.
- The owner or admin role in your workspace. API keys are an owner and admin capability.
- The base address,
https://falconproxy.com/api/v1. Every call is HTTPS and every answer is JSON.
Create an API key
Open the key page
In the dashboard, open Settings, then API Keys, and choose New key.
Name it and choose its scopes
A scope is a permission. Give the key only the scopes it needs. To follow this guide, choose
proxies:read,proxies:writeandproxies:rotate. Adddevices:controlif you also want to change a phone’s network mode.Copy the key now
The key starts with
fpk_live_and is shown only once. Copy it into a secret manager or an environment variable. If you lose it, create a new one and revoke the old one.
New key
Name
Reporting script
Scopes
- proxies:readSee proxies and their status
- proxies:writeSwitch a proxy on or off
- proxies:rotateRotate a proxy’s address
- devices:controlChange a phone’s network mode
Your key
fpk_live_••••••••••••••••
Shown onceexport FALCONPROXY_API_KEY="paste-your-key-here"Send the key in an Authorization header as a bearer token. Keep it out of source control and out of front-end code.
List your proxies
curl -s "https://falconproxy.com/api/v1/proxies?limit=10" \
-H "Authorization: Bearer $FALCONPROXY_API_KEY"The answer is a list of proxies and a page marker. This is a shortened sample with made-up values:
{
"proxies": [
{
"id": "PROXY_ID",
"name": "Office phone",
"status": "live",
"is_connected": true,
"device": { "id": "DEVICE_ID", "name": "Office phone", "model": "Example Model" },
"exit_ip": "203.0.113.42",
"network_type": "mobile",
"carrier": "Example Mobile Carrier",
"asn": "AS64496",
"ip_type": "mobile"
}
],
"pagination": { "limit": 10, "offset": 0, "total": 1 }
}The status field is the one to read. live means traffic can flow, interrupted means the linked phone is offline or its traffic is switched off, and off means the proxy is switched off. exit_ip is the last address seen for the phone. To read one proxy, request /proxies/PROXY_ID. Use limit and offset to page through a long list.
The same call in Python
import os
import requests
BASE = "https://falconproxy.com/api/v1"
headers = {"Authorization": f"Bearer {os.environ['FALCONPROXY_API_KEY']}"}
response = requests.get(f"{BASE}/proxies", headers=headers, timeout=15)
response.raise_for_status()
for proxy in response.json()["proxies"]:
print(proxy["name"], proxy["status"], proxy["exit_ip"])Switch a proxy on or off
curl -X POST "https://falconproxy.com/api/v1/proxies/PROXY_ID/off" \
-H "Authorization: Bearer $FALCONPROXY_API_KEY"
curl -X POST "https://falconproxy.com/api/v1/proxies/PROXY_ID/on" \
-H "Authorization: Bearer $FALCONPROXY_API_KEY"Both calls need the proxies:write scope and an active subscription. A proxy that is off turns traffic away, and its status reads off. The answer to each call is the refreshed proxy, so you can read the new status straight away.
Rotate the address
curl -X POST "https://falconproxy.com/api/v1/proxies/PROXY_ID/rotate" \
-H "Authorization: Bearer $FALCONPROXY_API_KEY"This needs the proxies:rotate scope and an active subscription. The phone must be connected, in Cellular mode, and ready to rotate, and it must serve only this proxy. When it cannot rotate, the answer is a 409 with a status field that says why. The guide on static and rotating proxies explains when rotating is the right call.
Change a phone’s network mode
curl -X POST "https://falconproxy.com/api/v1/devices/DEVICE_ID/network-mode" \
-H "Authorization: Bearer $FALCONPROXY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"mode": "mobile"}'The mode is mobile for Cellular, wifi for WiFi Residential or boosted for WiFi Boost. The call needs the devices:control scope, and the phone has to be online to receive the change. Changes made through the API are recorded in your audit trail with their source. The devices endpoints also list and read your phones.
Handle errors
An error is a JSON answer with an error field and an HTTP status that says what went wrong. Most errors carry a code and a message inside error.
| Status | What it means | What to do |
|---|---|---|
| 401 | The key is missing or not valid. | Check the Authorization header and the key. |
| 403 | The key does not have the scope the call needs. | Create a key with that scope. |
| 402 | The subscription is not active. Reading still works; changes need an active subscription. | Renew the subscription, then repeat the call. |
| 404 | The proxy or device is not in your workspace. | Check the id. |
| 409 | The action cannot run in the current state, for example rotating a phone that is offline. | Read the answer, fix the cause, and try again. |
| 503 | A service the call depends on is unavailable for the moment. | Try again shortly. |
Go further
The full list of calls, with every field, is in the API reference. The same description is available as an OpenAPI file at https://falconproxy.com/api/v1/openapi.json, which most API tools can import. Webhooks, which let FalconProxy call your server when something changes, are managed through the API with the webhooks:manage scope.