Skip to content

Commit 6cefb04

Browse files
authored
[ZT] Update API calls (#20294)
1 parent 34835fd commit 6cefb04

File tree

31 files changed

+272
-297
lines changed

31 files changed

+272
-297
lines changed

src/content/docs/cloudflare-one/applications/configure-apps/dash-sso-apps.mdx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ If there is an issue with your SSO IdP provider, you can add an alternate IdP us
7373
1. [Add](/api/resources/zero_trust/subresources/identity_providers/methods/create/) one-time PIN login:
7474

7575
```bash title="cURL command"
76-
curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/identity_providers' \
77-
--header "X-Auth-Email: <EMAIL>" \
78-
--header "X-Auth-Key: <API_KEY>" \
76+
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers' \
77+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
7978
--header "Content-Type: application/json" \
8079
--data '{
8180
"type": "onetimepin",
@@ -86,9 +85,8 @@ curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/identity
8685
2. [Get](/api/resources/zero_trust/subresources/access/subresources/applications/methods/list/) the `id` of the `dash_sso` Access application. You can use [`jq`](https://jqlang.github.io/jq/download/) to quickly find the correct application:
8786

8887
```bash title="cURL command"
89-
curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/apps' \
90-
--header "X-Auth-Email: <EMAIL>" \
91-
--header "X-Auth-Key: <API_KEY>" \
88+
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps' \
89+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
9290
| jq '.result[] | select(.type == "dash_sso")'
9391
```
9492

@@ -106,9 +104,8 @@ curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/apps' \
106104

107105
```bash title="cURL command"
108106
curl --request PUT \
109-
'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/apps/3537a672-e4d8-4d89-aab9-26cb622918a1' \
110-
--header "X-Auth-Email: <EMAIL>" \
111-
--header "X-Auth-Key: <API_KEY>" \
107+
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps/3537a672-e4d8-4d89-aab9-26cb622918a1' \
108+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
112109
--header "Content-Type: application/json" \
113110
--data '{
114111
"id": "3537a672-e4d8-4d89-aab9-26cb622918a1",
@@ -127,9 +124,8 @@ The following API calls will disable SSO enforcement for an account. This action
127124
1. Get your SSO `connector_id`:
128125

129126
```bash title="cURL command"
130-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/sso/v2/connectors \
131-
--header "X-Auth-Email: <EMAIL>" \
132-
--header "X-Auth-Key: <API_KEY>"
127+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors \
128+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
133129
```
134130

135131
```json title="Response"
@@ -153,9 +149,8 @@ curl https://api.cloudflare.com/client/v4/accounts/{account_id}/sso/v2/connector
153149

154150
```bash title="cURL command"
155151
curl --request PATCH \
156-
'https://api.cloudflare.com/client/v4/accounts/{account_id}/sso/v2/connectors/2828' \
157-
--header "X-Auth-Email: <EMAIL>" \
158-
--header "X-Auth-Key: <API_KEY>" \
152+
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors/2828' \
153+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
159154
--header "Content-Type: application/json" \
160155
--data '{
161156
"sso_connector_status": "DIS"

src/content/docs/cloudflare-one/connections/connect-devices/agentless/dns/dns-over-https.mdx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ Currently, authentication tokens can only be generated through the API. You can
114114
### 1. Create a service token for the account
115115

116116
```bash
117-
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/service_tokens" \
118-
--header "X-Auth-Email: <EMAIL>" \
119-
--header "X-Auth-Key: <API_KEY>" \
117+
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/service_tokens" \
118+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
120119
--header "Content-Type: application/json" \
121120
--data '{"name":"ACME Corporation service token"}'
122121
```
@@ -148,12 +147,11 @@ Save the service token's `client_id`, `client_secret`, and `id`.
148147

149148
```bash
150149
curl --request PUT \
151-
"https://api.cloudflare.com/client/v4/accounts/{account_id}/access/organizations/doh/{service_token_id}" \
152-
--header "X-Auth-Email: <EMAIL>" \
153-
--header "X-Auth-Key: <API_KEY>"
150+
"https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/organizations/doh/$SERVICE_TOKEN_ID" \
151+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
154152
```
155153

156-
If you get an `access.api.error.service_token_not_found` error, check that `{service_token_id}` is the value of `id` and not `client_id`.
154+
If you get an `access.api.error.service_token_not_found` error, check that `$SERVICE_TOKEN_ID` is the value of `id` and not `client_id`.
157155

158156
<Details header="Example response">
159157

@@ -181,9 +179,8 @@ If you get an `access.api.error.service_token_not_found` error, check that `{ser
181179
Create a new user and optionally add them to a group.
182180

183181
```bash
184-
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/users" \
185-
--header "X-Auth-Email: <EMAIL>" \
186-
--header "X-Auth-Key: <API_KEY>" \
182+
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/users" \
183+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
187184
--header "Content-Type: application/json" \
188185
--data '{
189186
"name": "John Doe",

src/content/docs/cloudflare-one/connections/connect-devices/agentless/pac-files.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ https://<SUBDOMAIN>.proxy.cloudflare-gateway.com
6464

6565
```bash
6666
curl https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/gateway/proxy_endpoints \
67-
--header "Authorization: Bearer <API_TOKEN>" \
67+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
6868
--header "Content-Type: application/json" \
6969
--data '{"name": "any_name", "ips": ["<PUBLIC_IP>", "<PUBLIC_IP2>", "<PUBLIC_IP3>"]}'
7070
```
@@ -211,8 +211,8 @@ To get the domain of a proxy endpoint:
211211
1. Use the [List proxy endpoints](/api/resources/zero_trust/subresources/gateway/subresources/proxy_endpoints/methods/list/) operation to get a list of your proxy endpoints and their details. For example:
212212

213213
```bash
214-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/proxy_endpoints \
215-
--header "Authorization: Bearer <API_TOKEN>"
214+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/proxy_endpoints \
215+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
216216
```
217217

218218
```json {8} output

src/content/docs/cloudflare-one/connections/connect-devices/warp/configure-warp/device-profiles.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ Your profile will appear in the **Profile settings** list. You can rearrange the
3535
Send a `POST` request to the [Devices endpoint](/api/resources/zero_trust/subresources/devices/subresources/policies/subresources/custom/methods/create/):
3636

3737
```bash
38-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/devices/policy \
39-
--header "X-Auth-Email: <EMAIL>" \
40-
--header "X-Auth-Key: <API_KEY>" \
38+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/devices/policy \
39+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
4140
--header "Content-Type: application/json" \
4241
--data '{
4342
"allow_mode_switch": false,

src/content/docs/cloudflare-one/connections/connect-networks/configure-tunnels/remote-management.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ To rotate a tunnel token:
209209
2. Make a `PATCH` request to the [Cloudflare Tunnel](/api/resources/zero_trust/subresources/tunnels/methods/edit/) endpoint:
210210
```sh
211211
curl --request PATCH \
212-
https://api.cloudflare.com/client/v4/accounts/{account_id}/cfd_tunnel/{tunnel_id} \
212+
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/cfd_tunnel/$TUNNEL_ID \
213213
--header 'Content-Type: application/json' \
214-
--header "Authorization: Bearer <API_TOKEN>" \
214+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
215215
--data '{
216216
"name": "Example tunnel",
217217
"tunnel_secret": "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="
@@ -280,8 +280,8 @@ If your tunnel token is compromised, we recommend taking the following steps:
280280
2. [Delete all connections](/api/resources/zero_trust/subresources/tunnels/subresources/connections/methods/delete/) between `cloudflared` and Cloudflare:
281281
```sh
282282
curl --request DELETE \
283-
https://api.cloudflare.com/client/v4/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections \
284-
--header "Authorization: Bearer <API_TOKEN>"
283+
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/cfd_tunnel/$TUNNEL_ID/connections \
284+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
285285
```
286286

287287
This will clean up any unauthorized connections and prevent users from connecting to your network.

src/content/docs/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access.mdx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ import { Tabs, TabItem, Badge, Render } from "~/components";
1313

1414
[Access for Infrastructure](/cloudflare-one/applications/non-http/infrastructure-apps/) provides granular control over how users can connect to your SSH servers. This feature uses the same deployment model as [WARP-to-Tunnel](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-warp-to-tunnel/) but unlocks more policy options and command logging functionality.
1515

16-
<Render file="access/short-lived-certs-intro" params={{ intro: "Furthermore, Access for Infrastructure replaces" }} />
16+
<Render
17+
file="access/short-lived-certs-intro"
18+
params={{ intro: "Furthermore, Access for Infrastructure replaces" }}
19+
/>
1720

1821
## 1. Connect the server to Cloudflare
1922

@@ -31,8 +34,7 @@ To connect your devices to Cloudflare:
3134

3235
## 3. Route server IPs through WARP
3336

34-
<Render file="tunnel/warp-to-tunnel-route-ips" params={{ one: "SSH server"}} />
35-
37+
<Render file="tunnel/warp-to-tunnel-route-ips" params={{ one: "SSH server" }} />
3638

3739
## 4. Add a target
3840

@@ -55,9 +57,11 @@ To generate a Cloudflare SSH CA and get its public key:
5557
<Render file="ssh/ssh-proxy-ca" />
5658

5759
### Save the public key
60+
5861
<Render file="ssh/public-key" />
5962

6063
### Modify your SSHD config
64+
6165
<Render file="ssh/modify-sshd" />
6266

6367
:::note
@@ -66,9 +70,11 @@ For certain distributions, such as Amazon Linux 1 (based on RHEL), the certifica
6670
```sh
6771
chmod 600 /etc/ssh/ca.pub
6872
```
73+
6974
:::
7075

7176
### Restart your SSH server
77+
7278
<Render file="ssh/restart-server" />
7379

7480
## 7. Connect as a user
@@ -112,13 +118,13 @@ Cloudflare will stop logging SSH commands to your targets, as well as any comman
112118
To delete the SSH encryption public key using the [API](/api/resources/zero_trust/subresources/gateway/subresources/audit_ssh_settings/methods/update/):
113119

114120
```sh
115-
curl --request PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/audit_ssh_settings \
116-
--header "X-Auth-Email: <EMAIL>" \
117-
--header "X-Auth-Key: <API_KEY>" \
121+
curl --request PUT https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/audit_ssh_settings \
122+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
118123
--data '{
119124
"public_key": ""
120125
}'
121126
```
127+
122128
</TabItem>
123129
</Tabs>
124130

src/content/docs/cloudflare-one/identity/idp-integration/entra-id.mdx

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ The following Entra ID values are required to set up the integration:
1919

2020
To retrieve those values:
2121

22-
1. Log in to the [Azure dashboard](https://portal.azure.com/).
22+
1. Log in to the [Azure dashboard](https://portal.azure.com/).
2323

24-
2. Go to **All services** > **Microsoft Entra ID**.
24+
2. Go to **All services** > **Microsoft Entra ID**.
2525

26-
3. In the sidebar, go to **Manage** > **Enterprise applications**.
26+
3. In the sidebar, go to **Manage** > **Enterprise applications**.
2727

28-
4. Select **New application**, then select **Create your own application**.
28+
4. Select **New application**, then select **Create your own application**.
2929

30-
5. Name your application.
30+
5. Name your application.
3131

32-
6. Select **Register an application to integrate with Microsoft Entra ID (App you're developing)** and then select **Create**.
32+
6. Select **Register an application to integrate with Microsoft Entra ID (App you're developing)** and then select **Create**.
3333

34-
7. Under **Redirect URI**, select the _Web_ platform and enter the following URL:
34+
7. Under **Redirect URI**, select the _Web_ platform and enter the following URL:
3535

36-
```txt
37-
https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callback
38-
```
36+
```txt
37+
https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callback
38+
```
3939

40-
You can find your team name in Zero Trust under **Settings** > **Custom Pages**.
40+
You can find your team name in Zero Trust under **Settings** > **Custom Pages**.
4141

42-
![Registering an application in Azure](~/assets/images/cloudflare-one/identity/azure/name-app.png)
42+
![Registering an application in Azure](~/assets/images/cloudflare-one/identity/azure/name-app.png)
4343

44-
8. Select **Register**.
44+
8. Select **Register**.
4545

46-
9. Next, return to Microsoft Entra ID and go to go to **Manage** > **App registrations**.
46+
9. Next, return to Microsoft Entra ID and go to go to **Manage** > **App registrations**.
4747

4848
10. Select the app you just created. Copy the **Application (client) ID** and **Directory (tenant) ID**.
4949

@@ -53,11 +53,9 @@ To retrieve those values:
5353

5454
12. Name the client secret and choose an expiration period.
5555

56-
:::note
57-
58-
When the client secret expires, users will be unable to log in through Access. Take note of your expiry date to prevent login errors and renew your client secret when necessary.
59-
60-
:::
56+
:::note
57+
When the client secret expires, users will be unable to log in through Access. Take note of your expiry date to prevent login errors and renew your client secret when necessary.
58+
:::
6159

6260
13. After the client secret is created, copy its **Value** field. Store the client secret in a safe place, as it can only be viewed immediately after creation.
6361

@@ -118,40 +116,42 @@ To [test](/cloudflare-one/identity/idp-integration/#test-idps-in-zero-trust) tha
118116

119117
</TabItem> <TabItem label="API">
120118

121-
1. [Create an API token](/fundamentals/api/get-started/create-token/) with the following permissions:
122-
| Type | Item | Permission |
123-
| ------- | ---------------- | ---------- |
124-
| Account | Access: Organizations, Identity Providers, and Groups | Edit |
125-
126-
2. Make a `POST` request to the [Identity Providers](/api/resources/zero_trust/subresources/identity_providers/methods/create/) endpoint:
127-
128-
```sh
129-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers \
130-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
131-
--data '{
132-
"name": "Entra ID example",
133-
"type": "azureAD",
134-
"config": {
135-
"client_id": "<your client id>",
136-
"client_secret": "<your client secret>",
137-
"directory_id": "<your azure directory uuid>",
138-
"support_groups": true
139-
}
140-
}'
141-
```
119+
1. [Create an API token](/fundamentals/api/get-started/create-token/) with the following permissions:
120+
121+
| Type | Item | Permission |
122+
| ------- | ----------------------------------------------------- | ---------- |
123+
| Account | Access: Organizations, Identity Providers, and Groups | Edit |
124+
125+
2. Make a `POST` request to the [Identity Providers](/api/resources/zero_trust/subresources/identity_providers/methods/create/) endpoint:
126+
127+
```sh
128+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers \
129+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
130+
--data '{
131+
"name": "Entra ID example",
132+
"type": "azureAD",
133+
"config": {
134+
"client_id": "<your client id>",
135+
"client_secret": "<your client secret>",
136+
"directory_id": "<your azure directory uuid>",
137+
"support_groups": true
138+
}
139+
}'
140+
```
142141

143142
</TabItem> <TabItem label="Terraform">
144143

145144
:::note[Provider versions]
146145
The following example requires Cloudflare provider version `>=4.40.0`.
147146
:::
148147

149-
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
150-
- `Access: Organizations, Identity Providers, and Groups Write`
148+
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
149+
150+
- `Access: Organizations, Identity Providers, and Groups Write`
151151

152-
2. Configure the [`cloudflare_zero_trust_access_identity_provider`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_access_identity_provider) resource:
152+
2. Configure the [`cloudflare_zero_trust_access_identity_provider`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_access_identity_provider) resource:
153153

154-
<Render file="access/entra-id-terraform" />
154+
<Render file="access/entra-id-terraform" />
155155

156156
</TabItem> </Tabs>
157157

@@ -185,7 +185,7 @@ The Microsoft Entra ID integration allows you to synchronize IdP groups and auto
185185

186186
<Render
187187
file="access/enable-scim-on-dashboard"
188-
params={{ idp: "Entra ID", supportgroups: "Support groups"}}
188+
params={{ idp: "Entra ID", supportgroups: "Support groups" }}
189189
/>
190190

191191
### 2. Configure SCIM in Entra ID
@@ -274,11 +274,12 @@ Access and Gateway policies for an Entra group will also apply to all [nested gr
274274
You can require users to re-enter their credentials into Entra ID whenever they [re-authenticate their WARP session](/cloudflare-one/connections/connect-devices/warp/configure-warp/warp-sessions/). To configure this setting:
275275

276276
1. Make a `GET` request to the [Identity Providers endpoint](/api/resources/zero_trust/subresources/identity_providers/) and copy the response for the Entra ID identity provider.
277-
2. [Update the Entra ID identity provider](/api/resources/zero_trust/subresources/identity_providers/methods/update/) using a `PUT` request. In the request body, include all existing configurations and set the `prompt` parameter to either `login` or `select_account`. For example,
277+
2. [Update the Entra ID identity provider](/api/resources/zero_trust/subresources/identity_providers/methods/update/) using a `PUT` request. In the request body, include all existing configurations and set the `prompt` parameter to either `login` or `select_account`. For example:
278+
278279
```sh {17}
279280
curl --request PUT \
280-
https://api.cloudflare.com/client/v4/accounts/{account_id}/access/identity_providers/{identity_provider_id} \
281-
--header "Authorization: Bearer <API_TOKEN>" \
281+
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers/$IDENTITY_PROVIDER_ID \
282+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
282283
--header "Content-Type: application/json" \
283284
--data '{
284285
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",

0 commit comments

Comments
 (0)