Assign Automatic Proxy
This endpoint automatically assigns an available Webshare proxy to the specified OnlyFans account. It prioritizes proxies based on the user’s region preference, then country, and finally falls back to any available proxy. The system performs connectivity checks before assigning a proxy.This process relies on the backend having a valid
WEBSHARE_API_KEY
configured in its environment variables to fetch available proxies from Webshare.io.Authentication
This endpoint requires authentication via bearer token representing a valid user session managed by Supabase Auth (cookies).Testing Note: Due to the requirement for a live user session, this endpoint cannot be successfully tested directly using the ‘Send’ button in this documentation with a static token.To test:
- Call this endpoint from your web application after logging in.
- Use
curl
or a similar tool with a valid, current user JWT obtained from your browser’s session after logging in.
curl
, you need the JWT access token stored by Supabase Auth in your browser.
- Log in to your application normally in your browser.
- Open Developer Tools (usually F12).
- Go to the Application tab (it might be called Storage in Firefox).
- Under the Storage section, find Cookies and select your application’s domain (e.g.,
http://localhost:3000
orhttps://onlyautomator.com
). - Look for a cookie named similar to
sb-access-token
(the exact name might vary slightly based on Supabase configuration). - Copy the entire value of this cookie. This is your Bearer token.
- Use this copied value in the
Authorization: Bearer <your_copied_token>
header for yourcurl
or other API tool requests.
Response Example
Error Codes
This table provides context beyond the basic OpenAPI status codes.Status Code | Description |
---|---|
400 | Missing accountId or invalid format in request body. |
401 | Authentication token is missing or invalid. |
404 | The specified accountId does not exist. |
409 | The account already has an active proxy and forceReassign was not set to true . |
500 | An internal server error occurred during assignment (e.g., database error, Webshare API communication issue). |
503 | No suitable, working proxies could be found in the Webshare pool after checking availability and connectivity, considering preferences. |
Code Examples
Notes
- The assignment logic prioritizes proxies based on: Preferred Country -> Preferred Region -> Any Country.
- The system checks proxy connectivity before finalizing the assignment.
- Assigned proxy credentials (including password) are returned in the success response but stored encrypted in the database.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Bearer token for authentication (JWT)
Path Parameters
The unique identifier of the OnlyFans account.
Body
application/json
Response
Proxy assigned successfully.