Sign-up API

Sign-up API

Self sign-up completes through an activation link: submit an email address, open the link in the email to confirm, and the account is created; the API Key is shown on the confirmation page and sent in a welcome email. The sign-up endpoints need no authentication.

export BASE_URL="https://api.xairouter.com"

The service provider may turn self sign-up off, in which case every /x-sign request returns 403 {"success": false, "message": "Self-registration is currently disabled"}.

Flow

  1. POST /x-sign: send the activation email; the link is valid for 10 minutes.
  2. GET /x-sign/activate?token=...: open the confirmation page; the user clicks to confirm.
  3. POST /x-sign/activate: create the account; the page shows the API Key and a welcome email is sent.

Opening the link (GET) only shows the confirmation page and never creates an account, so that email security scanners prefetching the link cannot activate it by mistake.

Send the activation email

curl -X POST "$BASE_URL/x-sign" \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "referral_code": "pk-Xvs..."}'
FieldRequiredDescription
emailYesEmail address, converted to lowercase
referral_codeNoThe referrer's public identifier (pk-Xvs...; the referrer can get it from public_key in GET /dashboard/status)

The request body may not exceed 64 KiB. Success response:

{"success": true, "message": "Verification code sent successfully", "data": {"email": "[email protected]"}}

All responses use the {"success", "message", "data"} structure. Business errors return 400, with the reason in message:

messageReason
Invalid email addressThe email format is invalid
Email domain is not allowed for self-registrationThe email domain is not allowed for self sign-up
Email already registeredThe email is already registered
invalid referral codeThe referral code does not exist or the referrer is disabled
Please wait before requesting another verification codeThe same email requested again within 2 minutes
Too many verification codes requested from this IP todayToo many requests from the same IP today
Failed to send verification emailThe email could not be sent; try again later

Activation

The link in the activation email is https://api.xairouter.com/x-sign/activate?token=<48-character token>.

  • GET /x-sign/activate?token=...: returns an HTML confirmation page.
  • POST /x-sign/activate (form field token): creates the account and returns an HTML success page showing the new account's API Key.
  • An invalid or expired token shows Invalid or expired activation link.

The account that is created:

PropertyValue
Account nameA randomly generated system name
Display nameDerived from the email prefix
API KeyA newly generated 51-character sk-Xvs key, plus a public identifier pk-Xvs...
Sign-up bonusThe amount is set by the service provider, valid for 1 month, shown as Sign-up bonus in credit_balance of GET /dashboard/info
Sub-account quota1

The new account's Level, Role, pricing, and rate limits inherit the defaults of the service it signs up to.

Abuse protection

Sign-up endpoints are rate limited per source IP. POST /x-sign and POST /x-sign/activate share the following limits:

LimitValue
Requests per minute / hour / day3 / 10 / 20
Distinct emails per IP per day5 (checked in POST /x-sign only; exceeding it returns 400)
Progressive delayThe more requests within the same hour, the longer the response waits (up to 15 seconds)
Automatic blockAfter suspicious behavior reaches a threshold, the IP is blocked for 3 hours

A request rejected by the rate or site-wide quota returns 429 with the body {"success": false, "message": "..."}.