Connecting to Cloudflare
To authenticate to Cloudflare, you can use either API Key or API Token authentication. Use API Key authentication to connect to your own data with your account email and Global API Key. Use API Token authentication for more secure, granular access control.
Using Global API Key Authentication
To use Global API Key authentication, obtain your Global API Key from the Cloudflare dashboard under My Profile > API Tokens > API Keys section. Set your API Key, KeyType, and account email in ProfileSettings.
After setting the following connection properties, you are ready to connect:
- AuthScheme: Set this to APIKey.
- ProfileSettings: Set your APIKey, KeyType=Key, and APIEmail in ProfileSettings.
Example connection string
Profile=C:\profiles\Cloudflare.apip;ProfileSettings='APIKey=your_global_api_key;KeyType=Key;[email protected];';AuthScheme=APIKey;
Using API Token Authentication
To use API Token authentication, create an API Token from the Cloudflare dashboard under My Profile > API Tokens. Configure the token with the appropriate permissions for the resources you need to access. Set your API Token in ProfileSettings.
After setting the following connection properties, you are ready to connect:
- AuthScheme: Set this to APIKey.
- ProfileSettings: Set your APIKey (token) and KeyType=Token in ProfileSettings. APIEmail is not required for token authentication.
Example connection string
Profile=C:\profiles\Cloudflare.apip;ProfileSettings='APIKey=your_api_token;KeyType=Token;';AuthScheme=APIKey;
Usage Examples
The following examples demonstrate common SQL queries for accessing Cloudflare data through various tables:
AccessApplications:
SELECT * FROM AccessApplications WHERE AccountId = 'account123'
INSERT INTO AccessApplications (Domain, Name, AccountId) VALUES ('app.example.com', 'My Application', 'account123')
UPDATE AccessApplications SET Domain = 'app.example.com', Name = 'My Application' WHERE Id = 'a0e0d798-5f96-4c37-a1fb-a1d8b1e4b06d'
DELETE FROM AccessApplications WHERE Id = 'a0e0d798-5f96-4c37-a1fb-a1d8b1e4b06d'
AccessGroups:
SELECT * FROM AccessGroups WHERE AccountId = 'account123'
INSERT INTO AccessGroups (Name, Include, AccountId) VALUES ('Engineering Team', '[{"email":{"email":"[email protected]"}}]', 'account123')
UPDATE AccessGroups SET Name = 'Engineering Team', Include = '[{"email":{"email":"[email protected]"}}]' WHERE Id = 'b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e'
DELETE FROM AccessGroups WHERE Id = 'b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e'
AccessPolicies:
SELECT * FROM AccessPolicies WHERE AccountId = 'account123'
INSERT INTO AccessPolicies (Name, Decision, Include, AccountId) VALUES ('Allow Engineers', 'allow', '[{"email":{"email":"[email protected]"}}]', 'account123')
UPDATE AccessPolicies SET Name = 'Allow Engineers', Decision = 'allow', Include = '[{"email":{"email":"[email protected]"}}]' WHERE Id = 'c2d3e4f5-a6b7-8c9d-0e1f-2a3b4c5d6e7f'
DELETE FROM AccessPolicies WHERE Id = 'c2d3e4f5-a6b7-8c9d-0e1f-2a3b4c5d6e7f'
AccessServiceTokens:
SELECT * FROM AccessServiceTokens WHERE AccountId = 'account123'
INSERT INTO AccessServiceTokens (Name, AccountId) VALUES ('My Service Token', 'account123')
UPDATE AccessServiceTokens SET Name = 'My Service Token' WHERE Id = 'd3e4f5a6-b7c8-9d0e-1f2a-3b4c5d6e7f8a'
DELETE FROM AccessServiceTokens WHERE Id = 'd3e4f5a6-b7c8-9d0e-1f2a-3b4c5d6e7f8a'
AccountAuditLogs:
SELECT * FROM AccountAuditLogs WHERE AccountId = 'account123'
AccountMembers:
SELECT * FROM AccountMembers WHERE AccountId = 'account123'
INSERT INTO AccountMembers (Email, Roles, AccountId) VALUES ('[email protected]', '[{"id":"3536bcfad5faccb999b47003c79917fb"}]', 'account123')
UPDATE AccountMembers SET Roles = '[{"id":"3536bcfad5faccb999b47003c79917fb"}]' WHERE Id = 'e4f5a6b7-c8d9-0e1f-2a3b-4c5d6e7f8a9b'
DELETE FROM AccountMembers WHERE Id = 'e4f5a6b7-c8d9-0e1f-2a3b-4c5d6e7f8a9b'
AccountRoles:
SELECT * FROM AccountRoles WHERE AccountId = 'account123'
Accounts:
SELECT * FROM Accounts
UPDATE Accounts SET Name = 'My Company' WHERE Id = 'account123'
AccountSubscriptions:
SELECT * FROM AccountSubscriptions WHERE AccountId = 'account123'
ApiGatewayOperations:
SELECT * FROM ApiGatewayOperations WHERE ZoneId = 'zone123'
Argo:
SELECT * FROM Argo WHERE ZoneId = 'zone123'
BotManagement:
SELECT * FROM BotManagement WHERE ZoneId = 'zone123'
CacheReserve:
SELECT * FROM CacheReserve WHERE ZoneId = 'zone123'
CacheVariants:
SELECT * FROM CacheVariants WHERE ZoneId = 'zone123'
ClientCertificates:
SELECT * FROM ClientCertificates WHERE ZoneId = 'zone123'
INSERT INTO ClientCertificates (Certificate, ZoneId) VALUES ('-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----', 'zone123')
DELETE FROM ClientCertificates WHERE Id = 'f5a6b7c8-d9e0-1f2a-3b4c-5d6e7f8a9b0c'
CloudflareTunnels:
SELECT * FROM CloudflareTunnels WHERE AccountId = 'account123'
INSERT INTO CloudflareTunnels (Name, AccountId) VALUES ('my-cloudflare-tunnel', 'account123')
UPDATE CloudflareTunnels SET Name = 'my-cloudflare-tunnel' WHERE Id = 'a6b7c8d9-e0f1-2a3b-4c5d-6e7f8a9b0c1d'
DELETE FROM CloudflareTunnels WHERE Id = 'a6b7c8d9-e0f1-2a3b-4c5d-6e7f8a9b0c1d'
CustomCertificates:
SELECT * FROM CustomCertificates WHERE ZoneId = 'zone123'
INSERT INTO CustomCertificates (ZoneId, BundleMethod) VALUES ('zone123', 'ubiquitous')
UPDATE CustomCertificates SET BundleMethod = 'ubiquitous', GeoRestrictions = '{"label":"us"}' WHERE Id = 'b7c8d9e0-f1a2-3b4c-5d6e-7f8a9b0c1d2e'
DELETE FROM CustomCertificates WHERE Id = 'b7c8d9e0-f1a2-3b4c-5d6e-7f8a9b0c1d2e'
CustomHostnames:
SELECT * FROM CustomHostnames WHERE ZoneId = 'zone123'
INSERT INTO CustomHostnames (Hostname, ZoneId) VALUES ('custom.example.com', 'zone123')
UPDATE CustomHostnames SET CustomOriginServer = 'origin.example.com' WHERE Id = 'c8d9e0f1-a2b3-4c5d-6e7f-8a9b0c1d2e3f'
DELETE FROM CustomHostnames WHERE Id = 'c8d9e0f1-a2b3-4c5d-6e7f-8a9b0c1d2e3f'
D1Databases:
SELECT * FROM D1Databases WHERE AccountId = 'account123'
INSERT INTO D1Databases (Name, AccountId) VALUES ('my-d1-database', 'account123')
DELETE FROM D1Databases WHERE Id = 'd9e0f1a2-b3c4-5d6e-7f8a-9b0c1d2e3f4a'
DnsAnalytics:
SELECT * FROM DnsAnalytics WHERE ZoneId = 'zone123'
DnsRecords:
SELECT * FROM DnsRecords WHERE ZoneId = 'zone123'
INSERT INTO DnsRecords (Name, Type, Content, ZoneId) VALUES ('www.example.com', 'A', '192.0.2.1', 'zone123')
UPDATE DnsRecords SET Name = 'www.example.com', Type = 'A', Content = '192.0.2.1' WHERE Id = 'e0f1a2b3-c4d5-6e7f-8a9b-0c1d2e3f4a5b'
DELETE FROM DnsRecords WHERE Id = 'e0f1a2b3-c4d5-6e7f-8a9b-0c1d2e3f4a5b'
DnsSettings:
SELECT * FROM DnsSettings WHERE ZoneId = 'zone123'
UPDATE DnsSettings SET ZoneMode = 'standard', IsMultiProviderEnabled = false WHERE ZoneId = 'zone123'
Dnssec:
SELECT * FROM Dnssec WHERE ZoneId = 'zone123'
DurableObjects:
SELECT * FROM DurableObjects WHERE AccountId = 'account123' AND NamespaceId = 'namespace123'
DurableObjectsNamespaces:
SELECT * FROM DurableObjectsNamespaces WHERE AccountId = 'account123'
EmailRoutingAddresses:
SELECT * FROM EmailRoutingAddresses WHERE ZoneId = 'zone123'
INSERT INTO EmailRoutingAddresses (Email, AccountId) VALUES ('[email protected]', 'account123')
DELETE FROM EmailRoutingAddresses WHERE Id = 'f1a2b3c4-d5e6-7f8a-9b0c-1d2e3f4a5b6c'
EmailRoutingRules:
SELECT * FROM EmailRoutingRules WHERE ZoneId = 'zone123'
INSERT INTO EmailRoutingRules (Name, Actions, Matchers, ZoneId, IsEnabled, Priority) VALUES ('Forward to support', '[{"type":"forward","value":["[email protected]"]}]', '[{"type":"literal","field":"to","value":"[email protected]"}]', 'zone123', true, 10)
UPDATE EmailRoutingRules SET Name = 'Forward to support', IsEnabled = true, Priority = 10, Actions = '[{"type":"forward","value":["[email protected]"]}]', Matchers = '[{"type":"literal","field":"to","value":"[email protected]"}]' WHERE Id = 'a2b3c4d5-e6f7-8a9b-0c1d-2e3f4a5b6c7d'
DELETE FROM EmailRoutingRules WHERE Id = 'a2b3c4d5-e6f7-8a9b-0c1d-2e3f4a5b6c7d'
EmailRoutingSettings:
SELECT * FROM EmailRoutingSettings WHERE ZoneId = 'zone123'
UPDATE EmailRoutingSettings SET IsEnabled = true, IsWizardSkipped = false WHERE ZoneId = 'zone123'
FirewallAccessRules:
SELECT * FROM FirewallAccessRules WHERE ZoneId = 'zone123'
INSERT INTO FirewallAccessRules (Mode, Configuration, ZoneId, IsPaused, Notes) VALUES ('block', '{"target":"ip","value":"198.51.100.4"}', 'zone123', false, 'Block suspicious IP')
UPDATE FirewallAccessRules SET Mode = 'block', IsPaused = false, Notes = 'Block suspicious IP' WHERE Id = 'b3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e'
DELETE FROM FirewallAccessRules WHERE Id = 'b3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e'
FirewallLockdowns:
SELECT * FROM FirewallLockdowns WHERE ZoneId = 'zone123'
INSERT INTO FirewallLockdowns (Configurations, Urls, ZoneId, Description, IsPaused) VALUES ('[{"target":"ip","value":"198.51.100.4"}]', '["api.example.com/admin/*"]', 'zone123', 'Restrict admin endpoints', false)
UPDATE FirewallLockdowns SET Configurations = '[{"target":"ip","value":"198.51.100.4"}]', Description = 'Restrict admin endpoints', IsPaused = false, Urls = '["api.example.com/admin/*"]' WHERE Id = 'c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f'
DELETE FROM FirewallLockdowns WHERE Id = 'c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f'
FirewallUaRules:
SELECT * FROM FirewallUaRules WHERE ZoneId = 'zone123'
INSERT INTO FirewallUaRules (Mode, Configuration, ZoneId, Description, IsPaused) VALUES ('block', '{"target":"ua","value":"BadBot/1.0"}', 'zone123', 'Block bad bot', false)
UPDATE FirewallUaRules SET Description = 'Block bad bot', Mode = 'block', Configuration = '{"target":"ua","value":"BadBot/1.0"}', IsPaused = false WHERE Id = 'd5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a'
DELETE FROM FirewallUaRules WHERE Id = 'd5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a'
GatewayRules:
SELECT * FROM GatewayRules WHERE AccountId = 'account123'
INSERT INTO GatewayRules (Name, Action, AccountId, Description, Precedence, IsEnabled) VALUES ('Block Social Media', 'block', 'account123', 'Block social media sites', 1000, true)
UPDATE GatewayRules SET Name = 'Block Social Media', Action = 'block', Description = 'Block social media sites', Precedence = 1000, IsEnabled = true WHERE Id = 'e6f7a8b9-c0d1-2e3f-4a5b-6c7d8e9f0a1b'
DELETE FROM GatewayRules WHERE Id = 'e6f7a8b9-c0d1-2e3f-4a5b-6c7d8e9f0a1b'
Healthchecks:
SELECT * FROM Healthchecks WHERE ZoneId = 'zone123'
INSERT INTO Healthchecks (Name, Address, Type, ZoneId, Description, IsSuspended, Interval, Retries, Timeout) VALUES ('My Health Check', 'www.example.com', 'HTTP', 'zone123', 'Check homepage availability', false, 60, 2, 5)
UPDATE Healthchecks SET Name = 'My Health Check', Description = 'Check homepage availability', Address = 'www.example.com', IsSuspended = false, Type = 'HTTP', Interval = 60, Retries = 2, Timeout = 5 WHERE Id = 'f7a8b9c0-d1e2-3f4a-5b6c-7d8e9f0a1b2c'
DELETE FROM Healthchecks WHERE Id = 'f7a8b9c0-d1e2-3f4a-5b6c-7d8e9f0a1b2c'
Hyperdrive:
SELECT * FROM Hyperdrive WHERE AccountId = 'account123'
INSERT INTO Hyperdrive (Name, Origin, AccountId, Caching) VALUES ('my-hyperdrive', '{"host":"db.example.com","port":5432,"database":"mydb","user":"dbuser","password":"secret","scheme":"postgres"}', 'account123', '{"disabled":false}')
UPDATE Hyperdrive SET Name = 'my-hyperdrive', Origin = '{"host":"db.example.com","port":5432,"database":"mydb","user":"dbuser","password":"secret","scheme":"postgres"}', Caching = '{"disabled":false}' WHERE Id = 'a8b9c0d1-e2f3-4a5b-6c7d-8e9f0a1b2c3d'
DELETE FROM Hyperdrive WHERE Id = 'a8b9c0d1-e2f3-4a5b-6c7d-8e9f0a1b2c3d'
ImageKeys:
SELECT * FROM ImageKeys WHERE AccountId = 'account123'
Images:
SELECT * FROM Images WHERE AccountId = 'account123'
DELETE FROM Images WHERE Id = 'b9c0d1e2-f3a4-5b6c-7d8e-9f0a1b2c3d4e' AND AccountId = 'account123'
ImageStats:
SELECT * FROM ImageStats WHERE AccountId = 'account123'
LogpushJobs:
SELECT * FROM LogpushJobs WHERE ZoneId = 'zone123'
INSERT INTO LogpushJobs (Dataset, DestinationConf, AccountId, Name, IsEnabled, Frequency) VALUES ('http_requests', 's3://mybucket/logs?region=us-east-1', 'account123', 'HTTP Logs Job', true, 'high')
UPDATE LogpushJobs SET Name = 'HTTP Logs Job', IsEnabled = true, Frequency = 'high', MaxUploadBytes = 5000000, MaxUploadIntervalSeconds = 30, MaxUploadRecords = 1000 WHERE Id = 1
DELETE FROM LogpushJobs WHERE Id = 1
MagicTransitGre:
SELECT * FROM MagicTransitGre WHERE AccountId = 'account123'
INSERT INTO MagicTransitGre (Name, InterfaceAddress, CloudflareGreEndpoint, CustomerGreEndpoint, AccountId, Description, Ttl, Mtu) VALUES ('my-gre-tunnel', '10.212.0.9/31', '203.0.113.1', '203.0.113.2', 'account123', 'GRE tunnel to HQ', 64, 1476)
UPDATE MagicTransitGre SET Name = 'my-gre-tunnel', Description = 'GRE tunnel to HQ', InterfaceAddress = '10.212.0.9/31', CloudflareGreEndpoint = '203.0.113.1', CustomerGreEndpoint = '203.0.113.2', Ttl = 64, Mtu = 1476 WHERE Id = 'c0d1e2f3-a4b5-6c7d-8e9f-0a1b2c3d4e5f'
DELETE FROM MagicTransitGre WHERE Id = 'c0d1e2f3-a4b5-6c7d-8e9f-0a1b2c3d4e5f'
MagicTransitIpsec:
SELECT * FROM MagicTransitIpsec WHERE AccountId = 'account123'
INSERT INTO MagicTransitIpsec (Name, InterfaceAddress, CloudflareEndpoint, CustomerEndpoint, AccountId, Description, IsNullCipherAllowed, IsReplayProtectionEnabled) VALUES ('my-ipsec-tunnel', '10.212.0.9/31', '203.0.113.1', '203.0.113.2', 'account123', 'IPsec tunnel to HQ', false, true)
UPDATE MagicTransitIpsec SET Name = 'my-ipsec-tunnel', Description = 'IPsec tunnel to HQ', InterfaceAddress = '10.212.0.9/31', CloudflareEndpoint = '203.0.113.1', CustomerEndpoint = '203.0.113.2', IsNullCipherAllowed = false, IsReplayProtectionEnabled = true WHERE Id = 'd1e2f3a4-b5c6-7d8e-9f0a-1b2c3d4e5f6a'
DELETE FROM MagicTransitIpsec WHERE Id = 'd1e2f3a4-b5c6-7d8e-9f0a-1b2c3d4e5f6a'
NotificationPolicies:
SELECT * FROM NotificationPolicies WHERE AccountId = 'account123'
INSERT INTO NotificationPolicies (Name, IsEnabled, AlertType, AccountId, Description, AlertInterval, Mechanisms, Filters) VALUES ('DDoS Alert', true, 'dos_attack_l7', 'account123', 'Alert on L7 DDoS attacks', '5m', '{"email":[{"id":"[email protected]"}]}', '{}')
UPDATE NotificationPolicies SET Name = 'DDoS Alert', Description = 'Alert on L7 DDoS attacks', IsEnabled = true, AlertType = 'dos_attack_l7', AlertInterval = '5m', Mechanisms = '{"email":[{"id":"[email protected]"}]}', Filters = '{}' WHERE Id = 'e2f3a4b5-c6d7-8e9f-0a1b-2c3d4e5f6a7b'
DELETE FROM NotificationPolicies WHERE Id = 'e2f3a4b5-c6d7-8e9f-0a1b-2c3d4e5f6a7b'
PageRules:
SELECT * FROM PageRules WHERE ZoneId = 'zone123'
INSERT INTO PageRules (Targets, Actions, ZoneId) VALUES ('[{"target":"url","constraint":{"operator":"matches","value":"*example.com/images/*"}}]', '[{"id":"browser_cache_ttl","value":14400}]', 'zone123')
UPDATE PageRules SET Targets = '[{"target":"url","constraint":{"operator":"matches","value":"*example.com/images/*"}}]', Actions = '[{"id":"browser_cache_ttl","value":14400}]' WHERE Id = 'f3a4b5c6-d7e8-9f0a-1b2c-3d4e5f6a7b8c'
DELETE FROM PageRules WHERE Id = 'f3a4b5c6-d7e8-9f0a-1b2c-3d4e5f6a7b8c'
PagesDeployments:
SELECT * FROM PagesDeployments WHERE AccountId = 'account123' AND ProjectName = 'project123'
DELETE FROM PagesDeployments WHERE Id = 'a4b5c6d7-e8f9-0a1b-2c3d-4e5f6a7b8c9d' AND AccountId = 'account123' AND ProjectName = 'project123'
PagesDomains:
SELECT * FROM PagesDomains WHERE AccountId = 'account123' AND ProjectName = 'project123'
INSERT INTO PagesDomains (Name, AccountId, ProjectName) VALUES ('custom.example.com', 'account123', 'project123')
DELETE FROM PagesDomains WHERE Id = 'b5c6d7e8-f9a0-1b2c-3d4e-5f6a7b8c9d0e'
PagesProjects:
SELECT * FROM PagesProjects WHERE AccountId = 'account123'
INSERT INTO PagesProjects (Name, AccountId) VALUES ('my-pages-project', 'account123')
UPDATE PagesProjects SET Name = 'my-pages-project' WHERE Id = 'c6d7e8f9-a0b1-2c3d-4e5f-6a7b8c9d0e1f'
DELETE FROM PagesProjects WHERE Id = 'c6d7e8f9-a0b1-2c3d-4e5f-6a7b8c9d0e1f'
PageShield:
SELECT * FROM PageShield WHERE ZoneId = 'zone123'
PageShieldConnections:
SELECT * FROM PageShieldConnections WHERE ZoneId = 'zone123'
PageShieldCookies:
SELECT * FROM PageShieldCookies WHERE ZoneId = 'zone123'
PageShieldPolicies:
SELECT * FROM PageShieldPolicies WHERE ZoneId = 'zone123'
INSERT INTO PageShieldPolicies (Action, Expression, ZoneId) VALUES ('allow', 'script.src in ["https://cdnjs.cloudflare.com"]', 'zone123')
UPDATE PageShieldPolicies SET Action = 'allow', Expression = 'script.src in ["https://cdnjs.cloudflare.com"]' WHERE Id = 'd7e8f9a0-b1c2-3d4e-5f6a-7b8c9d0e1f2a'
DELETE FROM PageShieldPolicies WHERE Id = 'd7e8f9a0-b1c2-3d4e-5f6a-7b8c9d0e1f2a'
PageShieldScripts:
SELECT * FROM PageShieldScripts WHERE ZoneId = 'zone123'
QueueConsumers:
SELECT * FROM QueueConsumers WHERE AccountId = 'account123' AND QueueId = 'queue123'
INSERT INTO QueueConsumers (QueueId, Script, AccountId, Settings, Type) VALUES ('queue123', 'my-worker-script', 'account123', '{"batch_size":10,"max_retries":3,"max_wait_time_ms":5000}', 'worker')
UPDATE QueueConsumers SET Settings = '{"batch_size":10,"max_retries":3,"max_wait_time_ms":5000}' WHERE ConsumerId = 'e8f9a0b1-c2d3-4e5f-6a7b-8c9d0e1f2a3b' AND QueueId = 'queue123' AND AccountId = 'account123'
DELETE FROM QueueConsumers WHERE ConsumerId = 'e8f9a0b1-c2d3-4e5f-6a7b-8c9d0e1f2a3b' AND QueueId = 'queue123' AND AccountId = 'account123'
Queues:
SELECT * FROM Queues WHERE AccountId = 'account123'
INSERT INTO Queues (QueueName, AccountId) VALUES ('my-queue', 'account123')
UPDATE Queues SET QueueName = 'my-queue' WHERE QueueId = 'f9a0b1c2-d3e4-5f6a-7b8c-9d0e1f2a3b4c'
DELETE FROM Queues WHERE QueueId = 'f9a0b1c2-d3e4-5f6a-7b8c-9d0e1f2a3b4c'
R2Buckets:
SELECT * FROM R2Buckets WHERE AccountId = 'account123'
INSERT INTO R2Buckets (Name, AccountId) VALUES ('my-r2-bucket', 'account123')
DELETE FROM R2Buckets WHERE Name = 'my-r2-bucket'
RulesLists:
SELECT * FROM RulesLists WHERE AccountId = 'account123'
INSERT INTO RulesLists (Name, Kind, AccountId) VALUES ('My IP List', 'ip', 'account123')
UPDATE RulesLists SET Name = 'My IP List', Description = 'List of blocked IPs' WHERE Id = 'a0b1c2d3-e4f5-6a7b-8c9d-0e1f2a3b4c5d'
DELETE FROM RulesLists WHERE Id = 'a0b1c2d3-e4f5-6a7b-8c9d-0e1f2a3b4c5d'
RulesListsItems:
SELECT * FROM RulesListsItems WHERE AccountId = 'account123' AND ListId = 'list123'
INSERT INTO RulesListsItems (AccountId, ListId, Comment) VALUES ('account123', 'list123', 'Comment123')
Rulesets:
SELECT * FROM Rulesets WHERE ZoneId = 'zone123'
INSERT INTO Rulesets (Name, Kind, Phase, AccountId) VALUES ('My Custom Ruleset', 'custom', 'http_request_firewall_custom', 'account123')
UPDATE Rulesets SET Name = 'My Custom Ruleset', Description = 'Custom firewall ruleset' WHERE Id = 'b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e'
DELETE FROM Rulesets WHERE Id = 'b1c2d3e4-f5a6-7b8c-9d0e-1f2a3b4c5d6e'
RulesetVersions:
SELECT * FROM RulesetVersions WHERE ZoneId = 'zone123' AND RulesetId = 'ruleset123'
Spectrum:
SELECT * FROM Spectrum WHERE ZoneId = 'zone123'
INSERT INTO Spectrum (Protocol, Dns, ZoneId) VALUES ('tcp/22', '{"type":"CNAME","name":"ssh.example.com"}', 'zone123')
UPDATE Spectrum SET Protocol = 'tcp/22', Dns = '{"type":"CNAME","name":"ssh.example.com"}' WHERE Id = 'c2d3e4f5-a6b7-8c9d-0e1f-2a3b4c5d6e7f'
DELETE FROM Spectrum WHERE Id = 'c2d3e4f5-a6b7-8c9d-0e1f-2a3b4c5d6e7f'
StreamLiveInputs:
SELECT * FROM StreamLiveInputs WHERE AccountId = 'account123'
INSERT INTO StreamLiveInputs (AccountId) VALUES ('account123')
UPDATE StreamLiveInputs SET Meta = '{"name":"My Live Stream"}' WHERE Id = 'd3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8'
DELETE FROM StreamLiveInputs WHERE Id = 'd3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8'
StreamStorageUsage:
SELECT * FROM StreamStorageUsage WHERE AccountId = 'account123'
StreamVideos:
SELECT * FROM StreamVideos WHERE AccountId = 'account123'
StreamWatermarks:
SELECT * FROM StreamWatermarks WHERE AccountId = 'account123'
DELETE FROM StreamWatermarks WHERE Id = 'e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9' AND AccountId = 'account123'
TieredCache:
SELECT * FROM TieredCache WHERE ZoneId = 'zone123'
User:
SELECT * FROM User
UserAuditLogs:
SELECT * FROM UserAuditLogs
UserTokens:
SELECT * FROM UserTokens
INSERT INTO UserTokens (Name, Policies) VALUES ('My API Token', '[{"effect":"allow","resources":{"com.cloudflare.api.account.*":"*"},"permission_groups":[{"id":"c8fed203ed3043cba015a93ad1616f1f","name":"Account Settings Read"}]}]')
UPDATE UserTokens SET Name = 'My API Token', Status = 'active', Policies = '[{"effect":"allow","resources":{"com.cloudflare.api.account.*":"*"},"permission_groups":[{"id":"c8fed203ed3043cba015a93ad1616f1f","name":"Account Settings Read"}]}]' WHERE Id = 'f5a6b7c8-d9e0-1f2a-3b4c-5d6e7f8a9b0c'
DELETE FROM UserTokens WHERE Id = 'f5a6b7c8-d9e0-1f2a-3b4c-5d6e7f8a9b0c'
VectorizeIndexes:
SELECT * FROM VectorizeIndexes WHERE AccountId = 'account123'
INSERT INTO VectorizeIndexes (Name, AccountId, Description, Config) VALUES ('my-vector-index', 'account123', 'Vector index for text embeddings', '{"dimensions":768,"metric":"cosine"}')
UPDATE VectorizeIndexes SET Description = 'Vector index for text embeddings' WHERE Name = 'my-vector-index'
DELETE FROM VectorizeIndexes WHERE Name = 'my-vector-index'
WaitingRoomEvents:
SELECT * FROM WaitingRoomEvents WHERE ZoneId = 'zone123' AND WaitingRoomId = 'waitingroom123'
INSERT INTO WaitingRoomEvents (Name, EventStartTime, EventEndTime, ZoneId, WaitingRoomId, Description, TotalActiveUsers, NewUsersPerMinute) VALUES ('Flash Sale', '2024-09-28T10:00:00.000Z', '2024-09-28T18:00:00.000Z', 'zone123', 'waitingroom123', 'Flash sale event', 500, 100)
UPDATE WaitingRoomEvents SET Name = 'Flash Sale', EventStartTime = '2024-09-28T10:00:00.000Z', EventEndTime = '2024-09-28T18:00:00.000Z', Description = 'Flash sale event', TotalActiveUsers = 500, NewUsersPerMinute = 100 WHERE Id = 'a6b7c8d9-e0f1-2a3b-4c5d-6e7f8a9b0c1d'
DELETE FROM WaitingRoomEvents WHERE Id = 'a6b7c8d9-e0f1-2a3b-4c5d-6e7f8a9b0c1d' AND ZoneId = 'zone123' AND WaitingRoomId = 'waitingroom123'
WaitingRooms:
SELECT * FROM WaitingRooms WHERE ZoneId = 'zone123'
INSERT INTO WaitingRooms (Name, Host, ZoneId, Description, NewUsersPerMinute, TotalActiveUsers, SessionDuration) VALUES ('My Waiting Room', 'example.com', 'zone123', 'Waiting room for high-traffic events', 200, 300, 15)
UPDATE WaitingRooms SET Name = 'My Waiting Room', Description = 'Waiting room for high-traffic events', Host = 'example.com', NewUsersPerMinute = 200, TotalActiveUsers = 300, SessionDuration = 15 WHERE Id = 'b7c8d9e0-f1a2-3b4c-5d6e-7f8a9b0c1d2e'
DELETE FROM WaitingRooms WHERE Id = 'b7c8d9e0-f1a2-3b4c-5d6e-7f8a9b0c1d2e'
WorkersKvKeys:
SELECT * FROM WorkersKvKeys WHERE AccountId = 'account123' AND NamespaceId = 'namespace123'
WorkersKvNamespaces:
SELECT * FROM WorkersKvNamespaces WHERE AccountId = 'account123'
INSERT INTO WorkersKvNamespaces (Title, AccountId) VALUES ('My KV Namespace', 'account123')
UPDATE WorkersKvNamespaces SET Title = 'My KV Namespace' WHERE Id = 'c8d9e0f1-a2b3-4c5d-6e7f-8a9b0c1d2e3f'
DELETE FROM WorkersKvNamespaces WHERE Id = 'c8d9e0f1-a2b3-4c5d-6e7f-8a9b0c1d2e3f'
WorkersRoutes:
SELECT * FROM WorkersRoutes WHERE ZoneId = 'zone123'
INSERT INTO WorkersRoutes (Pattern, ZoneId, Script) VALUES ('example.com/api/*', 'zone123', 'my-worker-script')
UPDATE WorkersRoutes SET Pattern = 'example.com/api/*', Script = 'my-worker-script' WHERE Id = 'd9e0f1a2-b3c4-5d6e-7f8a-9b0c1d2e3f4a'
DELETE FROM WorkersRoutes WHERE Id = 'd9e0f1a2-b3c4-5d6e-7f8a-9b0c1d2e3f4a'
WorkersScripts:
SELECT * FROM WorkersScripts WHERE AccountId = 'account123'
DELETE FROM WorkersScripts WHERE Id = 'my-worker-script' AND AccountId = 'account123'
ZonePlans:
SELECT * FROM ZonePlans WHERE ZoneId = 'zone123'
Zones:
SELECT * FROM Zones
INSERT INTO Zones (Name, IsPaused, Type) VALUES ('example.com', false, 'full')
UPDATE Zones SET IsPaused = false, VanityNameServers = '["ns1.example.com","ns2.example.com"]' WHERE Id = 'e0f1a2b3-c4d5-6e7f-8a9b-0c1d2e3f4a5b'
DELETE FROM Zones WHERE Id = 'e0f1a2b3-c4d5-6e7f-8a9b-0c1d2e3f4a5b'
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| APIEmail | The email address associated with your Cloudflare account for API authentication. |
| APIKey | The API key or API token for authentication to Cloudflare. |
| AuthScheme | The scheme used for authentication. Accepted entries are APIKey or None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT, OAUTH_PASSWORD |
| KeyType | Specifies whether APIKey contains a Global API Key or API Token. |