Base URLs
API requests can be made to the following base URLs depending on the environment:- Production:
https://onlyautomator.com - Local Web App:
http://localhost:3000 - Local Microservice:
http://localhost:3001
Authentication
All proxy management endpoints require authentication using a Bearer Token (JWT obtained after login) passed in theAuthorization header:
Endpoints Overview
Get Account Proxy Config
Retrieve the current proxy setup for a specific account.
Assign Automatic Proxy
Automatically assign a suitable Webshare proxy to an account.
Set Manual Proxy
Manually configure a specific proxy provided by the user.
Set Preferences
Update preferences like preferred region or activation status.
Disable Proxy
Turn off proxy usage for a specific account.
Handle Failure
Report a failing proxy and optionally trigger auto-reassignment.
Test Proxy Connectivity
Test the connection of a given proxy configuration without saving it.
Get Available Proxies (Webshare)
List available proxies directly from Webshare (Admin/Internal).
Get Available Countries (Webshare)
List countries where Webshare proxies are available.
Get Available Cities (Webshare)
List cities within a country where Webshare proxies are available.
Get Client IP
Utility endpoint to check the client’s current external IP address.
Endpoints Details
Get Account Proxy Configuration
Path Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The unique identifier (UUID) of the account. |
Successful Response (200 OK)
Returns the proxy details associated with the account.Mock Response
Error Responses
401 Unauthorized: Invalid or missing authentication token.404 Not Found: The specifiedaccountIddoes not exist.500 Internal Server Error: Unexpected server issue.
Assign Automatic Proxy
Path Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The unique identifier (UUID) of the account. |
Request Body (Optional)
You can optionally provide preferences for the automatic assignment:Request Body
preferredCountry(string, optional): ISO 3166-1 alpha-2 code (e.g., “DE”, “US”).preferredCity(string, optional): City name within the preferred country.forceReassign(boolean, optional, default:false): Iftrue, any existing proxy configuration will be replaced. Iffalse, the assignment will fail if a proxy is already assigned (unless it was inactive or failed).
Successful Response (200 OK)
Returns the details of the newly assigned proxy.Mock Response
Error Responses
400 Bad Request: Invalid request body format.401 Unauthorized: Invalid or missing authentication token.404 Not Found: The specifiedaccountIddoes not exist.409 Conflict: Cannot assign proxy (e.g., proxy already assigned andforceReassignis false, or account is inmanualmode).503 Service Unavailable: No suitable proxies were found in the Webshare pool matching the criteria.500 Internal Server Error: Unexpected server issue.
Set Manual Proxy
Path Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The unique identifier (UUID) of the account. |
Request Body (Required)
Request Body
proxy_address(string, required): IP address or hostname.proxy_port(integer, required): Port number.proxy_username(string, optional): Required if proxy needs authentication.proxy_password(string, optional): Required if proxy needs authentication.proxy_country_code(string, optional): User-provided country code (not validated by system).proxy_city_name(string, optional): User-provided city name.
Successful Response (200 OK)
Indicates the manual proxy was successfully tested and saved.Mock Response
Error Responses
400 Bad Request:- Invalid request body format (missing required fields).
- Proxy connectivity test failed (error message will specify this).
401 Unauthorized: Invalid or missing authentication token.404 Not Found: The specifiedaccountIddoes not exist.500 Internal Server Error: Unexpected server issue during testing or saving.
Set Proxy Preferences
Path Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The unique identifier (UUID) of the account. |
Request Body (Required - at least one property)
Request Body
proxy_region_preference(string, nullable): Preferred ISO country code (e.g., “DE”, “US”). Set tonullor omit to remove preference.proxy_city_preference(string, nullable): Preferred city within the region. Set tonullor omit to remove preference.proxy_is_active(boolean, optional): Set tofalseto temporarily disable using the assigned proxy,trueto enable.
Successful Response (200 OK)
Confirms the preferences were updated.Mock Response
Error Responses
400 Bad Request: Invalid request body format (e.g., empty object).401 Unauthorized: Invalid or missing authentication token.404 Not Found: The specifiedaccountIddoes not exist.500 Internal Server Error: Unexpected server issue.
Disable Proxy
none and marking it as inactive. Any previously assigned proxy details might be cleared or simply ignored.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The unique identifier (UUID) of the account. |
Successful Response (200 OK)
Confirms the proxy was disabled.Mock Response
Error Responses
401 Unauthorized: Invalid or missing authentication token.404 Not Found: The specifiedaccountIddoes not exist.500 Internal Server Error: Unexpected server issue.
Handle Proxy Failure
auto mode, optionally attempt to automatically assign a new proxy.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The unique identifier (UUID) of the account. |
Request Body (Optional)
Request Body
error(string, optional): Description of the error encountered.autoReassign(boolean, optional, default:true): Iftrueand the account’sproxy_modeisauto, the system will attempt to assign a new proxy. Ignored if mode ismanualornone.
Successful Response (200 OK)
Indicates the failure was processed. Includes details about whether reassignment was attempted and successful.Mock Response (Reassignment Successful)
Mock Response (Reassignment Failed or Not Attempted)
Error Responses
400 Bad Request: Invalid request body format.401 Unauthorized: Invalid or missing authentication token.404 Not Found: The specifiedaccountIddoes not exist.503 Service Unavailable: Reassignment attempted but failed due to lack of available proxies.500 Internal Server Error: Unexpected server issue.
Test Proxy Connectivity
Request Body (Required)
Request Body
proxy_address(string, required)proxy_port(integer, required)proxy_username(string, optional)proxy_password(string, optional)
Successful Response (200 OK)
Indicates the provided proxy details allowed a successful connection test.Mock Response
Error Responses
400 Bad Request:- Invalid request body format.
- Proxy connectivity test failed (error message will specify the reason).
401 Unauthorized: Invalid or missing authentication token.500 Internal Server Error: Unexpected server issue during the test.
Get Available Webshare Proxies (Admin/Internal)
Query Parameters
| Parameter | Type | Description |
|---|---|---|
country_code__in | string | Optional. Comma-separated list of ISO country codes (e.g., “DE,US”). |
page_size | integer | Optional. Max proxies per page (default: 100). |
page | integer | Optional. Page number for pagination (default: 1). |
Successful Response (200 OK)
Returns a list of proxies matching the Webshare API response structure.Mock Response
Error Responses
401 Unauthorized: Missing or invalid token/insufficient permissions.503 Service Unavailable: Could not connect to or retrieve data from the Webshare API.500 Internal Server Error: Unexpected server issue.
Get Available Proxy Countries
Successful Response (200 OK)
Mock Response
Error Responses
401 Unauthorized: Invalid or missing authentication token.503 Service Unavailable: Failed to retrieve country list from cache or source.500 Internal Server Error: Unexpected server issue.
Get Available Proxy Cities by Country
Query Parameters
| Parameter | Type | Description |
|---|---|---|
countryCode | string | Required. ISO 3166-1 alpha-2 code (e.g., “DE”). |
Successful Response (200 OK)
Mock Response (for countryCode=DE)
Error Responses
400 Bad Request: Missing or invalidcountryCodeparameter.401 Unauthorized: Invalid or missing authentication token.404 Not Found: No cities found for the specified validcountryCode(or country not supported).503 Service Unavailable: Failed to retrieve city list from cache or source.500 Internal Server Error: Unexpected server issue.
Get Client IP
Successful Response (200 OK)
Mock Response
Error Responses
500 Internal Server Error: Unexpected server issue retrieving IP.
Standard Error Responses
Most errors return a JSON body conforming to theErrorResponse schema defined in the OpenAPI specification:
Error Response Schema
4xx and 5xx status codes.
Integration Examples
(Examples provided previously remain largely relevant, ensure API tokens and account IDs are placeholders)Best Practices
- Security: Protect your API tokens. Do not embed them directly in client-side code distributed to users.
- Error Handling: Check HTTP status codes and parse the JSON error response for details.
- Idempotency: Be mindful that some operations (like auto-assignment without
forceReassign) might fail if repeated under certain conditions (e.g., proxy already assigned). - Consistency: Try to use the automatically assigned proxies (
automode) for best results, as these are managed and rotated by the system. - Testing: Use
/api/proxy/test-connectivityto validate manual configurations, and/api/whatsmyipfrom the client to confirm the proxy is active in the browser/application.