Skip to main content

access_certificates

Creates, updates, deletes, gets or lists an access_certificates resource.

Overview

Nameaccess_certificates
TypeResource
Idcloudflare.zero_trust.access_certificates

Fields

The following fields are returned by SELECT queries:

Get an mTLS certificate response

NameDatatypeDescription
idstringThe ID of the application that will use this certificate.
namestringThe name of the certificate. (example: Allow devs)
associated_hostnamesarrayThe hostnames of the applications that will use this certificate.
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
expires_onstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
fingerprintstringThe MD5 fingerprint of the certificate. (example: MD5 Fingerprint=1E:80:0F:7A:FD:31:55:96:DE:D5:CB:E2:F0:91:F6:91)
updated_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcertificate_id, account_idFetches a single mTLS certificate.
createinsertaccount_id, name, certificateAdds a new mTLS root certificate to Access.
deletedeletecertificate_id, account_idDeletes an mTLS certificate.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
certificate_idstringThe certificate ID.

SELECT examples

Fetches a single mTLS certificate.

SELECT
id,
name,
associated_hostnames,
created_at,
expires_on,
fingerprint,
updated_at
FROM cloudflare.zero_trust.access_certificates
WHERE certificate_id = '{{ certificate_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Adds a new mTLS root certificate to Access.

INSERT INTO cloudflare.zero_trust.access_certificates (
associated_hostnames,
certificate,
name,
account_id
)
SELECT
'{{ associated_hostnames }}',
'{{ certificate }}' /* required */,
'{{ name }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

DELETE examples

Deletes an mTLS certificate.

DELETE FROM cloudflare.zero_trust.access_certificates
WHERE certificate_id = '{{ certificate_id }}' --required
AND account_id = '{{ account_id }}' --required
;