WordPress site keys
The AstroWay WordPress plugin gets a key on its own, without a signup: the site shows a proof on its REST route, we check it and issue a key bound to that site.
How verification works
Section titled “How verification works”- The plugin generates
proof_id(UUID v4) andproof(32 random bytes, base64url, 43 characters) and keeps them for 10 minutes. - The site answers
GET <home_url>/wp-json/astroway/v1/verify?nonce=<proof_id>withContent-Type: application/jsonand the body{"proof":"<proof>"}. - The plugin sends
POST /v1/site-keys:
{ "site_url": "https://example.com", "proof_id": "3f1c2a9e-8b7d-4c1e-9f3a-2b6d5e4c1a07", "proof": "<43 characters>" }site_url is exactly home_url(), with no ? and no #. On plain permalinks pass verify_url with ?rest_route=/astroway/v1/verify: it is accepted only on the same site and only as that route.
What the key gives
Section titled “What the key gives”- for the site’s server: a request from a browser (with an
Originheader) gets 403, and every call must name the site inX-AstroWay-Site-URL. The binding rests on that header, so keep the key secret, and if it leaks, issue a new one: the previous one is revoked; - a set of free readings, 300 calls an hour per site, no credits; dated horoscopes are accepted only near today’s date;
- one key per install (host and home path), up to 5 installs per host sharing the hour.
Errors: 400 INVALID_SITE_URL, 422 SITE_VERIFICATION_FAILED with details.reason, 429 SITE_KEY_RATE_LIMIT with retry_after.
Connecting an account
Section titled “Connecting an account”When the site owner wants to run on their own plan, the plugin moves the site onto the account’s key in one click.
- The plugin opens in the admin’s browser
https://api.astroway.info/dashboard/connect?site=<home_url>&return=<admin_url>&state=<16-128 characters>&source=wp_plugin.returnmust be on the same host assite, over https. - The admin signs in or registers and picks a key for the site, or creates a new one. A key already bound to another domain moves only after a separate confirmation.
- The browser returns to
returnwithcodeand the samestate. Cancelling returnserror=access_denied. - The site’s server exchanges the code, sending its site key in
X-Api-Key:
POST /v1/site-keys/connect/exchange{ "code": "<43 characters>", "site_url": "https://example.com" }Response: { "key": "aw_live_…", "plan": "free", "domain": "example.com", "account": "j***@example.com" }. The code lives 5 minutes. Exchanging the same code with the same site key within 10 minutes returns the same answer. The site key stops working 24 hours after the exchange.
Errors: 400 INVALID_CODE, 410 CODE_EXPIRED, 403 SITE_MISMATCH.