Skip to main content
PATCH
/
domain
/
{id}
Update domain settings
curl --request PATCH \
  --url https://api.h0p.co/domain/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "indexUrl": "https://example.com",
  "fallbackUrl": "https://example.com/404",
  "qrCode": {
    "options": {
      "data": "",
      "width": 300,
      "dotsOptions": {
        "color": "#000000"
      }
    },
    "imageId": null
  }
}
'
{
  "id": "01933eb8-541f-7000-a9f4-e4eee80ff04e",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-16T14:20:00Z",
  "organizationId": "01933eb8-541f-7000-a9f4-e4eee80ff04e",
  "domain": "links.example.com",
  "isActive": true,
  "lastCheckedAt": "2024-01-15T10:35:00Z",
  "isVerified": true,
  "txtRecord": "_vercel=1234567890abcdef",
  "isPrimary": true,
  "qrCodeId": "01933eb8-541f-7000-a9f4-e4eee80ff04e",
  "fallbackUrl": "https://example.com/404",
  "appleAppSiteAssociation": {},
  "androidAssetLinks": {},
  "qrCode": {
    "options": {
      "data": "https://example.com/abc123",
      "type": "svg",
      "width": 300,
      "height": 300,
      "margin": 4,
      "image": "https://example.com/logo.png",
      "imageOptions": {
        "hideBackgroundDots": true,
        "imageSize": 0.4,
        "crossOrigin": "anonymous",
        "margin": 10
      },
      "dotsOptions": {
        "type": "rounded",
        "color": "#000000",
        "gradient": {
          "type": "linear",
          "colorStops": [
            {
              "offset": 0,
              "color": "#3B82F6"
            },
            {
              "offset": 1,
              "color": "#8B5CF6"
            }
          ],
          "rotation": 45
        },
        "roundSize": true
      },
      "cornersSquareOptions": {
        "type": "square",
        "color": "#3B82F6",
        "gradient": {
          "type": "linear",
          "colorStops": [
            {
              "offset": 0,
              "color": "#3B82F6"
            },
            {
              "offset": 1,
              "color": "#8B5CF6"
            }
          ],
          "rotation": 45
        }
      },
      "cornersDotOptions": {
        "type": "dot",
        "color": "#8B5CF6",
        "gradient": {
          "type": "linear",
          "colorStops": [
            {
              "offset": 0,
              "color": "#3B82F6"
            },
            {
              "offset": 1,
              "color": "#8B5CF6"
            }
          ],
          "rotation": 45
        }
      },
      "backgroundOptions": {
        "round": 0.1,
        "color": "#FFFFFF"
      }
    },
    "imageId": "01933eb8-541f-7000-a9f4-e4eee80ff04e"
  }
}

Authorizations

x-api-key
string
header
required

API Key authentication for programmatic access.

How to use:

  1. Create an API key from your dashboard settings
  2. Include the key in the x-api-key header with each request
  3. API keys have granular permissions (domains, shortLinks, files, stats, apiKeys)

Example:

curl -H "x-api-key: your-api-key-here" https://api.h0p.co/short-link/list

Types of API keys:

  • User keys: Linked to your user account (one per organization)
  • Bot keys: Autonomous machine users (one per organization)

Security notes:

  • Keep your API keys secure and never commit them to version control
  • API keys cannot access authentication endpoints (/auth/*)
  • Keys can be revoked at any time from the dashboard

Path Parameters

id
string<uuid>
required

Unique identifier in UUID v7 format

Example:

"01933eb8-541f-7000-a9f4-e4eee80ff04e"

Body

application/json

Domain settings to update (partial update supported)

Domain update request

fallbackUrl
string<uri> | null
required

Fallback URL for invalid/deleted short links

Example:

"https://example.com/404"

qrCode
object

Default QR code template for all links on this domain

indexUrl
string<uri> | null

URL to redirect to when accessing domain root

Example:

"https://example.com"

appleAppSiteAssociation
object

Apple App Site Association JSON for deep linking

Example:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TEAMID.com.example.app",
"paths": ["*"]
}
]
}
}

Android Asset Links JSON for deep linking

Example:
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.example.app",
"sha256_cert_fingerprints": [
"AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF"
]
}
}
]

Response

Domain settings updated successfully

Complete domain object with all fields

id
string<uuid>
required

Domain UUID

Example:

"01933eb8-541f-7000-a9f4-e4eee80ff04e"

createdAt
string<date-time>
required

Creation timestamp

Example:

"2024-01-15T10:30:00Z"

updatedAt
string<date-time>
required

Last update timestamp

Example:

"2024-01-16T14:20:00Z"

organizationId
string<uuid> | null
required

Organization UUID

Example:

"01933eb8-541f-7000-a9f4-e4eee80ff04e"

domain
string
required

Domain name

Example:

"links.example.com"

isActive
boolean
required

Whether domain is active

Example:

true

lastCheckedAt
string<date-time> | null
required

Last DNS check timestamp

Example:

"2024-01-15T10:35:00Z"

isVerified
boolean
required

Complete verification status

Example:

true

txtRecord
string | null
required

TXT record value for DNS verification

Example:

"_vercel=1234567890abcdef"

isPrimary
boolean
required

Primary domain status

Example:

true

qrCodeId
string<uuid> | null
required

QR code template UUID

Example:

"01933eb8-541f-7000-a9f4-e4eee80ff04e"

fallbackUrl
string<uri> | null
required

Fallback URL for 404s

Example:

"https://example.com/404"

appleAppSiteAssociation
object
required

Apple Universal Links config

Android App Links config

qrCode
object

Default QR code template