11---
22{}
3-
43---
54
5+ import { APIRequest } from " ~/components" ;
6+
67## Receive email
78
89If you only need to ** receive** emails, Cloudflare offers [ Email Routing] ( /email-routing/ ) for free email forwarding to custom email addresses.
@@ -23,19 +24,17 @@ To **send and receive** emails from your domain, you need an SMTP provider. Then
2324 <summary >API example</summary >
2425 <div >
2526
26- ``` bash title="Request"
27- curl " https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/dns_records" \
28- --header " x-auth-email: <EMAIL>" \
29- --header " x-auth-key: <API_KEY>" \
30- --header " Content-Type: application/json" \
31- --data ' {
32- "type":"A",
33- "name":"www.example.com",
34- "content":"192.0.2.1",
35- "ttl":3600,
36- "proxied":false
37- }'
38- ```
27+ <APIRequest
28+ path = " /zones/{zone_id}/dns_records"
29+ method = " POST"
30+ json = { {
31+ " type" :" A" ,
32+ " name" :" www.example.com" ,
33+ " content" :" 192.0.2.1" ,
34+ " ttl" :3600 ,
35+ " proxied" :false
36+ }}
37+ />
3938
4039 ``` json title="Response"
4140 {
@@ -77,18 +76,16 @@ To **send and receive** emails from your domain, you need an SMTP provider. Then
7776 <summary >API example</summary >
7877 <div >
7978
80- ``` bash title="Request"
81- curl " https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/dns_records" \
82- --header " x-auth-email: <EMAIL>" \
83- --header " x-auth-key: <API_KEY>" \
84- --header " Content-Type: application/json" \
85- --data ' {
86- "type":"MX",
87- "name":"example.com",
88- "content":"mail.example.com",
89- "ttl":3600
90- }'
91- ```
79+ <APIRequest
80+ path = " /zones/{zone_id}/dns_records"
81+ method = " POST"
82+ json = { {
83+ " type" :" MX" ,
84+ " name" :" example.com" ,
85+ " content" :" mail.example.com" ,
86+ " ttl" :3600
87+ }}
88+ />
9289
9390 ``` json title="Response"
9491 {
0 commit comments