Skip to content

Make a domain the main address

Try it

Makes one connected domain the site's main address; the others send visitors there.

POST/api/v1/sites/{site_id}/domains/{domain_id}/primary

Authentication

An API key as Authorization: Bearer or x-api-key. It needs the domains:write scope — connect, check and remove domains.

domains:writeChanges the live siteIdempotency-Key requiredMCP tool: set_primary_domain

Parameters

Named placeholders go in the path; the rest in a JSON body.

site_idstringPath · required
The site's id.1 to 100 characters
domain_idstringPath · required
The domain's id.1 to 100 characters

Response

200 with JSON on success (schema on the right). Errors use the standard envelope; a retry with the same Idempotency-Key gets the first answer back (how retries work).

curl
curl -X POST 'https://websites.workflowcorp.com/api/v1/sites/SITE_ID/domains/DOMAIN_ID/primary' \
  -H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
Example arguments
{
  "site_id": "SITE_ID",
  "domain_id": "DOMAIN_ID"
}
Response schema
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "failed"
            ]
          },
          "primary": {
            "type": "boolean",
            "description": "The site's main address; the other domains send visitors here."
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_checked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the last check found wrong, in plain words."
          },
          "https": {
            "type": "object",
            "properties": {
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "provisioning, active, failed — null while HTTPS isn't set up or the domain isn't verified."
              },
              "error": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "status",
              "error"
            ],
            "additionalProperties": false
          },
          "dns_records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "why": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "name",
                "value",
                "why"
              ],
              "additionalProperties": false
            },
            "description": "What to add at the company the domain is registered with, then call check_domain."
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "hostname",
          "status",
          "primary",
          "verified_at",
          "last_checked_at",
          "last_error",
          "https",
          "dns_records",
          "created_at"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}