Help Center API

The Help Center API manages the public-facing knowledge base settings, including subdomain configuration, custom domains, and site branding.

Help Center Object

{
  id: string;                    // UUID
  organization_id: string;       // UUID of the organization
  site_name: string;             // Display name for the help center
  site_description?: string;     // Description/tagline
  subdomain: string;             // Subdomain (e.g., 'acme' for acme.help.example.com)
  custom_domain?: string;        // Custom domain (e.g., 'support.acme.com')
  is_public: boolean;            // Whether help center is publicly accessible
  created_at: string;            // ISO timestamp
  updated_at: string;            // ISO timestamp
}

Get Settings

Retrieve the help center configuration. Admin only.

Procedure: helpCenter.getSettings

Authentication: Required (Admin)

Input: None

Example:

curl -X GET "https://your-domain.com/api/trpc/helpCenter.getSettings" \
  -H "Cookie: your-session-cookie"

Response:

{
  "result": {
    "data": {
      "json": {
        "id": "uuid",
        "organization_id": "org-uuid",
        "site_name": "Acme Support Center",
        "site_description": "Find answers to frequently asked questions",
        "subdomain": "acme",
        "custom_domain": "support.acme.com",
        "is_public": true,
        "created_at": "2024-01-01T00:00:00.000Z",
        "updated_at": "2024-01-15T10:30:00.000Z"
      }
    }
  }
}

Notes:

  • If no help center exists, one is automatically created with defaults from the organization

Update Settings

Update help center configuration. Admin only.

Procedure: helpCenter.updateSettings

Authentication: Required (Admin)

Input:

{
  siteName: string;              // 1-120 characters
  siteDescription?: string;      // Max 500 characters
  isPublic: boolean;             // Public visibility
  subdomain: string;             // 2-63 characters, URL-safe
  customDomain?: string;         // Optional custom domain
}

Example:

curl -X POST "https://your-domain.com/api/trpc/helpCenter.updateSettings" \
  -H "Content-Type: application/json" \
  -H "Cookie: your-session-cookie" \
  -d '{
    "json": {
      "siteName": "Acme Help Center",
      "siteDescription": "Get help with your Acme products",
      "isPublic": true,
      "subdomain": "acme-support",
      "customDomain": "help.acme.com"
    }
  }'

Response:

{
  "result": {
    "data": {
      "json": {
        "id": "uuid",
        "site_name": "Acme Help Center",
        "site_description": "Get help with your Acme products",
        "subdomain": "acme-support",
        "custom_domain": "help.acme.com",
        "is_public": true,
        "updated_at": "2024-01-15T11:00:00.000Z"
      }
    }
  }
}

Subdomain Rules

  • Must be 2-63 characters
  • Lowercase letters, numbers, and hyphens only
  • Cannot start or end with a hyphen
  • Reserved subdomains: www, app, admin, api, support, help, docs, kb

Custom Domain Rules

  • Must be a valid domain format (e.g., support.example.com)
  • Cannot use the same domain as the hosted help center
  • Requires DNS configuration (see below)

Check Domain Status

Check DNS and Vercel configuration for a custom domain. Admin only.

Procedure: helpCenter.checkDomainStatus

Authentication: Required (Admin)

Input:

{
  domain: string;  // Domain to check
}

Example:

curl -X GET "https://your-domain.com/api/trpc/helpCenter.checkDomainStatus?input=%7B%22domain%22:%22help.acme.com%22%7D" \
  -H "Cookie: your-session-cookie"

Response:

{
  "result": {
    "data": {
      "json": {
        "domain": "help.acme.com",
        "dns": {
          "configured": true,
          "error": null
        },
        "vercel": {
          "status": "verified",
          "error": null
        },
        "ready": true
      }
    }
  }
}

Vercel Status Values:

StatusDescription
not_addedDomain not added to Vercel
pendingAdded but not verified
verifiedDNS verified, domain active
errorConfiguration error

Add Domain to Vercel

Register a custom domain with Vercel hosting. Admin only.

Procedure: helpCenter.addDomainToVercel

Authentication: Required (Admin)

Input:

{
  domain: string;  // Domain to add
}

Example:

curl -X POST "https://your-domain.com/api/trpc/helpCenter.addDomainToVercel" \
  -H "Content-Type: application/json" \
  -H "Cookie: your-session-cookie" \
  -d '{"json":{"domain":"help.acme.com"}}'

Response:

{
  "result": {
    "data": {
      "json": {
        "success": true,
        "message": "Domain added successfully. DNS verification in progress.",
        "domain": "help.acme.com",
        "verified": false
      }
    }
  }
}

Prerequisites:

  • Domain must first be saved in help center settings
  • Domain cannot already be in use by another project

DNS Configuration

To use a custom domain, add a CNAME record:

TypeNameValue
CNAMEhelp (or your subdomain)cname.vercel-dns.com

Example DNS record:

help.acme.com.  IN  CNAME  cname.vercel-dns.com.

After adding the DNS record:

  1. Wait 1-24 hours for DNS propagation
  2. Use checkDomainStatus to verify configuration
  3. Call addDomainToVercel to complete setup

Help Center URLs

TypeURL Pattern
Subdomainhttps://{subdomain}.{base-domain}
Custom Domainhttps://{custom-domain}

Example URLs:

  • Subdomain: https://acme.help.relay.app
  • Custom: https://help.acme.com

Use Cases

Initial Setup

// Configure help center
await trpc.helpCenter.updateSettings.mutate({
  siteName: 'Acme Support',
  siteDescription: 'Find answers to your questions',
  subdomain: 'acme',
  isPublic: true,
})

Custom Domain Setup

// 1. Save domain in settings
await trpc.helpCenter.updateSettings.mutate({
  siteName: 'Acme Support',
  subdomain: 'acme',
  customDomain: 'help.acme.com',
  isPublic: true,
})

// 2. User configures DNS...

// 3. Check DNS status
const status = await trpc.helpCenter.checkDomainStatus.query({
  domain: 'help.acme.com',
})

if (status.dns.configured) {
  // 4. Add to Vercel
  await trpc.helpCenter.addDomainToVercel.mutate({
    domain: 'help.acme.com',
  })
}

Error Codes

CodeDescription
FORBIDDENOnly admins can manage help center
BAD_REQUESTInvalid subdomain or domain format
CONFLICTSubdomain or domain already in use
INTERNAL_SERVER_ERRORVercel integration not configured