Reseller API keys and IP addresses
This article covers two things your provider controls through your reseller plan: access to the REST API, so a billing system or your own scripts can manage your customers, and the pool of IP addresses your subscriptions use.
API keys#
An API key lets a program call the panel's REST API with the same rights as your reseller login. Keys need the Use the REST API permission in your reseller plan. Without it, the API Keys tab says "Your plan does not include the REST API. Ask your provider to enable "Ability to use the REST API"."
Create a key#
- Click Account in the menu.
- Open the API Keys tab. Only the account owner sees it; panel users of your account do not.
- Click Create key.
- Fill in the dialog:
| Field | Meaning |
|---|---|
| Name | What uses the key, for example billing system (required) |
| Allowed from | IP addresses or networks, comma-separated, for example 203.0.113.10, 198.51.100.0/24. Empty: anywhere. |
| Expires | After how many days the key stops working. 0: never. |
- Click Create.
- Copy the key from the green notice. It starts with
sr_and is shown once only; the panel keeps just a fingerprint of it.
The key list shows each key's Name, the first characters of the Key, the login it Acts as, Allowed from, Last used and Expires. An account can have at most 20 keys.
You cannot create keys while you are logged in to one of your customers' panels with Log in as customer.
Use a key#
Send the key in the Authorization header. The base address is shown in the Examples card of the API Keys tab, for example:
curl -H "Authorization: Bearer sr_..." https://panel.example.com:9443/api/my/overview
curl -H "Authorization: Bearer sr_..." https://panel.example.com:9443/api/subscriptions/12/domainsA key reaches the same things as your login: your customers, your service plans, the subscriptions you sell and their websites, mail, databases and other tools. Requests for anything outside your account are refused, as they are in the panel.
For safety, keys cannot change passwords, manage API keys or log in as other accounts.
Delete a key#
Click the bin icon next to the key and confirm. Scripts that use it stop working at once. Delete a key straight away if it may have leaked, then create a new one.
Good practice#
- Create one key per program, so you can delete one without breaking the others.
- Fill in Allowed from with the address of the server that runs the program.
- Give keys for temporary jobs an expiry date.
IP addresses#
Every subscription runs on one IP address of the server. Your provider decides which addresses you may use by assigning them to you; together they are your IP pool. An address can be:
| Type | Meaning |
|---|---|
| Shared | Many subscriptions use it |
| Dedicated | Only one subscription may use it; a dedicated address can be assigned to one reseller only |
Choose an address for a subscription#
When you add a subscription (Subscriptions › Add Subscription, or when you add a customer with a subscription), the IP address field lists the addresses of your pool, with their type, for example 203.0.113.20 (dedicated).
- Choose an address, or keep First address of my pool.
- A dedicated address that another subscription already uses is refused: "… is a dedicated IP that is already in use."
- An address outside your pool is refused: "Choose an IP address from your pool."
The IP address field appears only when your provider assigned addresses to you. If no address is assigned, new subscriptions use the server's default shared address.
Choosing the address yourself needs the Manage the IP pool assigned by the administrator permission. Without it, the panel always uses the first address of your pool, whatever you select.
See the address of a subscription#
Open the subscription (click its name under Subscriptions or Websites & Domains). The Hosting card shows the IP address and whether it is shared or dedicated. Your customers find the same address under Connection Info of each website.
A dedicated address is needed for some features, for example anonymous FTP. To change the address of an existing subscription or get more addresses, contact your provider.
Related#
- Reseller overview
- Customers and subscriptions
Something missing? Ask in the community or open a ticket.