Organizations

Add a custom domain

Creates a pending domain row; the response **`domain`** uses the compact **`OrgDomainEntryOrgConsole`** shape (**`dnsRecords`** includes the Mudbase ownership TXT). **`dnsRecords`** may include the Mudbase TXT and routing CNAME only until the Mudbase TXT succeeds and the managed certificate is provisioned. **`flyCertificateStatus`** is typically omitted until certificate provisioning runs after the first successful **`verify-dns`**.

AuthBearer (JWT)
GroupOrganizations
Rate limitSee Rate Limits
POST/api/orgs/{orgId}/projects/{projectId}/domains

SDK setup

Create a client and set credentials (JWT and/or API key) before calling the API. Match the authentication type shown above.

import { Configuration, OrganizationsApi } from 'mudbase-sdk';

const configuration = new Configuration({
  basePath: 'https://cloud.mudbase.dev',
  accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});

const organizations = new OrganizationsApi(configuration);

Example request

Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.

const { data: result } = await organizations.addOrgCustomDomain(
  "org_Rz0CZqHebQ",
  "proj_whP3ilt7jCle",
  {
    hostname: "Mindy Prosacco",
    setPrimary: true
  }
);

Playground

live

Test this endpoint with your own credentials. Your requests will be sent to the live API.

Use the auth endpoints to obtain a JWT.

No Request Yet

Send a request to see the full inspector

Authentication

Requires JWT
Note
Include your JWT in the Authorization: Bearer YOUR_TOKEN header (user-facing apps, RBAC). View authentication guide →

Path Parameters

NameTypeRequiredDescription
orgIdstringYes-
projectIdstringYes-

Request Body

json
{
  "hostname": "Loma Rutherford",
  "setPrimary": true
}

Responses

201Domain created; includes dnsRecords and human-readable instructions (no extra GET required).
json
{
  "success": true,
  "domain": {
    "_id": "hZnryo8KvYooSGj4",
    "hostname": "Isaias Mann",
    "status": "bandwidth quantify",
    "isPrimary": false,
    "source": "api",
    "createdAt": "2026-09-20T17:23:20.460Z",
    "verifiedAt": "2026-09-25T08:09:21.522Z",
    "lastVerifiedAt": "2026-08-20T03:57:53.854Z",
    "cnameSubmittedAt": "2026-08-14T20:48:01.472Z",
    "cnameApprovedAt": "2026-08-27T16:37:23.978Z",
    "customDomainVerificationStep": 67788,
    "routingCnameTarget": "Katrina Crona",
    "dnsRecords": [
      {
        "type": "hard drive quantify",
        "name": "Jacky Howe",
        "value": "microchip parse",
        "purpose": "feed navigate"
      }
    ],
    "platformActivationPending": false,
    "customDomainLiveForApiTraffic": true,
    "edge": {
      "saasIntegrationEnabled": true,
      "skipped": true,
      "reason": "monitor compress",
      "customHostnameId": "Alexandrine Casper DVM",
      "hostnameStatus": "Jermey Marks",
      "sslStatus": "array hack",
      "ownershipVerification": {
        "name": "Alejandro Bode MD",
        "type": "interface reboot",
        "value": "sensor program"
      },
      "sslValidationRecords": [
        {
          "txtName": "Crawford Huels",
          "txtValue": "bandwidth program",
          "httpUrl": "https://unpleasant-heartache.net/",
          "httpBody": "monitor navigate",
          "cname": "Leigh Kohler",
          "cnameTarget": "Emily Conn"
        }
      ],
      "lastError": "port compress",
      "instructions": "interface input"
    },
    "flyCertificateStatus": "driver synthesize",
    "platformDnsVerification": {
      "recordType": "circuit navigate",
      "recordName": "Toby Mosciski",
      "recordValue": "circuit override",
      "ttlSeconds": 91387,
      "staffNote": "alarm quantify",
      "updatedAt": "2026-09-26T02:42:51.612Z"
    },
    "platformDnsVerificationSubmittedAt": "2026-09-11T05:41:23.972Z"
  },
  "dnsVerificationInstructions": "bandwidth reboot"
}
400Validation, limit, or hostname_in_use
429domain_rate_limited

Errors

CodeMeaning
400Validation, limit, or hostname_in_use
429domain_rate_limited
Edit this page on GitHub
Chat with us