Skip to main content
POST
/
environments
/
{environment}
/
domains
Create domain
curl --request POST \
  --url https://cloud.laravel.com/api/environments/{environment}/domains \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "www_redirect": "root_to_www",
  "wildcard_enabled": false,
  "allow_downtime": true,
  "cloudflare_strategy": "none",
  "verification_method": "real_time"
}
'
{
  "data": {
    "id": "<string>",
    "type": "domains",
    "links": {
      "self": {
        "href": "<string>",
        "rel": "<string>",
        "describedby": "<string>",
        "title": "<string>",
        "type": "<string>",
        "hreflang": "<string>",
        "meta": {}
      }
    },
    "attributes": {
      "name": "<string>",
      "type": "root",
      "hostname_status": "pending",
      "ssl_status": "pending",
      "origin_status": "pending",
      "redirect": "root_to_www",
      "cloudflare_strategy": "dns_proxy",
      "downtime": true,
      "wildcard_enabled": true,
      "dns_records": {
        "ssl": [
          {
            "type": "CNAME",
            "name": "<string>",
            "value": "<string>"
          }
        ],
        "pre_verification": "<string>",
        "origin": "<string>",
        "origin_cname": "<string>",
        "dcv": "<string>"
      },
      "wildcard": {
        "hostname_status": "pending",
        "ssl_status": "pending",
        "origin_status": "pending",
        "dns_records": {
          "ssl": [
            {
              "type": "CNAME",
              "name": "<string>",
              "value": "<string>"
            }
          ],
          "pre_verification": "<string>",
          "origin": "<string>",
          "origin_cname": "<string>",
          "dcv": "<string>"
        }
      },
      "www": {
        "hostname_status": "pending",
        "ssl_status": "pending",
        "origin_status": "pending",
        "dns_records": {
          "ssl": [
            {
              "type": "CNAME",
              "name": "<string>",
              "value": "<string>"
            }
          ],
          "pre_verification": "<string>",
          "origin": "<string>",
          "origin_cname": "<string>",
          "dcv": "<string>"
        }
      },
      "action_required": "add_txt_records",
      "last_verified_at": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z"
    },
    "relationships": {
      "environment": {
        "data": {
          "type": "environments",
          "id": "<string>"
        }
      }
    }
  },
  "included": [
    {
      "id": "<string>",
      "type": "environments",
      "links": {
        "self": {
          "href": "<string>",
          "rel": "<string>",
          "describedby": "<string>",
          "title": "<string>",
          "type": "<string>",
          "hreflang": "<string>",
          "meta": {}
        }
      },
      "attributes": {
        "name": "<string>",
        "slug": "<string>",
        "status": "deploying",
        "created_from_automation": true,
        "vanity_domain": "<string>",
        "php_major_version": "8.2",
        "build_command": "<string>",
        "node_version": "20",
        "deploy_command": "<string>",
        "uses_octane": true,
        "uses_push_to_deploy": true,
        "uses_deploy_hook": true,
        "environment_variables": [
          {
            "key": "<string>",
            "value": "<string>"
          }
        ],
        "network_settings": {
          "cache": {
            "strategy": "<string>"
          },
          "response_headers": {
            "frame": "<string>",
            "content_type": "<string>",
            "hsts": {
              "max_age": 123,
              "include_subdomains": true,
              "preload": true
            }
          },
          "firewall": {
            "bot_categories": [
              "academic_research"
            ],
            "rate_limit": {
              "429": true,
              "level": "challenge",
              "per_minute": 100,
              "4xx": true
            },
            "under_attack_mode_started_at": "<string>",
            "block_path": true
          },
          "content_converter": true
        },
        "created_at": "2023-11-07T05:31:56Z"
      },
      "relationships": {
        "application": {
          "data": {
            "type": "applications",
            "id": "<string>"
          }
        },
        "branch": {
          "data": {
            "type": "branches",
            "id": "<string>"
          }
        },
        "deployments": {
          "data": [
            {
              "type": "deployments",
              "id": "<string>"
            }
          ]
        },
        "currentDeployment": {
          "data": {
            "type": "deployments",
            "id": "<string>"
          }
        },
        "domains": {
          "data": [
            {
              "type": "domains",
              "id": "<string>"
            }
          ]
        },
        "primaryDomain": {
          "data": {
            "type": "domains",
            "id": "<string>"
          }
        },
        "instances": {
          "data": [
            {
              "type": "instances",
              "id": "<string>"
            }
          ]
        },
        "database": {
          "data": {
            "type": "databaseSchemas",
            "id": "<string>"
          }
        },
        "cache": {
          "data": {
            "type": "caches",
            "id": "<string>"
          }
        },
        "buckets": {
          "data": [
            {
              "type": "filesystems",
              "id": "<string>"
            }
          ]
        },
        "websocketApplication": {
          "data": {
            "type": "websocketApplications",
            "id": "<string>"
          }
        }
      }
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://cloud.laravel.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

The Bearer Token generated on the Cloud UI.

Path Parameters

environment
string
required

The environment identifier

Body

application/json
name
string
required
Required string length: 3 - 255
www_redirect
enum<string>
Available options:
root_to_www,
www_to_root
wildcard_enabled
boolean | null

Whether to enable a wildcard subdomain (*.example.com) for this domain.

Example:

false

allow_downtime
boolean | null

Whether to allow downtime during domain verification. When true (flexible), the domain can be pointed directly without pre-verification. When false (uninterrupted), TXT-based pre-verification is required to avoid downtime.

Example:

true

cloudflare_strategy
enum<string>

The Cloudflare integration strategy. "none" uses A records with no Cloudflare integration. "dns" uses CNAME records via Cloudflare DNS only. "dns_proxy" uses CNAME records with Cloudflare's proxy enabled (Orange cloud).

Available options:
dns_proxy,
dns,
none
Example:

"none"

verification_method
enum<string>

The domain verification method to use. Pre-verification allows domain verification via TXT record before the domain is pointed to the environment. Real-time verification requires the domain to already be pointing to the environment.

Available options:
pre_verification,
real_time
Example:

"real_time"

Response

DomainResource

data
DomainResource · object
required
included
EnvironmentResource · object[]