> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bright Data - Affiliate API reference

> Use the Bright Data Reseller API to manage Affiliate API resources. Manages reseller customers, IPs or usage; returns 200 OK with a JSON response.

<Accordion title="Affiliate API Best Practice">
  ## Initial setup

  We need the following information from sales/partner:

  1. Partner name: letters only
  2. Which DNS url they would like to use. This DNS name should be aliased to:  brd.superproxy.io.
  3. Authorized IPs to add to our allowlist. Other IPs will be blocked from invoking our afiiliate APIs.
  4. List of products they to resell out of this list:

  | Proxy type | Product type        | Required information                                 |
  | :--------- | :------------------ | :--------------------------------------------------- |
  | Datacenter | Rotating pool       | Pool size, Countries, Amount of proxies per country  |
  |            | Unlimited shared    | List of countries, Amount of IPs per country         |
  |            | Unlimited dedicated | List of countries, Amount of IPs per country         |
  | ISP        | Rotating pool       | Pool size,  Countries, Amount of proxies per country |
  |            | Unlimited shared    | List of countries, Amount of IPs per country         |
  |            | Unlimited dedicated | List of countries, Amount of IPs per country         |

  ## High level affiliate flow

  To offer Bright Data proxy services, affiliate should follow this flow.

  1. Setup affiliate account with Bright Data
  2. For each end user: open user in Bright Data
  3. For each product sell: setup zone in Bright data (limit: 50 zones per user)
  4. Each zone will have its own access information set: proxy username and password.

  ## Glossary

  Important terminology needed to understand Bright Data's /affiliate APIs.

  #### Partner prefix

  Two letters which Bright Data assigns to each partner. All user/account IDs will carry this prefix. In the examples here we used "tp\_".

  #### User/Account ID

  A unique identified of entity consuming Bright Data services. Each user of affiliate will get a unique Bright Data account ID starting with letter tp\_ followed by random letters and number. Example: tp\_fd821b5e

  #### Zone

  Under the account, zone represent a configuration set. A collection of product type, amount and other information impacting proxy behavior. Each zone has its own user and password combination, which are the PROXY user and password which the user needs to provide to access the zone's proxy services.

  #### Superproxy

  The listener process on Bright Data side which accepts the initial proxy request, and establishes the tunnel to the peer. The superproxy get the request and relays it to the peer.

  #### Peer

  The actual node identified by the Proxy IP address, which relays the request to the target.

  #### Username

  The proxy username represented as long hash for security reasons.

  ## Examples

  In this examples Partner name will be example and DNS url example.proxy.com

  **Step 1: Create user on brightdata side:**

  ```bash theme={null}
  curl -X POST "https://api.brightdata.com/example/signup_shared_isp"
  ```

  Response:

  ```json theme={null}
  {"id":"tp_fd821b5e","zone":"shared_static_res","password":"g6n62fj88zju","api_token":"aca02446-392c-4283-ab51-71fd25fcb9da"}
  ```

  The user/account id tp\_fd821b5e and new zone name shared\_static\_res.

  User ID or Account ID  is equivalent to a affiliate user. Each user ID (like "account") can setup multiple proxy products on Bright Data side ("proxy zones"), each with its own set of configuration and access (proxy user/password).

  **Step 2: Create proxy username to access Bright Data proxy service (superproxy)**

  ```bash theme={null}
  curl -X GET "https://api.brightdata.com/example/proxies?id=tp_fd821b5e&zone=shared_static_res"
  ```

  Note request query params, we provide new user id and zone name.

  Response:

  ```json theme={null}
  ["example.proxy.com:31111:1a88cbd3954834b5050ae88acd14e9c48eb263207e742b87fedd41b3932b75525bec36774658924a6beaed9284635438:g6n62fj88zju"]
  ```

  Response format is\
  \[PROXY\_URL:PROXY\_PORT:PROXY\_USERNAME:PROXY\_PASSWORD]

  **Step 3: Test the proxy zone**

  ```bash theme={null}
  curl --proxy example.proxy.com:31111 --proxy-user 1a88cbd3954834b5050ae88acd14e9c48eb263207e742b87fedd41b3932b75525bec36774658924a6beaed9284635438:g6n62fj88zju "http://brdtest.com/myip.json"
  ```

  **Step 4: Control the usage limit.**

  By default users are created with 1KB limit. To extend it:

  ```bash theme={null}
  curl -X PUT "https://api.brightdata.com/example/usage_limit?id=tp_fd821b5e&zone=shared_static_res" -H "Content-Type: application/json" -d '{"limit": {"limit": 50000000}}'
  ```

  Response:

  ```json theme={null}
  {"unit":"bw","until":"2025-06-17T00:00:00.000Z","start":"2025-03-16T00:00:00.000Z","bust_action":"disable","limit":50000000,"zone":"shared_static_res"}
  ```

  **Step 5: Create another zone for the same user of dedicated\_dc type, name new\_dc and 2 ips allocated**

  ```bash theme={null}
  curl -X PUT "https://api.brightdata.com/example/zone?id=tp_fd821b5e&type=dedicated_dc&ips_amount=2&zone=new_dc"
  ```

  Response:

  ```json theme={null}
  {"id":"tp_fd821b5e","zone":"new_dc","password":"w1625fn55f4c"}
  ```

  **Step 6: Check allocated ips for new zone**

  ```bash theme={null}
  curl -X GET "https://api.brightdata.com/test_partner/ips?id=tp_fd821b5e&zone=new_dc"
  ```

  Response:

  ```json theme={null}
  {"ips":["152.39.152.207","168.151.126.63"]}
  ```

  **Step 7: Create proxy username for accessing new zone for each ip**

  By default - we will rotate around the IPs in the zone. To target specific IP, I would need to generate a user/password set per each IP.

  To generate it:

  ```bash theme={null}
  curl -X GET "https://api.brightdata.com/example/proxies?id=tp_fd821b5e&zone=new_dc2&ips=168.151.126.63,152.39.152.207"
  ```

  Response:

  ```json theme={null}
  [
  "example.proxy.com:31114:1a88cbd3954834b5050ae88acd14e9c4bd833ab19064869238b7c7213ae07b3e1b0bfb4e4f60f1b79ed72b1459c3091dba80251a30ee2773d9c848ccbe44fa50:u7yi034vn5ek",
  "example.proxy.com:31111:1a88cbd3954834b5050ae88acd14e9c4bd833ab19064869238b7c7213ae07b3e8cdc0f32beb2ad83fa9032e8ac0da4693de714f411fee1764be3a524f4771a68:u7yi034vn5ek"
  ]
  ```

  In response first array element is proxy credentials using ip 152.39.152.207 second is for 168.151.126.63

  Note: port number may range from 31111 to 31114 ; for load balancing purposes.
</Accordion>

1. [Allocate IPs](/api-reference/reseller-api/allocate-ips)
2. [Change Zone Usage Limit](/api-reference/reseller-api/usage-limit)
3. [Create or Change Usage Webhook Settings](/api-reference/reseller-api/usage-webhook-settings)
4. [Disable Customer](/api-reference/reseller-api/disable-customer)
5. [Enable Customer](/api-reference/reseller-api/enable-customer)
6. [Generate Proxy Username](/api-reference/reseller-api/generate-proxy-username)
7. [Generate Socks 5 Proxy Username](/api-reference/reseller-api/generate-socks5-proxy-username)
8. [Get All Available ASNs](/api-reference/reseller-api/get-available-asn)
9. [Get Allocated IPs for a Zone](/api-reference/reseller-api/get-allocated-ips-for-zone)
10. [Get Amount of Shared ISP IPs by Countries](/api-reference/reseller-api/get-shared-isp-ips-by-country)
11. [Get Available Carriers](/api-reference/reseller-api/get-available-carriers)
12. [Get Available Countries](/api-reference/reseller-api/get-available-countires)
13. [Get Customers](/api-reference/reseller-api/get-customers)
14. [Get IPs Amount by Carrier](/api-reference/reseller-api/get-ips-amount-by-carrier)
15. [Get Usage Webhook Info](/api-reference/reseller-api/get-usage-webhook-info)
16. [Get Zone Usage Limit](/api-reference/reseller-api/get-zone-usage-limit)
17. [Get Zone Usage Limit Stats](/api-reference/reseller-api/get-zone-usage-limit-stats)
18. [Refresh IPs](/api-reference/reseller-api/refresh-ips)
19. [Remove Allocated IPs](/api-reference/reseller-api/remove-allocated-ips)
20. [Sign up Customer in Dedicated DC Zone](/api-reference/reseller-api/sign-up-customer-in-dedicated-dc)
21. [Sign up Customer in Dedicated ISP Zone](/api-reference/reseller-api/sign-up-customer-in-dedicated-isp)
22. [Sign up Customer in Residential Zone](/api-reference/reseller-api/sign-up-customer-in-residential-zone)
23. [Sign up Customer in Shared DC Zone](/api-reference/reseller-api/sign-up-customer-in-shared-dc)
24. [Sign up Customer in Smart Residential Zone](/api-reference/reseller-api/sign-up-customer-in-smart-residential-zone)
25. [Sign up Customer with Shared ISP IPs](/api-reference/reseller-api/sign-up-customer-with-shared-isp-ips)
