Build your own integration
If you run your own billing system or CRM, you can use the stillorigin API the same way the WHMCS module does. This page walks through that flow, so you can copy it.
The domain must already be in your stillorigin account (added by hand or in bulk). The API does not add or remove domains. The module only turns Website protection on or off and creates owner sign-in links.
What to store in your system
Keep two values on the customer's service in your own platform. They are not API fields:
- the stillorigin domain id, from the lookup when you first turn Website protection on;
- the Website protection mode from before a suspension:
logorblock, taken froml7LogModewhile Website protection is still on.
Later actions look up the domain by the stored id first. If the id is missing, or the API returns domain_not_found, fall back to the domain name. When you first turn Website protection on, always look up by name, even if you already had an id — that way you pick up a domain that was removed and added again with a new id.
Test the connection
When you save the API key in your platform, call GET /v1/account to check it. A successful 2xx response is enough; you don't have to display the account or Website protection licence fields.
curl -sS https://control.stillorigin.app/v1/account \
-H "Authorization: Bearer $STILLORIGIN_API_KEY"
See Your account for the response.
When a customer orders Website protection
- Look up the domain by name:
GET /v1/domains?domain={name}. Always look up by name at this step (awww.pair works). The WHMCS module lower-cases the name and strips a trailing dot. - Store the
idfrom the response on that customer's service. - Turn Website protection on:
POST /v1/domains/l7with{"domainId": 2050, "enabled": true}. Omitl7LogMode, so the domain starts in log mode.
curl -sS "https://control.stillorigin.app/v1/domains?domain=shop.example.com" \
-H "Authorization: Bearer $STILLORIGIN_API_KEY"
curl -sS https://control.stillorigin.app/v1/domains/l7 \
-H "Authorization: Bearer $STILLORIGIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domainId": 2050, "enabled": true}'
If the domain isn't in your stillorigin account, the lookup returns domain_not_found and you should fail the order. If there is no free Website protection licence, turning Website protection on returns no_l7_place and nothing changes — fail the order in that case too. If Website protection is already on, the request is safe: it returns "changed": false and nothing is changed.
If the service in your system has no domain name, fail the order locally and don't call the API.
When you suspend or terminate
The WHMCS module's default is to turn Website protection off when a service is suspended. It also has an option to leave Website protection on, which makes no API call and returns success. Terminate always turns Website protection off.
To turn Website protection off:
- Find the domain:
GET /v1/domains/{id}if you have a stored id, orGET /v1/domains?domain={name}if the id is missing or returnsdomain_not_found. - If Website protection is currently on, store the mode in your system as
logorblock, froml7LogMode, before you turn it off. - Turn Website protection off:
POST /v1/domains/l7with{"domainId": 2050, "enabled": false}. Don't sendl7LogModewhen turning off.
curl -sS https://control.stillorigin.app/v1/domains/l7 \
-H "Authorization: Bearer $STILLORIGIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domainId": 2050, "enabled": false}'
Turning Website protection off frees the Website protection licence and keeps the owner settings. If the domain is no longer in stillorigin, treat suspend and terminate as successful — there is nothing left to turn off.
Terminate uses this same turn-off path. The domain stays in stillorigin with Network protection; only Website protection is turned off.
When you unsuspend
Always try to turn Website protection back on. A missing domain is not a success here.
- Find the domain the same way as for suspend.
- Turn Website protection on and restore the saved mode:
POST /v1/domains/l7with{"domainId": 2050, "enabled": true}and, if you stored a mode,"l7LogMode": true(log) or"l7LogMode": false(blocking). If you didn't store a mode, omitl7LogModeand the domain starts in log mode.
curl -sS https://control.stillorigin.app/v1/domains/l7 \
-H "Authorization: Bearer $STILLORIGIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domainId": 2050, "enabled": true, "l7LogMode": false}'
That example restores blocking. If no Website protection licence is free, the API returns no_l7_place and nothing changes.
A Manage protection button
In your client area, show a Manage protection button for the customer's domain. Don't call the API when the page loads. When the signed-in customer (or an admin) clicks the button:
- Check in your own system that they own the domain. stillorigin can't tell which of your customers is asking.
- Find the domain (stored id first, then name).
- Create a one-time sign-in link:
POST /v1/owner-loginswith{"domainId": 2050}. The WHMCS module always sends the id, not the domain name. - Send the customer's browser to the
urlin the response.
curl -sS https://control.stillorigin.app/v1/owner-logins \
-H "Authorization: Bearer $STILLORIGIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domainId": 2050}'
The link works once and expires after 5 minutes. Treat url like a password: don't log it, email it or store it, and don't create the link ahead of time, in a page that might be cached, or in an email.
If Website protection is off, the API returns 409 with error not_l7. Tell the customer that protection isn't turned on for that domain yet.
See Owner sign-in links and Creating sign-in links with the API.
Showing status
To show the current Website protection state in your admin screens, look up the domain (the same resolve as above) and read l7Enabled and l7LogMode. The WHMCS module shows Off, On, log mode (rules only record what they would block), or On, blocking. That's read-only: there is no extra API call for the display.
Package changes
A change of package in your billing system does not need an API call. The WHMCS module returns success and leaves stillorigin unchanged. You can do the same.
For the request and response fields, see Endpoints. For limits and error codes, see Rate limits and errors.