Skip to content

Instantly share code, notes, and snippets.

@kyouheicf
Last active November 29, 2022 14:20
Show Gist options
  • Save kyouheicf/c7128f3affb86fe53871e6cfeb9d8064 to your computer and use it in GitHub Desktop.
Save kyouheicf/c7128f3affb86fe53871e6cfeb9d8064 to your computer and use it in GitHub Desktop.
export EMAIL='YOUR_EMAIL'
export APIKEY='YOUR_APIKEY'
export ACCOUNT_ID='YOUR_ACCOUNT_ID'
export ZONE_NAME='example.com'
curl -sX POST "https://api.cloudflare.com/client/v4/zones" \
-H "X-Auth-Email: $EMAIL" \
-H "X-Auth-Key: $APIKEY" \
-H "Content-Type: application/json" \
--data '{"name":"'"$ZONE_NAME"'","account":{"id":"'"$ACCOUNT_ID"'"},"jump_start":false,"type":"partial"}' | jq
{
"result": {
"id": "xxx",
"name": "example.com",
"status": "pending",
"paused": false,
"type": "partial",
"development_mode": 0,
"verification_key": "xxx",
"cname_suffix": "cdn.cloudflare.net",
"original_name_servers": [
"dns1.onamae.com",
"dns2.onamae.com"
],
"original_registrar": "gmo internet, inc. d/b/a onama (id: 49)",
"original_dnshost": null,
"modified_on": "2021-10-11T03:41:49.595275Z",
"created_on": "2021-10-11T03:41:49.595275Z",
"activated_on": null,
"meta": {
"step": 4,
"wildcard_proxiable": false,
"custom_certificate_quota": 0,
"page_rule_quota": 3,
"phishing_detected": false,
"multiple_railguns_allowed": false
},
"owner": {
"id": "xxx",
"type": "organization",
"name": "xxx Account"
},
"account": {
"id": "xxx",
"name": "xxx Account"
},
"permissions": [
"#access:edit",
"#access:read",
"#analytics:read",
"#app:edit",
"#auditlogs:read",
"#billing:edit",
"#billing:read",
"#cache_purge:edit",
"#dns_records:edit",
"#dns_records:read",
"#lb:edit",
"#lb:read",
"#legal:edit",
"#legal:read",
"#logs:edit",
"#logs:read",
"#member:edit",
"#member:read",
"#organization:edit",
"#organization:read",
"#ssl:edit",
"#ssl:read",
"#stream:edit",
"#stream:read",
"#subscription:edit",
"#subscription:read",
"#teams:edit",
"#teams:pii",
"#teams:read",
"#teams:report",
"#waf:edit",
"#waf:read",
"#webhooks:edit",
"#webhooks:read",
"#worker:edit",
"#worker:read",
"#zone:edit",
"#zone:read",
"#zone_settings:edit",
"#zone_settings:read"
],
"plan": {
"id": "0feeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"name": "Free Website",
"price": 0,
"currency": "USD",
"frequency": "",
"is_subscribed": false,
"can_subscribe": false,
"legacy_id": "free",
"legacy_discount": false,
"externally_managed": false
}
},
"success": true,
"errors": [],
"messages": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment