Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nudj.cx/llms.txt

Use this file to discover all available pages before exploring further.

Every Nudj API endpoint is scoped to your organisation’s domain. This page explains the patterns in use and points you at the Admin API endpoints that manage white-label custom domains.
Looking to add a white-label domain for your members? The full admin walkthrough lives at Custom Domain Setup.

Domain patterns

Your organisation’s API endpoints follow this pattern:
https://{your-organization-domain}/api/v2/{api-type}/{endpoint}
PatternExampleWhen used
Standard Nudj subdomainacme-corp.nudj.cxDefault for every organisation
Custom subdomainapi.yourcompany.comRegistered via POST /domains
White-labelrewards.enterprise.comRegistered via POST /domains, often paired with a member-facing brand domain
Tokens are tied to the subdomain they were issued for — a token minted for acme-corp.nudj.cx cannot be replayed against a different organisation’s subdomain. This is enforced by the auth middleware at request time.

Managing custom domains via the Admin API

The Admin API exposes three endpoints for custom-domain lifecycle:

GET /domains

List every domain registered for your organisation.

POST /domains

Register a new custom domain. Triggers DNS + SSL provisioning.

POST /domains/remove

Retire a domain. Existing tokens scoped to that domain stop being accepted.
For the DNS / SSL / verification walkthrough, see the admin-side guide — that covers the UI flow in the admin dashboard that wraps these endpoints.

Using your domain from code

When building an integration, always use your organisation’s actual domain — never a hard-coded dev/staging host.
const API_DOMAIN = process.env.NUDJ_API_DOMAIN; // e.g. 'acme-corp.nudj.cx'
const API_TOKEN = process.env.NUDJ_API_TOKEN;

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

Finding your domain

  1. Check Developer SettingsSettings → Organisation → Developer lists the active domain for your organisation.
  2. Match your admin URL — the admin dashboard for your organisation runs on the same subdomain (e.g. admin is served under {your-subdomain}.nudj.cx).
  3. Ask your administrator — they have the full list of registered custom domains and can issue a new one via the Admin API or the admin UI.

Troubleshooting

  • Verify you’re hitting your organisation’s actual domain — not nudjdev or nudjstaging.
  • Check the path starts with /api/v2/ and uses integration, admin, or analytics.
  • Confirm the endpoint exists for the API type you’re calling.
  • Your token is scoped to a specific subdomain. Using it against a different domain (including nudjdev from a production token) returns 401.
  • Re-issue the token from the correct organisation’s Developer Settings if you need to test against another tenant.
  • The APIs are not CORS-enabled for browser origins. Proxy all requests through your own backend — do not call these endpoints directly from a browser.

Testing Guide

Using the interactive playground and transforming generated cURL snippets for your domain.

Custom Domain Setup (Admin)

Full DNS and SSL walkthrough for registering a white-label domain.