{
  "lexicon": 1,
  "id": "org.tangled.temp.site.claimDomain",
  "defs": {
    "main": {
      "type": "procedure",
      "description": "Claim a full sites domain (e.g. alice.tngl.io) for the authenticated user. A claim is one per account. tngl.sh handles require confirmation from the handle authority and cannot be released.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["domain"],
          "properties": {
            "domain": {
              "type": "string",
              "description": "Full domain to claim, e.g. alice.tngl.io. Label rules: 1-63 lowercase letters, digits and hyphens, no leading/trailing hyphen."
            }
          }
        }
      },
      "errors": [
        { "name": "DomainTaken", "description": "That domain is already claimed by another user." },
        { "name": "DomainCooldown", "description": "That domain was recently released and is in a 30-day cooldown period." },
        { "name": "AlreadyClaimed", "description": "You already have a domain claimed. Release it before claiming a new one." },
        { "name": "InvalidSubdomain", "description": "The domain label or TLD is invalid." },
        { "name": "HandleNotOwned", "description": "The handle authority identifies a different account." },
        { "name": "HandleUnknown", "description": "The handle authority does not know this handle." }
      ]
    }
  }
}