# Proxies

## Add a proxy

Use this API to add a proxy to your account.

## POST /api/v1/public/proxies

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/proxies":{"post":{"operationId":"ApiController_addProxy","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The proxy name"},"credentials":{"type":"object","properties":{"ip":{"type":"string","description":"The ip"},"port":{"type":"string","description":"The port"},"username":{"type":"string","description":"The username"},"password":{"type":"string","description":"The password"}},"required":["ip","port","username","password"]}},"required":["name","credentials"]}}}},"responses":{"201":{"description":"Proxy added successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"}},"required":["city","region","country","countryCode"]},"credentials":{"type":"object","properties":{"ip":{"type":"string"},"port":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["ip","port","username","password"]},"type":{"type":"string"}},"required":["id","name","location","credentials","type"]}},"required":["success","message","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"406":{"description":"Proxy not supported by TexAu"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error occurred in adding proxy"}},"tags":["API Service"]}}}}
```

### Buy a proxy

Use this API to buy a proxy for connected account.

## POST /api/v1/public/proxies/buy

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/proxies/buy":{"post":{"operationId":"ApiController_orderProxy","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccountId":{"type":"string"}},"required":["connectedAccountId"]}}}},"responses":{"201":{"description":"Proxy purchased successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"}},"required":["city","region","country","countryCode"]},"credentials":{"type":"object","properties":{"ip":{"type":"string"},"port":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["ip","port","username","password"]},"type":{"type":"string"}},"required":["id","name","location","credentials","type"]}},"required":["success","message","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error occurred in purchasing proxy"}},"tags":["API Service"]}}}}
```

## Update a proxy

Use this API to update proxy credentials, in case it gets expired or updated from provider

## PUT /api/v1/public/proxies/{proxyId}

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/proxies/{proxyId}":{"put":{"operationId":"ApiController_updateProxy","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"proxyId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The proxy name"},"credentials":{"type":"object","properties":{"ip":{"type":"string","description":"The ip"},"port":{"type":"string","description":"The port"},"username":{"type":"string","description":"The username"},"password":{"type":"string","description":"The password"}},"required":["ip","port","username","password"]}}}}}},"responses":{"200":{"description":"Proxy update successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["success","message","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"404":{"description":"Proxy does not exist"},"406":{"description":"Proxy not supported by TexAu"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error occurred while updating the proxy"}},"tags":["API Service"]}}}}
```

## List all proxies

This API will be used for listing all proxies of your account by their name

## GET /api/v1/public/proxies

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/proxies":{"get":{"operationId":"ApiController_getAllProxies","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"start","required":false,"in":"query","description":"The page No","schema":{"minimum":0,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"The Page Size","schema":{"minimum":1,"maximum":50,"type":"number"}}],"responses":{"200":{"description":"Proxies fetch successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"total":{"type":"number"},"data":{"description":"Array of proxy data","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isUsable":{"type":"boolean"}},"required":["id","name","isUsable"]}}},"required":["success","message","total","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"404":{"description":"Proxy does not exist"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error in fetching proxies"}},"tags":["API Service"]}}}}
```

## Get proxy by ID

This API will be used to get `location` and `credentials` of proxy by ID

## GET /api/v1/public/proxies/{proxyId}

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/proxies/{proxyId}":{"get":{"operationId":"ApiController_getProxyById","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"proxyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Proxies fetch successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isUsable":{"type":"boolean"},"credentials":{"type":"object","properties":{"ip":{"type":"string"},"port":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["ip","port","username","password"]},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"}},"required":["city","region","country","countryCode"]}},"required":["id","name","isUsable","credentials","location"]}},"required":["success","message","data"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"404":{"description":"Proxy does not exist"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error in fetching proxies"}},"tags":["API Service"]}}}}
```

## Delete proxy by ID

This API will be used to delete proxy from your TexAu account

## DELETE /api/v1/public/proxies/{proxyId}

>

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"TexAu APIs","version":"1.0"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/api/v1/public/proxies/{proxyId}":{"delete":{"operationId":"ApiController_deleteProxyById","parameters":[{"name":"X-TexAu-Context","in":"header","description":"Pass orgUserId and workspaceId as ‘{\"orgUserId\":\"123\",\"workspaceId\":\"123\"}’","required":true,"schema":{"type":"string"}},{"name":"proxyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Proxy deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}},"401":{"description":"Unauthorized access"},"403":{"description":"Your plan does not have API access"},"404":{"description":"Proxy does not exist"},"412":{"description":"Proxy in use, cannot be deleted"},"422":{"description":"Requested workspace does not belongs to you"},"500":{"description":"Error in deleting proxy"}},"tags":["API Service"]}}}}
```
