Skip to main content
Each Nudj organization has its own unique API domain. This guide explains how to test API calls against your specific organization.

Organization Domain Pattern

Your organization’s API endpoints follow this pattern:
https://{your-organization-domain}/api/v2/{api-type}/{endpoint}
Components:
  • {your-organization-domain} - Your organization’s unique domain (e.g., acme-corp.nudj.cx, your-company.com)
  • {api-type} - The API you’re accessing: admin, integration, or analytics
  • {endpoint} - The specific API endpoint
Organization TypeDomain PatternExample
Standard Nudj Subdomain{org-name}.nudj.cxacme-corp.nudj.cx
Custom Domain{subdomain}.{domain}.comapi.yourcompany.com
White-label{custom-domain}rewards.enterprise.com

Quick Setup with Scripts

We provide an automated setup script that configures the API playground for your organization:
# Run the setup script
./scripts/setup-custom-domain-v2.sh
The script will:
  1. Ask for your organization’s domain
  2. Create custom OpenAPI specifications with your domain
  3. Generate a Mintlify configuration that uses your domain
  4. Add a convenient npm script to package.json
After setup, start your custom documentation:
# If your domain is acme-corp.nudj.cx, the script creates:
pnpm run dev:acme-corp

# The playground will use https://acme-corp.nudj.cx for all API calls

Manual Testing Workflow

1

Configure in Playground

Use the playground to set up your request parameters and headers
2

Copy the cURL Command

Click “Copy” to get the generated command
3

Replace the Domain

In your terminal, replace nudjdev.nudj.cx with your organization’s domain
4

Execute the Request

Run the modified command
Example transformation:
curl -X GET https://nudjdev.nudj.cx/api/v2/admin/achievements \
  -H "x-api-token: YOUR_TOKEN"

Programmatic Integration

When building integrations, always use your organization’s specific domain:
const API_DOMAIN = 'your-subdomain.nudj.cx'; // Replace with your domain
const API_TOKEN = process.env.NUDJ_API_TOKEN;

async function fetchAchievements() {
  const response = await fetch(
    `https://${API_DOMAIN}/api/v2/integration/achievements`,
    {
      headers: {
        'x-api-token': API_TOKEN,
        'Content-Type': 'application/json'
      }
    }
  );
  
  return response.json();
}

Finding Your Domain

To find your organization’s API domain:
  1. Check with your administrator - They can provide the correct domain
  2. Look at your Nudj platform URL - Often the same domain is used
  3. Check your Developer Settings - Available at your admin panel under Developer settings

Environment Testing

Your organization may have multiple environments:
# Production
curl -X GET https://your-subdomain.nudj.cx/api/v2/admin/achievements \
  -H "x-api-token: PROD_TOKEN"

# Staging
curl -X GET https://staging.your-subdomain.nudj.cx/api/v2/admin/achievements \
  -H "x-api-token: STAGING_TOKEN"

Troubleshooting

  • Verify you’re using the correct organization domain
  • Check that /api/v2/ is included in the path
  • Ensure the endpoint exists for your API type
  • Confirm your API token is valid for your organization
  • Check that you’re using the correct authentication header
  • Verify the token hasn’t expired
  • Ensure your domain is whitelisted in your organization’s CORS settings
  • Contact your administrator to add your domain if needed
  • Use server-side requests instead of browser-based calls for production

Developer Settings

Get your API tokens and find your organization’s domain configuration
I