{
 "openapi": "3.1.0",
 "info": {
  "title": "CuriosDomains API",
  "version": "1.0.0",
  "description": "Search, buy, transfer, renew and manage domains. Authenticate with `Authorization: Bearer cd_live_...`. Purchases are two-step: create a quote, then confirm it as an order. Prices are in USD. Send an `Idempotency-Key` header on POST /v1/orders to make retries safe. Also sells SSL certificates, ACME subscriptions, SiteLock and Premium DNS through the same quote/order flow. Resellers can act for their sub-customers with the X-Client-Id header; see the Resellers section of the developer guide."
 },
 "servers": [
  {
   "url": "https://curiosdomains.com"
  }
 ],
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/v1/pricing": {
   "get": {
    "summary": "Price list for every extension",
    "tags": [
     "Catalogue"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Pricing"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "security": []
   }
  },
  "/v1/domains/check": {
   "get": {
    "summary": "Check availability",
    "tags": [
     "Catalogue"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Search"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Bare name or full domain"
     },
     {
      "name": "tlds",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Comma-separated extensions, e.g. com,io"
     }
    ],
    "security": []
   }
  },
  "/v1/account": {
   "get": {
    "summary": "Account overview",
    "tags": [
     "Account"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Account"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/account/contact": {
   "put": {
    "summary": "Set registrant contact (required before buying)",
    "tags": [
     "Account"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Contact"
       }
      }
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/account/keys": {
   "get": {
    "summary": "List API keys",
    "tags": [
     "Account"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Create an API key (shown once)",
    "tags": [
     "Account"
    ],
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "label": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/account/keys/{prefix}": {
   "delete": {
    "summary": "Revoke an API key",
    "tags": [
     "Account"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "prefix",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/v1/quotes": {
   "post": {
    "summary": "Quote a registration, transfer or renewal",
    "tags": [
     "Orders"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Quote"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Returns a single-use confirmationToken valid for 15 minutes. Nothing is bought.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/QuoteRequest"
       }
      }
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/orders": {
   "post": {
    "summary": "Confirm a quote and buy",
    "tags": [
     "Orders"
    ],
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Order"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Charges your prepaid balance. 402 insufficient_balance if it's too low; 409 price_changed if the registry price rose since the quote.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "confirmationToken"
        ],
        "properties": {
         "confirmationToken": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/domains": {
   "get": {
    "summary": "List your domains",
    "tags": [
     "Domains"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/domains/{domain}": {
   "get": {
    "summary": "Domain details",
    "tags": [
     "Domains"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Domain"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.com"
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   },
   "patch": {
    "summary": "Change nameservers, auto-renew, privacy or transfer lock",
    "tags": [
     "Domains"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Domain"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DomainPatch"
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.com"
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/domains/{domain}/authcode": {
   "get": {
    "summary": "Get the transfer authorisation (EPP) code",
    "tags": [
     "Domains"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.com"
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/domains/{domain}/dns": {
   "get": {
    "summary": "List DNS records",
    "tags": [
     "DNS"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Dns"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.com"
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   },
   "put": {
    "summary": "Replace all DNS records",
    "tags": [
     "DNS"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Dns"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "records"
        ],
        "properties": {
         "records": {
          "type": "array",
          "items": {
           "$ref": "#/components/schemas/Record"
          }
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.com"
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/domains/{domain}/dns/records": {
   "post": {
    "summary": "Add a DNS record",
    "tags": [
     "DNS"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Dns"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Record"
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.com"
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   },
   "delete": {
    "summary": "Delete a DNS record",
    "tags": [
     "DNS"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Dns"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "type"
        ],
        "properties": {
         "name": {
          "type": "string"
         },
         "type": {
          "type": "string"
         },
         "content": {
          "type": "string",
          "description": "Needed when several records match"
         }
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.com"
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/products": {
   "get": {
    "summary": "SSL, ACME, SiteLock, Premium DNS and DNSSEC catalogue with prices",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "security": []
   }
  },
  "/v1/ssl": {
   "get": {
    "summary": "List SSL certificates",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/ssl/{id}": {
   "get": {
    "summary": "Certificate status and validation steps",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   },
   "delete": {
    "summary": "Revoke a certificate",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "reason": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/ssl/{id}/download": {
   "get": {
    "summary": "Download certificate files",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/x-pem-file": {},
       "application/zip": {}
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "crt",
        "ca_bundle",
        "ca",
        "pkcs7",
        "zip"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/ssl/{id}/reissue": {
   "post": {
    "summary": "Reissue with a new CSR (free)",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "csr"
        ],
        "properties": {
         "csr": {
          "type": "string"
         },
         "validationMethod": {
          "type": "string",
          "enum": [
           "DNS",
           "EMAIL",
           "FILE"
          ]
         },
         "validationEmail": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/acme": {
   "get": {
    "summary": "List ACME subscriptions",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/acme/{id}": {
   "get": {
    "summary": "ACME subscription details",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   },
   "delete": {
    "summary": "Cancel an ACME subscription",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/acme/{id}/credentials": {
   "post": {
    "summary": "Generate new EAB credentials",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/sitelock": {
   "get": {
    "summary": "List SiteLock sites",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/sitelock/{domain}/login": {
   "post": {
    "summary": "Single-use SiteLock dashboard link",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/sitelock/{domain}": {
   "delete": {
    "summary": "Remove SiteLock from a site",
    "tags": [
     "Add-ons"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "$ref": "#/components/parameters/XClientId"
     }
    ]
   }
  },
  "/v1/clients": {
   "get": {
    "summary": "List sub-customers",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. Returns each sub-customer with its domain count.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ClientList"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Create a sub-customer",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. Send the registrant details. Returns the new sub-customer's ID, which you use with the X-Client-Id header.",
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Client"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Contact"
       }
      }
     }
    }
   }
  },
  "/v1/clients/{id}": {
   "get": {
    "summary": "Get a sub-customer",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Client"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Sub-customer ID, for example acct_3f9a1c2b8d4e5f60."
     }
    ]
   },
   "put": {
    "summary": "Update a sub-customer",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. Send the full registrant details. The email can't be changed.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Client"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Sub-customer ID, for example acct_3f9a1c2b8d4e5f60."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Contact"
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Remove a sub-customer",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. 409 client_has_domains while it still owns domains.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Sub-customer ID, for example acct_3f9a1c2b8d4e5f60."
     }
    ]
   }
  },
  "/v1/reseller": {
   "get": {
    "summary": "Reseller settings and earnings",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Reseller"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "put": {
    "summary": "Set your markup",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. Applies to new quotes for sub-customers. Earnings are recorded, not added to credit.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "markupPercent": {
          "type": "number",
          "minimum": 0,
          "maximum": 300
         },
         "markupFixed": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Dollars per order"
         },
         "invoiceBranding": {
          "$ref": "#/components/schemas/Reseller/properties/invoiceBranding"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Reseller"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/clients/{id}/invite": {
   "post": {
    "summary": "Invite a sub-customer to sign in",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. Emails the invitation when email is set up; otherwise returns the link once. The link works once and expires in 7 days.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Sub-customer ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "emailed": {
           "type": "boolean"
          },
          "url": {
           "type": "string"
          },
          "expiresInDays": {
           "type": "integer"
          },
          "note": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/clients/{id}/login": {
   "delete": {
    "summary": "Stop a sub-customer signing in",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. Ends their sessions and keys. Their domains stay with them.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Sub-customer ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Object"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/invoices": {
   "get": {
    "summary": "List invoices",
    "tags": [
     "Resellers"
    ],
    "description": "Your sub-customers' invoices (resellers) or your own (sub-customers). The fields you see depend on your role.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "invoices": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Invoice"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/invoices/{id}": {
   "get": {
    "summary": "Get an invoice",
    "tags": [
     "Resellers"
    ],
    "description": "One invoice you're allowed to see.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Invoice"
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/payouts": {
   "get": {
    "summary": "Earnings and payouts",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "earnings": {
           "$ref": "#/components/schemas/Money"
          },
          "payouts": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Payout"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Request a payout",
    "tags": [
     "Resellers"
    ],
    "description": "Reseller accounts only. Needs at least $10.00 in earnings and no payout already waiting. Sends all current earnings.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "note": {
          "type": "string",
          "maxLength": 300
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "payout": {
           "$ref": "#/components/schemas/Payout"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/reseller/status": {
   "get": {
    "tags": [
     "Reseller"
    ],
    "summary": "Your reseller status, webhook, sub-customer count and balance",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Missing or revoked key"
     }
    }
   }
  },
  "/v1/reseller/apply": {
   "post": {
    "tags": [
     "Reseller"
    ],
    "summary": "Become a reseller (approved instantly)",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Missing or revoked key"
     }
    },
    "description": "Returns apiKey and webhookSecret once.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "company",
         "about"
        ],
        "properties": {
         "company": {
          "type": "string",
          "minLength": 2,
          "maxLength": 100
         },
         "website": {
          "type": "string",
          "maxLength": 200
         },
         "about": {
          "type": "string",
          "minLength": 20,
          "maxLength": 1000
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/reseller/webhook": {
   "put": {
    "tags": [
     "Reseller"
    ],
    "summary": "Set the webhook address",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Missing or revoked key"
     }
    },
    "description": "Empty string turns webhooks off.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "webhookUrl": {
          "type": "string",
          "format": "uri"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/reseller/webhook/secret": {
   "post": {
    "tags": [
     "Reseller"
    ],
    "summary": "Create a new webhook signing secret (shown once)",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Missing or revoked key"
     }
    }
   }
  },
  "/v1/reseller/webhook/test": {
   "post": {
    "tags": [
     "Reseller"
    ],
    "summary": "Send a signed webhook.test event",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Missing or revoked key"
     }
    }
   }
  },
  "/v1/credit/top-ups": {
   "get": {
    "tags": [
     "Account"
    ],
    "summary": "Payment links to top up your balance",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "Missing or revoked key"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "Object": {
    "type": "object"
   },
   "Money": {
    "type": "object",
    "properties": {
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": "string",
      "example": "USD"
     }
    }
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string",
        "example": "domain_not_found"
       },
       "message": {
        "type": "string"
       },
       "details": {
        "type": "object"
       }
      }
     }
    }
   },
   "Pricing": {
    "type": "object",
    "properties": {
     "currency": {
      "type": "string"
     },
     "tlds": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "tld": {
         "type": "string"
        },
        "register": {
         "type": "number"
        },
        "renew": {
         "type": "number"
        },
        "transfer": {
         "type": [
          "number",
          "null"
         ]
        },
        "promo": {
         "type": "boolean"
        }
       }
      }
     }
    }
   },
   "Search": {
    "type": "object",
    "properties": {
     "currency": {
      "type": "string"
     },
     "results": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "domain": {
         "type": "string"
        },
        "available": {
         "type": [
          "boolean",
          "null"
         ]
        },
        "premium": {
         "type": "boolean"
        },
        "price": {
         "type": "number"
        },
        "renewalPrice": {
         "type": "number"
        }
       }
      }
     }
    }
   },
   "Account": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "balance": {
      "$ref": "#/components/schemas/Money"
     },
     "testMode": {
      "type": "boolean"
     },
     "registrantContact": {
      "type": [
       "object",
       "null"
      ]
     },
     "domains": {
      "type": "integer"
     }
    }
   },
   "Contact": {
    "type": "object",
    "required": [
     "firstName",
     "lastName",
     "email",
     "phone",
     "address",
     "city",
     "postcode",
     "country"
    ],
    "properties": {
     "firstName": {
      "type": "string"
     },
     "lastName": {
      "type": "string"
     },
     "organization": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "phone": {
      "type": "string"
     },
     "address": {
      "type": "string"
     },
     "city": {
      "type": "string"
     },
     "state": {
      "type": "string"
     },
     "postcode": {
      "type": "string"
     },
     "country": {
      "type": "string"
     }
    }
   },
   "QuoteRequest": {
    "type": "object",
    "required": [
     "action"
    ],
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "register",
       "transfer",
       "renew",
       "ssl",
       "ssl_renew",
       "acme",
       "acme_renew",
       "sitelock",
       "premium_dns"
      ]
     },
     "domain": {
      "type": "string"
     },
     "years": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10
     },
     "authcode": {
      "type": "string",
      "description": "Transfers only"
     },
     "product": {
      "type": "string"
     },
     "csr": {
      "type": "string"
     },
     "san": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "validationMethod": {
      "type": "string",
      "enum": [
       "DNS",
       "EMAIL",
       "FILE"
      ]
     },
     "validationEmail": {
      "type": "string"
     },
     "domainNames": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "plan": {
      "type": "string"
     },
     "id": {
      "type": "string",
      "description": "ssl_renew/acme_renew"
     }
    }
   },
   "Quote": {
    "type": "object",
    "properties": {
     "confirmationToken": {
      "type": "string"
     },
     "action": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "years": {
      "type": "integer"
     },
     "total": {
      "$ref": "#/components/schemas/Money"
     },
     "renewalPricePerYear": {
      "$ref": "#/components/schemas/Money"
     },
     "premium": {
      "type": "boolean"
     },
     "expiresAt": {
      "type": "string",
      "format": "date-time"
     },
     "description": {
      "type": "string"
     }
    }
   },
   "Order": {
    "type": "object",
    "properties": {
     "reference": {
      "type": "string"
     },
     "action": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "enum": [
       "registered",
       "renewed",
       "pending",
       "transferred",
       "transfer_pending"
      ]
     },
     "charged": {
      "$ref": "#/components/schemas/Money"
     },
     "price": {
      "$ref": "#/components/schemas/Money"
     },
     "expiresAt": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "Domain": {
    "type": "object",
    "properties": {
     "domain": {
      "type": "string"
     },
     "status": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "expiresAt": {
      "type": "string"
     },
     "autoRenew": {
      "type": "boolean"
     },
     "privacyProtect": {
      "type": "boolean"
     },
     "transferLock": {
      "type": "boolean"
     },
     "nameservers": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "dnsHostedHere": {
      "type": "boolean"
     }
    }
   },
   "DomainPatch": {
    "type": "object",
    "properties": {
     "nameservers": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "autoRenew": {
      "type": "boolean"
     },
     "privacyProtect": {
      "type": "boolean"
     },
     "transferLock": {
      "type": "boolean"
     },
     "dnssec": {
      "type": "boolean"
     },
     "premiumDns": {
      "type": "boolean",
      "description": "false to switch back to free DNS; upgrading needs a premium_dns quote"
     }
    }
   },
   "Record": {
    "type": "object",
    "required": [
     "name",
     "type",
     "content"
    ],
    "properties": {
     "name": {
      "type": "string",
      "description": "\"@\", \"www\" or fully qualified"
     },
     "type": {
      "type": "string",
      "example": "A"
     },
     "content": {
      "type": "string"
     },
     "ttl": {
      "type": "integer"
     },
     "priority": {
      "type": "integer"
     }
    }
   },
   "Dns": {
    "type": "object",
    "properties": {
     "domain": {
      "type": "string"
     },
     "records": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Record"
      }
     },
     "defaultRecords": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Record"
      }
     }
    }
   },
   "Client": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "acct_3f9a1c2b8d4e5f60"
     },
     "email": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "domains": {
      "type": "integer"
     },
     "contact": {
      "type": "object",
      "nullable": true
     },
     "created": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "ClientList": {
    "type": "object",
    "properties": {
     "clients": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Client"
      }
     }
    }
   },
   "Reseller": {
    "type": "object",
    "properties": {
     "markupPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 300
     },
     "markupFixed": {
      "$ref": "#/components/schemas/Money"
     },
     "earnings": {
      "$ref": "#/components/schemas/Money"
     },
     "subCustomers": {
      "type": "integer"
     },
     "invoiceBranding": {
      "type": "object",
      "description": "Used on invoices. Send in PUT /v1/reseller.",
      "properties": {
       "brandName": {
        "type": "string",
        "maxLength": 80
       },
       "companyAddress": {
        "type": "string",
        "maxLength": 300
       },
       "taxNumber": {
        "type": "string",
        "maxLength": 60
       },
       "invoiceFooter": {
        "type": "string",
        "maxLength": 300
       }
      }
     }
    }
   },
   "Invoice": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "number": {
      "type": "string",
      "example": "INV-00001"
     },
     "issued": {
      "type": "string",
      "format": "date-time"
     },
     "description": {
      "type": "string"
     },
     "total": {
      "$ref": "#/components/schemas/Money"
     },
     "reference": {
      "type": "string"
     },
     "client": {
      "type": "object",
      "description": "Resellers only",
      "properties": {
       "id": {
        "type": "string"
       },
       "email": {
        "type": "string"
       },
       "name": {
        "type": "string"
       }
      }
     },
     "markup": {
      "$ref": "#/components/schemas/Money",
      "description": "Resellers only"
     },
     "billTo": {
      "type": "object",
      "description": "Sub-customers only",
      "properties": {
       "name": {
        "type": "string"
       },
       "organization": {
        "type": "string",
        "nullable": true
       }
      }
     },
     "websitePrice": {
      "$ref": "#/components/schemas/Money",
      "description": "Resellers only"
     }
    }
   },
   "Payout": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "amount": {
      "$ref": "#/components/schemas/Money"
     },
     "status": {
      "type": "string",
      "enum": [
       "requested",
       "paid",
       "cancelled"
      ]
     },
     "requested": {
      "type": "string",
      "format": "date-time"
     },
     "paid": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "note": {
      "type": "string"
     }
    }
   }
  },
  "parameters": {
   "XClientId": {
    "name": "X-Client-Id",
    "in": "header",
    "required": false,
    "description": "Act for one of your reseller sub-customers. Its domains are used and purchases are charged to your credit. Reseller accounts only.",
    "schema": {
     "type": "string",
     "example": "acct_3f9a1c2b8d4e5f60"
    }
   }
  }
 }
}
