1. Domains
my.host API
  • Getting started
    • Introduction
    • Base url
    • Authentication
    • Response codes
    • Changelog
  • Domains
    • Domains
      • DNS
        • Zone
          • Get DNS zonefile
          • Import DNS zonefile
        • Dynamic DNS
          • List Dynamic DNS credentials
          • Create Dynamic DNS credential
          • Delete Dynamic DNS credential
          • Reset Dynamic DNS password
        • Get DNS records
        • Update DNS records
        • Update single DNS record
        • Delete single DNS record
        • Add single DNS record
        • Get DNS history
      • List domains
      • Get domain
      • Update domain
      • Cancel domain
      • Cancel domain deletion
      • Get auth code
      • Retry registration or transfer
      • Resend owner verification
    • Contacts
      • List profiles
      • Get profile
      • Create profile
      • Update profile
      • Delete profile
      • Get profile
      • Update profile
    • Nameservers
      • List profiles
      • Get profile
      • Create profile
      • Update profile
      • Delete profile
    • DNS templates
      • List templates
      • Get template
      • Create template
      • Update template
      • Delete template
    • Availability
      • Check domain availability
      • Check availability of several domains
    • Order
      • Order domain
    • Extensions
      • List domain extensions
      • Get domain extension
  • Web hosting
    • Domains
      • List domains
        GET
      • Add domain
        POST
      • Delete domain
        DELETE
      • Add pointer or alias
        POST
      • Delete pointer or alias
        DELETE
      • List subdomains
        GET
      • Add subdomain
        POST
      • Delete subdomain
        DELETE
      • HTTPS redirect
        GET
      • Turn HTTPS redirect on or off
        PUT
      • List DNS records
        GET
      • Add DNS record
        POST
      • Delete DNS record
        DELETE
      • Rename domain
        PUT
      • List redirects
        GET
      • Add redirect
        POST
      • Delete redirect
        DELETE
      • Hotlink protection
        GET
      • Change hotlink protection
        PUT
    • SSL
      • SSL status of all domains
      • SSL status of a domain
      • Install own certificate
      • Create CSR
      • Request free certificate
    • PHP
      • PHP settings
      • Change PHP settings
    • E-mail
      • List forwarders
      • Create forwarder
      • Change forwarder
      • Delete forwarder
      • List mailboxes
      • Create mailbox
      • Get mailbox
      • Change mailbox
      • Delete mailbox
      • Get autoreply
      • Set autoreply
      • Delete autoreply
      • Get catch-all
      • Set catch-all
      • Get mail settings
      • Change mail settings
    • Databases
      • List databases
      • Create database
      • Delete database
      • Change database password
      • List database users
      • Create database user
      • Delete database user
      • Database privileges
      • Change database privileges
      • List database access hosts
      • Add database access host
      • Delete database access host
    • FTP
      • List FTP accounts
      • Create FTP account
      • Change FTP account
      • Delete FTP account
    • Cron jobs
      • List cron jobs
      • Create cron job
      • Change cron job
      • Delete cron job
    • WordPress
      • List WordPress sites
      • Install WordPress
      • Rescan WordPress sites
      • Get WordPress site
      • Delete WordPress site
      • Purge cache
      • Clone WordPress site
      • List plugins
      • Install plugin
      • Activate or deactivate plugin
      • Delete plugin
      • Push staging to live
      • Change WordPress settings
      • Create staging site
      • List themes
      • Install theme
      • Activate theme
      • Delete theme
      • Update WordPress
    • Reseller
      • List reseller packages
      • Create reseller package
      • Change reseller package
      • Delete reseller package
      • List reseller users
      • Create reseller user
      • Delete reseller user
    • Orders
      • Order a hosting package
      • Quote a hosting package
      • Order extra disk space
      • Reduce extra disk space
      • Quote extra disk space
      • Change package
      • Quote a package change
    • Backups
      • List backups
      • Get backup
      • Restore backup
      • List files in backup
    • Apps
      • List apps
      • Create app
      • Change app
      • Delete app
      • Restart app
      • Install app modules
    • Files
      • List files
      • Delete file or folder
      • Get file content
      • Write file
      • Create folder
      • Move or rename
      • Copy
      • Change permissions
      • Extract archive
      • Create archive
      • Get folder protection
      • Set folder protection
      • Remove protection user
    • Git
      • List Git repositories
      • Create Git repository
      • Get Git repository
      • Change Git repository
      • Delete Git repository
      • Deploy Git repository
      • Fetch Git repository
      • List Git commits
    • List hosting packages
      GET
    • List hosting products
      GET
    • Get hosting package
      GET
    • Cancel hosting package
      DELETE
    • Withdraw cancellation
      PUT
    • Web server logs
      GET
    • Reset account password
      POST
    • SSH access
      GET
    • Turn SSH access on or off
      PUT
    • Usage history
      GET
    • Create login link
      POST
    • Resource usage
      GET
    • Malware found
      GET
    • List SSH keys
      GET
    • Add SSH key
      POST
    • Delete SSH key
      DELETE
    • Redis
      GET
    • Turn Redis on or off
      PUT
  • Virtual Private Servers
    • Backups
      • List backups
      • Create backup
      • Restore backup
      • Delete backup
    • SSH keys
      • List SSH keys
      • Delete SSH key
      • Add SSH key
    • Firewall
      • Get VPS firewall
      • Update VPS firewall
    • VPC
      • Get VPS VPC
      • Create VPS VPC
      • Add VPC subnet
      • Attach VPC subnet
    • Order
      • List VPS products
      • Order VPS
    • Floating IPs
      • List floating IPs
      • Reserve floating IP
      • Attach floating IP
      • Detach floating IP
      • Delete floating IP
    • Volumes
      • List volumes
      • Create volume
      • Attach volume
      • Detach volume
      • Resize volume
      • Delete volume
    • List VPS instances
    • VPS details
    • Update VPS
    • Restart VPS
    • Enable or disable rescue mode
    • Cancel VPS
    • Cancel VPS deletion
    • List available OS images
    • Reinstall VPS
    • Start VPS
    • Stop VPS
    • Power off VPS
    • Reset VPS root password
    • Change VPS hostname
    • Get VPS statistics
    • List VPS licenses
    • Create console link
  • Certificates
    • List certificates
    • Get certificate
    • List certificate products
    • Order certificate
    • Generate CSR
    • Request certificate
  • Orders
    • List orders
    • Get order
    • Update order
  • Affiliate
    • Commissions
      • List affiliate commissions
      • Get affiliate commission
    • Payments
      • List affiliate payments
      • Get affiliate payment
  • Account
    • Profile
      • Get account profile
      • Update account profile
    • Payment methods
      • List payment methods
      • Update default payment method
    • Invoices
      • List invoices
      • Get invoice
      • Download invoice PDF
    • Users
      • List account users
      • Get account user
      • Create account user
      • Update account user
    • Tickets
      • List support tickets
      • Get support ticket
      • Create support ticket
      • Reply to support ticket
  • Tools
    • Get your IP and customer number
  • Tasks
    • Get task
  1. Domains

Change hotlink protection

PUT
/hosting/{id}/domains/{domain}/hotlink-protection
Turn hotlink protection on or off, or change its settings. Fields you leave out keep their value; a list you send replaces the whole list.
When you turn it on while no address is allowed yet, the domain itself is allowed (with and without www, http and https). When no file types are set, jpg, jpeg, gif, png, bmp and webp are protected.
Scope: hosting:write.

Request

Authorization
API Key
Add parameter in header
API-key
Example:
API-key: ********************
or
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params

Header Params

Body Params application/json

Example
{
    "enabled": true,
    "allow_blank_referer": true,
    "allowed_urls": [
        "https://www.example.nl"
    ],
    "file_types": [
        "jpg",
        "png"
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://mijn.host/api/v2/hosting/12345/domains/example.nl/hotlink-protection' \
--header 'Accept: application/json' \
--header 'User-Agent: my-application/1.0.0' \
--header 'API-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "enabled": true,
    "allow_blank_referer": true,
    "allowed_urls": [
        "https://www.example.nl"
    ],
    "file_types": [
        "jpg",
        "png"
    ]
}'

Responses

🟢200Success
application/json
Bodyapplication/json

Example
{
    "status": 200,
    "status_description": "string",
    "data": {
        "hotlink_protection": {
            "enabled": true,
            "allow_blank_referer": true,
            "allowed_urls": [
                "https://example.nl",
                "https://www.example.nl"
            ],
            "file_types": [
                "jpg",
                "jpeg",
                "gif",
                "png"
            ]
        }
    }
}
🟠400Invalid input
🟠403Missing scope
🟠404Not found
🟠409Conflict
🔴502Hosting server unavailable
🟠400Invalid input
🟠400SSL connection is required
🟠401No valid API key set
🟠401API key has expired
🟠401Remote IP address is not found in the API key whitelist
🟠429Rate limit exceeded
🔴500Error
Modified at 2026-11-20 15:12:54
Previous
Hotlink protection
Next
SSL status of all domains
Built with