Skip to content

Custom Domains API

Manage custom domains for webhook ingestion and tunnel endpoints.

Endpoints

MethodPathDescription
GET/api/custom-domainsList custom domains
POST/api/custom-domainsCreate custom domain
GET/api/custom-domains/{id}Get custom domain
DELETE/api/custom-domains/{id}Delete custom domain
POST/api/custom-domains/{id}/verifyVerify domain DNS

Custom Domain Object

json
{
  "id": "dom_abc123",
  "domain": "webhooks.yourapp.com",
  "type": "source",
  "status": "active",
  "sslStatus": "active",
  "verificationRecord": {
    "type": "CNAME",
    "name": "_hookbase-verify.webhooks.yourapp.com",
    "value": "verify.hookbase.app"
  },
  "cnameRecord": {
    "type": "CNAME",
    "name": "webhooks.yourapp.com",
    "value": "custom.hookbase.app"
  },
  "verifiedAt": "2024-01-15T10:30:00Z",
  "createdAt": "2024-01-01T00:00:00Z"
}

Domain Types

TypeDescription
sourceCustom domain for webhook ingestion URLs
tunnelCustom domain for tunnel endpoints

Domain Statuses

StatusDescription
pending_verificationDNS records not yet verified
activeDomain verified and serving traffic
ssl_pendingVerified, SSL certificate being provisioned
failedVerification failed

List Custom Domains

http
GET /api/custom-domains

Example

bash
curl https://api.hookbase.app/api/custom-domains \
  -H "Authorization: Bearer whr_your_api_key"

Response

json
{
  "data": [
    {
      "id": "dom_abc123",
      "domain": "webhooks.yourapp.com",
      "type": "source",
      "status": "active",
      "sslStatus": "active"
    }
  ]
}

Create Custom Domain

http
POST /api/custom-domains

Request Body

FieldTypeRequiredDescription
domainstringYesFully qualified domain name
typestringYesDomain type: source or tunnel

Example

bash
curl -X POST https://api.hookbase.app/api/custom-domains \
  -H "Authorization: Bearer whr_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "webhooks.yourapp.com",
    "type": "source"
  }'

Response

json
{
  "id": "dom_new123",
  "domain": "webhooks.yourapp.com",
  "type": "source",
  "status": "pending_verification",
  "verificationRecord": {
    "type": "CNAME",
    "name": "_hookbase-verify.webhooks.yourapp.com",
    "value": "verify.hookbase.app"
  },
  "cnameRecord": {
    "type": "CNAME",
    "name": "webhooks.yourapp.com",
    "value": "custom.hookbase.app"
  },
  "createdAt": "2024-01-15T10:30:00Z"
}

Add both DNS records to your domain provider before verifying.

Get Custom Domain

http
GET /api/custom-domains/{id}

Returns the full custom domain object.

Verify Domain

http
POST /api/custom-domains/{id}/verify

Checks DNS records and activates the domain if verification passes.

Example

bash
curl -X POST https://api.hookbase.app/api/custom-domains/dom_abc123/verify \
  -H "Authorization: Bearer whr_your_api_key"

Success Response

json
{
  "id": "dom_abc123",
  "domain": "webhooks.yourapp.com",
  "status": "active",
  "sslStatus": "active",
  "verifiedAt": "2024-01-15T10:30:00Z"
}

Failure Response

json
{
  "id": "dom_abc123",
  "domain": "webhooks.yourapp.com",
  "status": "failed",
  "error": "CNAME record not found. Expected: webhooks.yourapp.com → custom.hookbase.app"
}

Delete Custom Domain

http
DELETE /api/custom-domains/{id}

WARNING

Deleting a custom domain reverts all URLs to the default api.hookbase.app domain.

Example

bash
curl -X DELETE https://api.hookbase.app/api/custom-domains/dom_abc123 \
  -H "Authorization: Bearer whr_your_api_key"

Response

204 No Content

Error Responses

400 Bad Request

Invalid domain:

json
{
  "error": "Bad Request",
  "message": "Domain must be a valid fully qualified domain name",
  "code": "INVALID_DOMAIN"
}

409 Conflict

Domain already in use:

json
{
  "error": "Conflict",
  "message": "Domain 'webhooks.yourapp.com' is already registered",
  "code": "DOMAIN_IN_USE"
}

Released under the MIT License.