Set custom domain

PUT /api/apps/{appId}/site/domain
Assigns a custom domain to the app. Returns DNS instructions (A record and ACME challenge CNAME) that the user must configure.

Parameters

Name Type Description
appIdrequired string The app's unique identifier Example: -NtestApp123

Request Body

Name Type Description
domainrequired string Fully qualified domain name to assign to this site Max 253 characters Example: privacy.myapp.com

Responses

200 Domain assigned, DNS instructions returned
Name Type Description
dnsInstructions object[] DNS records that must be configured for the custom domain
type string DNS record type ACNAME
name string DNS record name (the domain or subdomain) Example: privacy.myapp.com
value string DNS record value (IP address or target hostname) Example: 34.120.1.2
400 Validation failed
Name Type Description
errorrequired object
coderequired string Machine-readable error code UNAUTHORIZEDFORBIDDENNOT_FOUNDVALIDATION_FAILEDRATE_LIMITEDSLUG_TAKENSLUG_RESERVEDDOMAIN_IN_USEAPP_LIMIT_REACHEDSUBSCRIPTION_REQUIREDSUBSCRIPTION_EXISTSNO_PAYMENT_METHODNO_ACTIVE_SUBSCRIPTIONNOT_CANCELINGALREADY_CANCELINGSUBSCRIPTION_CANCELINGSAME_PLANCARD_ERRORPAYMENT_ERRORNO_STRIPE_CUSTOMERCERT_CREATION_FAILEDDEPLOY_FAILEDAPI_KEY_LIMIT_REACHEDINVALID_IDEMPOTENCY_KEYIDEMPOTENCY_KEY_REUSEINTERNAL_ERROR
messagerequired string Human-readable error description
docUrl string (uri) Link to relevant API documentation for this error Example: https://orbitkit.io/api/errors/#unauthorized
details object[] Additional validation details (Zod errors)
401 Missing, invalid, or expired authentication token
Name Type Description
errorrequired object
coderequired string Machine-readable error code UNAUTHORIZEDFORBIDDENNOT_FOUNDVALIDATION_FAILEDRATE_LIMITEDSLUG_TAKENSLUG_RESERVEDDOMAIN_IN_USEAPP_LIMIT_REACHEDSUBSCRIPTION_REQUIREDSUBSCRIPTION_EXISTSNO_PAYMENT_METHODNO_ACTIVE_SUBSCRIPTIONNOT_CANCELINGALREADY_CANCELINGSUBSCRIPTION_CANCELINGSAME_PLANCARD_ERRORPAYMENT_ERRORNO_STRIPE_CUSTOMERCERT_CREATION_FAILEDDEPLOY_FAILEDAPI_KEY_LIMIT_REACHEDINVALID_IDEMPOTENCY_KEYIDEMPOTENCY_KEY_REUSEINTERNAL_ERROR
messagerequired string Human-readable error description
docUrl string (uri) Link to relevant API documentation for this error Example: https://orbitkit.io/api/errors/#unauthorized
details object[] Additional validation details (Zod errors)
409 Domain is already in use by another account
Name Type Description
errorrequired object
coderequired string Machine-readable error code UNAUTHORIZEDFORBIDDENNOT_FOUNDVALIDATION_FAILEDRATE_LIMITEDSLUG_TAKENSLUG_RESERVEDDOMAIN_IN_USEAPP_LIMIT_REACHEDSUBSCRIPTION_REQUIREDSUBSCRIPTION_EXISTSNO_PAYMENT_METHODNO_ACTIVE_SUBSCRIPTIONNOT_CANCELINGALREADY_CANCELINGSUBSCRIPTION_CANCELINGSAME_PLANCARD_ERRORPAYMENT_ERRORNO_STRIPE_CUSTOMERCERT_CREATION_FAILEDDEPLOY_FAILEDAPI_KEY_LIMIT_REACHEDINVALID_IDEMPOTENCY_KEYIDEMPOTENCY_KEY_REUSEINTERNAL_ERROR
messagerequired string Human-readable error description
docUrl string (uri) Link to relevant API documentation for this error Example: https://orbitkit.io/api/errors/#unauthorized
details object[] Additional validation details (Zod errors)
429 Too many requests
Name Type Description
errorrequired object
coderequired string Machine-readable error code UNAUTHORIZEDFORBIDDENNOT_FOUNDVALIDATION_FAILEDRATE_LIMITEDSLUG_TAKENSLUG_RESERVEDDOMAIN_IN_USEAPP_LIMIT_REACHEDSUBSCRIPTION_REQUIREDSUBSCRIPTION_EXISTSNO_PAYMENT_METHODNO_ACTIVE_SUBSCRIPTIONNOT_CANCELINGALREADY_CANCELINGSUBSCRIPTION_CANCELINGSAME_PLANCARD_ERRORPAYMENT_ERRORNO_STRIPE_CUSTOMERCERT_CREATION_FAILEDDEPLOY_FAILEDAPI_KEY_LIMIT_REACHEDINVALID_IDEMPOTENCY_KEYIDEMPOTENCY_KEY_REUSEINTERNAL_ERROR
messagerequired string Human-readable error description
docUrl string (uri) Link to relevant API documentation for this error Example: https://orbitkit.io/api/errors/#unauthorized
details object[] Additional validation details (Zod errors)
Language
URL
PUT https://api.orbitkit.io/api/apps/{appId}/site/domain
curl -X PUT "https://api.orbitkit.io/api/apps/-NtestApp123/site/domain" \
  -H "Authorization: Bearer $ORBITKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"privacy.myapp.com"}'
const response = await fetch(`https://api.orbitkit.io/api/apps/-NtestApp123/site/domain`, {
  method: "PUT",
  headers: {
    "Authorization": "Bearer " + apiKey,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
      "domain": "privacy.myapp.com"
  }),
});

const data = await response.json();
console.log(data);
var request = URLRequest(url: URL(string: "https://api.orbitkit.io/api/apps/-NtestApp123/site/domain")!)
request.httpMethod = "PUT"
request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let body: [String: Any] = ["domain": "privacy.myapp.com"]
request.httpBody = try JSONSerialization.data(withJSONObject: body)

let (data, _) = try await URLSession.shared.data(for: request)
let json = try JSONSerialization.jsonObject(with: data)
print(json)
200
{
  "dnsInstructions": [
    {
      "type": "A",
      "name": "privacy.myapp.com",
      "value": "34.120.1.2"
    }
  ]
}
400
{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Validation failed",
    "docUrl": "https://orbitkit.io/api/errors/#validation-failed",
    "details": [
      {
        "field": "appName",
        "message": "Required"
      }
    ]
  }
}
401
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired token",
    "docUrl": "https://orbitkit.io/api/errors/#unauthorized"
  }
}
409
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "string",
    "docUrl": "https://orbitkit.io/api/errors/#unauthorized",
    "details": []
  }
}
429
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests",
    "docUrl": "https://orbitkit.io/api/errors/#rate-limited"
  }
}