Razix API Reference
Programmatically provision, manage, and verify custom domains for your end-users.
Introduction
Welcome to the Razix API. Our REST API allows you to programmatically provision, update, manage, and verify custom domains for your end-users directly from your own backend application.
By integrating this API, you can offer a fully white-labeled custom domain experience within your own SaaS platform.
Base URL & Authentication
All API requests must be made over HTTPS to the following base URL:
https://api.razix.com/v1Authentication to the API is performed via HTTP Bearer Auth. Provide your API key as the basic bearer token value in the Authorization header. You can generate and manage your API keys in the Razix Dashboard.
Authorization: Bearer RAZIX_API_KEYSecurity Warning: Your API keys carry high privileges. Never share your secret keys in publicly accessible areas such as GitHub, client-side code (React/Next.js client components), or mobile apps. All API requests must be made securely from your backend server.
Endpoints
1. Create a Custom Domain
Provision a new custom domain for your end-user. Once created, the domain is placed in a pending state while our background systems verify the DNS configuration.
Endpoint: POST /domains
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
| hostname | string | Yes | The full domain or subdomain to provision (e.g., app.acmecorp.com). |
| target_url | string | Yes | The destination URL where traffic should be routed (e.g., https://your-app.com/tenant-id). |
cURL Example
curl -X POST https://api.razix.com/v1/domains \
-H "Content-Type: application/json" \
-H "Authorization: Bearer RAZIX_API_KEY" \
-d '{
"hostname": "crm.acmecorp.com",
"target_url": "https://auth.razix.com/"
}'Response (201 Created)
{
"success": true,
"data": {
"id": "d0eafe3f-d008-4a8c-bc6d-1391a84fb60e",
"hostname": "crm.acmecorp.com",
"target_url": "https://auth.razix.com",
"dns_status": "pending",
"created_at": "2026-06-03T14:30:00.000Z"
}
}2. List All Domains
Retrieve a list of all custom domains provisioned under your App ID. Domains are sorted by creation date, with the newest appearing first (limited to 100 per request).
Endpoint: GET /domains
cURL Example
curl -X GET https://api.razix.com/v1/domains \
-H "Authorization: Bearer RAZIX_API_KEY"Response (200 OK)
{
"success": true,
"data": [
{
"id": "d0eafe3f-d008-4a8c-bc6d-1391a84fb60e",
"hostname": "crm.acmecorp.com",
"target_url": "https://auth.razix.com",
"dns_status": "active",
"created_at": "2026-06-03T14:30:00.000Z"
}
]
}3. Retrieve a Specific Domain
Retrieve the details and current DNS status of a single custom domain. This is highly useful for polling to check if a domain has transitioned from pending to active.
Endpoint:
GET /domains?id=DOMAIN_IDGET /domains?hostname=HOSTNAME
cURL Example
curl -X GET "https://api.razix.com/v1/domains?hostname=crm.acmecorp.com" \
-H "Authorization: Bearer RAZIX_API_KEY"Response (200 OK)
{
"success": true,
"data": {
"id": "d0eafe3f-d008-4a8c-bc6d-1391a84fb60e",
"hostname": "crm.acmecorp.com",
"target_url": "https://auth.razix.com",
"dns_status": "active",
"created_at": "2026-06-03T14:30:00.000Z"
}
}4. Update a Domain
Update the configuration for a specific custom domain. You can update the destination URL, the hostname, or both.
Routing Note:
- Updating
target_urlonly: Changes propagate to the global edge network within 10 seconds. The domain remainsactive. - Updating
hostname: Because this requires a new DNS check, the domain'sdns_statuswill instantly reset topendingand re-enter the verification queue.
Endpoint: PATCH /domains?id=DOMAIN_ID
Request Body (JSON)
Note: You must provide at least one of the following parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
target_url | string | Optional | The new destination URL where traffic should be routed. |
hostname | string | Optional | The new custom domain or subdomain (e.g., changing app.old.com to app.new.com). |
cURL Example
curl -X PATCH "https://api.razix.com/v1/domains?id=d0eafe3f-d008-4a8c-bc6d-1391a84fb60e" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer RAZIX_API_KEY" \
-d '{
"target_url": "https://new-destination.razix.app/mycrm",
"hostname": "dashboard.acmecorp.com"
}'Response (200 OK)
{
"success": true,
"data": {
"id": "d0eafe3f-d008-4a8c-bc6d-1391a84fb60e",
"hostname": "dashboard.acmecorp.com",
"target_url": "https://new-destination.razix.app/mycrm",
"dns_status": "pending"
}
}5. Verify Domain Status
Manually trigger an on-demand DNS resolution check for a specific domain. If the domain's DNS records correctly point to the Razix network, its status will instantly update to active.
Endpoint: POST /verify
Request Body (JSON)
Note: You must provide at least one of the following parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
domainId | string | Yes | The Razix domain ID you want to verify. |
cURL Example
curl -X POST https://api.razix.com/v1/verify \
-H "Content-Type: application/json" \
-H "Authorization: Bearer RAZIX_API_KEY" \
-d '{
"domainId": "d0eafe3f-d008-4a8c-bc6d-1391a84fb60e"
}'Response (200 OK)
{
"success": true,
"data": {
"id": "d0eafe3f-d008-4a8c-bc6d-1391a84fb60e",
"hostname": "dashboard.acmecorp.com",
"dns_status": "active",
"verified_just_now": true
}
}(Note: verified_just_now will be true if this specific API call successfully transitioned the domain from pending to active).
6. Delete a Domain
Permanently remove a custom domain from your application. Traffic routing will cease immediately across the edge network.
Endpoint: DELETE /domains?id=DOMAIN_ID
cURL Example
curl -X DELETE "https://api.razix.com/v1/domains?id=d0eafe3f-d008-4a8c-bc6d-1391a84fb60e" \
-H "Authorization: Bearer RAZIX_API_KEY"Response (200 OK)
{
"success": true,
"message": "Domain successfully deleted."
}Error Codes Reference
Razix uses conventional HTTP response codes to indicate the success or failure of an API request.
| Code | Status | Description |
|---|---|---|
| 200 | OK | The request was successful. |
| 201 | Created | The domain was successfully provisioned. |
| 400 | Bad Request | "Missing or malformed parameters (e.g., invalid URL format)." |
| 401 | Unauthorized | No valid API key provided. |
| 404 | Not Found | The requested domain ID or hostname does not exist. |
| 409 | Conflict | The requested hostname is already in use on the platform. |
| 500 | Server Error | An internal server error occurred. |
Integration & White-Labeling (Next Steps)
To seamlessly offer custom domains to your users, you need to map Razix domains to your internal users and provide them with proper DNS configuration instructions.
1. Mapping Domains to Your Users/Tenants
The Razix API tracks domains at the App level. To keep track of which custom domain belongs to which user (or tenant) within your software, store a mapping of the Razix domain_id in your database.
Recommended Database Flow:
- Your end-user requests a custom domain in your dashboard UI.
- Your backend calls POST https://api.razix.com/v1/domains.
- Razix returns a 201 Created with the id (e.g., d0eafe3f...).
- Your backend saves that id to your internal tenant_domains table alongside your user_id.
- For future updates or manual verifications (POST /verify), look up the Razix ID from your database.
2. White-Labeling DNS Instructions for Your Users
For a domain to officially route traffic to your application, your end-users must add a DNS record inside their own domain registrar (e.g., GoDaddy, Cloudflare).
You should build a UI in your application that displays the following instructions to your user immediately after they provision a domain:
"Please add the following CNAME record to your DNS provider:"
| TypeName | HostValue | Target |
|---|---|---|
| CNAME | subdomain (e.g., crm or app) | proxy.razix.com |
Pro-Tip for Apex Domains: Standard DNS RFCs do not allow CNAME records on root/apex domains (e.g., acmecorp.com). If your user is configuring a root domain, instruct them to use an A Record or ALIAS Record pointing to our Anycast IP Address: 35.206.102.171.