Skip to main content

TLS Certificates

Create TLS Certificate

Upload a new TLS certificate

Request

POST /tls_certificates

Example Request

curl \
-X POST \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"certificate_pem":"-----BEGIN CERTIFICATE-----\nMIIDDTCCAfWgAwIBAgIUBUunDdA4gjgtEbZA8w9Ljhvl3bEwDQYJKoZIhvcNAQEL\nBQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wHhcNMjAwMzI0MTgxODE5WhcNMjAw\nNDIzMTgxODE5WjAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAPKVkkKYNl3d9cqrz4tIFlwsohED5W4y1dcBixy4\nGANFFnw43nc2wPyKwYXumJqJIFrcW/NkUZL07bd+dou6mT6Gh/zbaTW91IkREPXL\n7b3KfVu4XkFosVXpWs0U6o4GrZ81CLiKBWI+H03x/ij5OSiJ1l71pqLeTJLOydAR\nAl8kpp7axeHU4UbDrAZkW5SnuZTjIKwVg0UNsBg1yNfUOu1Uah3BYaqPgQitC0Yg\nLW+NUGu/T91bkD7tLsVInkQXeQGdXBAqOycfJ7wj8OlIpyuXjTnGFA0izVmbQw5f\nrQnZ0geGyhLamvz9Gcd7mIlD/+/AEN9Lht82tAOzKG98/O8CAwEAAaNTMFEwHQYD\nVR0OBBYEFKv6RsvEC6T+zCtJZwB0FCR1sEkhMB8GA1UdIwQYMBaAFKv6RsvEC6T+\nzCtJZwB0FCR1sEkhMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB\nAC5fBrouinespo5+9AipjhY/HOKTg+OCnppFnSnqeU1eXZZJ0oakdHTpTNxtbQP9\ntOJTA2f3KWvmpNDMohEQXZz8wHDkdbrIXJKVp6zs1pEp+0BIjA4y9mSywa5xuyk0\noGeChRgGqp2JujDyPCb7LEaKKQEEdMqy73QG+jEAh14+wKixlAf1nATBdeCU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htcCYUtNk0cRw6LH8feKiorXHdDRB33t0c47QSD/6AGOjBtxqD7B\n3ZxyR3P+7RdQopLLRFN+FHAnmzsCgYEA9VSGZDFSK+fbg4CgwkWdzuHrAXaUEv0U\novqqWd/yXB9wauEvRHnOrSgW6hFZQiatJOXx0KnalJQzohz/SLGO0MqGtwQbYWVT\nWiJgjUbNeiPEHBeUA6U55lVQr26kQSUWdXEtRbDz+hqV1K+6tTEMzaSPmJiHNgki\nlNMO2gqGQd0CgYBJ268qx5zn2UJEGWG41j5NYbg1TfgFsLxugzI2/heX0TNxZVP1\nPQI7ydmYq2ElSJ6qZxSnoX5255i7FqT8xskV/bOkw83mhAGrxb8Cw+/I90wDq8h+\nl/ggOPdkijfDybq8TBae6SVgd/l3r6f9M1KcypmNMApVBSPN8daNvBOyVQKBgQDo\nsj2utyFrx8Xsm4rf+kxOuPbBMooM4MQ8OmpuSP6G5sMofWLqHmcs0sO5TK9PEYRV\nZU3ST+ml2FSJRdvWRaRi4laZLWoTHZrL+aN/HVM0sMwIoUyhkIy0ruOTIuzlZZpB\n1xHL8qXX6nOHgw8jYdz1CUuyv6owVMXaR77kjer+eQKBgByYZlR/eNTzlot0SdFl\nIbgQ9bV7VLIo+vKzOXE3trfzRJMgUosLTp+5wdSVSW/VBdYZ7Ir3n0bbpY/dGinI\nVShxPbChhCZnhvG2lEEiekI44m5jHSA6hhtRdt/CrhL65Rw2SE5lMEe8htg1UGus\nwzLHWHBl72FjbjdhvEgrq60W\n-----END PRIVATE KEY-----"}' \
https://api.ngrok.com/tls_certificates

Parameters

NameTypeDescription
descriptionstringhuman-readable description of this TLS certificate. optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.
certificate_pemstringchain of PEM-encoded certificates, leaf first. See Certificate Bundles.
private_key_pemstringprivate key for the TLS certificate, PEM-encoded. See Private Keys.

Response

Returns a 201 response on success

Example Response

{
"certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIDDTCC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END CERTIFICATE-----\n",
"created_at": "2024-05-23T20:36:22Z",
"extended_key_usages": [],
"id": "cert_2gsqMHn9jP3GYN6piH3MKdD6ysE",
"issued_at": null,
"issuer_common_name": "example.com",
"key_usages": [],
"not_after": "2020-04-23T18:18:19Z",
"not_before": "2020-03-24T18:18:19Z",
"private_key_type": "rsa",
"serial_number": "054ba70dd03882382d11b640f30f4b8e1be5ddb1",
"subject_alternative_names": {
"dns_names": [],
"ips": []
},
"subject_common_name": "example.com",
"subject_country": "",
"subject_locality": "",
"subject_organization": "",
"subject_organizational_unit": "",
"subject_province": "",
"uri": "https://api.ngrok.com/tls_certificates/cert_2gsqMHn9jP3GYN6piH3MKdD6ysE"
}

Fields

NameTypeDescription
idstringunique identifier for this TLS certificate
uristringURI of the TLS certificate API resource
created_atstringtimestamp when the TLS certificate was created, RFC 3339 format
descriptionstringhuman-readable description of this TLS certificate. optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.
certificate_pemstringchain of PEM-encoded certificates, leaf first. See Certificate Bundles.
subject_common_namestringsubject common name from the leaf of this TLS certificate
subject_alternative_namesTLSCertificateSANssubject alternative names (SANs) from the leaf of this TLS certificate
issued_atstringtimestamp (in RFC 3339 format) when this TLS certificate was issued automatically, or null if this certificate was user-uploaded
not_beforestringtimestamp when this TLS certificate becomes valid, RFC 3339 format
not_afterstringtimestamp when this TLS certificate becomes invalid, RFC 3339 format
key_usagesList<string>set of actions the private key of this TLS certificate can be used for
extended_key_usagesList<string>extended set of actions the private key of this TLS certificate can be used for
private_key_typestringtype of the private key of this TLS certificate. One of rsa, ecdsa, or ed25519.
issuer_common_namestringissuer common name from the leaf of this TLS certificate
serial_numberstringserial number of the leaf of this TLS certificate
subject_organizationstringsubject organization from the leaf of this TLS certificate
subject_organizational_unitstringsubject organizational unit from the leaf of this TLS certificate
subject_localitystringsubject locality from the leaf of this TLS certificate
subject_provincestringsubject province from the leaf of this TLS certificate
subject_countrystringsubject country from the leaf of this TLS certificate

TLSCertificateSANs fields

NameTypeDescription
dns_namesList<string>set of additional domains (including wildcards) this TLS certificate is valid for
ipsList<string>set of IP addresses this TLS certificate is also valid for

Delete TLS Certificate

Delete a TLS certificate

Request

DELETE /tls_certificates/{id}

Example Request

curl \
-X DELETE \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/tls_certificates/cert_2gsqMHn9jP3GYN6piH3MKdD6ysE

Response

Returns a 204 response with no body on success

Get TLS Certificate

Get detailed information about a TLS certificate

Request

GET /tls_certificates/{id}

Example Request

curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/tls_certificates/cert_2gsqMHn9jP3GYN6piH3MKdD6ysE

Response

Returns a 200 response on success

Example Response

{
"certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIDDTCCAfWgAwIBAgIUBUunDdA4gjgtEbZA8w9Ljhvl3bEwDQYJKoZIhvcNAQEL\nBQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wHhcNMjAwMzI0MTgxODE5WhcNMjAw\nNDIzMTgxODE5WjAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAPKVkkKYNl3d9cqrz4tIFlwsohED5W4y1dcBixy4\nGANFFnw43nc2wPyKwYXumJqJIFrcW/NkUZL07bd+dou6mT6Gh/zbaTW91IkREPXL\n7b3KfVu4XkFosVXpWs0U6o4GrZ81CLiKBWI+H03x/ij5OSiJ1l71pqLeTJLOydAR\nAl8kpp7axeHU4UbDrAZkW5SnuZTjIKwVg0UNsBg1yNfUOu1Uah3BYaqPgQitC0Yg\nLW+NUGu/T91bkD7tLsVInkQXeQGdXBAqOycfJ7wj8OlIpyuXjTnGFA0izVmbQw5f\nrQnZ0geGyhLamvz9Gcd7mIlD/+/AEN9Lht82tAOzKG98/O8CAwEAAaNTMFEwHQYD\nVR0OBBYEFKv6RsvEC6T+zCtJZwB0FCR1sEkhMB8GA1UdIwQYMBaAFKv6RsvEC6T+\nzCtJZwB0FCR1sEkhMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB\nAC5fBrouinespo5+9AipjhY/HOKTg+OCnppFnSnqeU1eXZZJ0oakdHTpTNxtbQP9\ntOJTA2f3KWvmpNDMohEQXZz8wHDkdbrIXJKVp6zs1pEp+0BIjA4y9mSywa5xuyk0\noGeChRgGqp2JujDyPCb7LEaKKQEEdMqy73QG+jEAh14+wKixlAf1nATBdeCUvssK\n2x1uZMyqjJFB5y/5EdnWQzD4WJkrsCkxsZHVMN1d+dqf2sf3dTRV8fzsFGOG17NS\n6u2n9iGcFdBA82XN8yeLIWhy1t3GWutG1sdxENbFRRXea+iUqzDsmRtkaBma2GLQ\nd6JTpFbsCtwDjP23UEi7SZo=\n-----END CERTIFICATE-----\n",
"created_at": "2024-05-23T20:36:22Z",
"extended_key_usages": [],
"id": "cert_2gsqMHn9jP3GYN6piH3MKdD6ysE",
"issued_at": null,
"issuer_common_name": "example.com",
"key_usages": [],
"metadata": "{\"example\": true}",
"not_after": "2020-04-23T18:18:19Z",
"not_before": "2020-03-24T18:18:19Z",
"private_key_type": "rsa",
"serial_number": "054ba70dd03882382d11b640f30f4b8e1be5ddb1",
"subject_alternative_names": {
"dns_names": [],
"ips": []
},
"subject_common_name": "example.com",
"subject_country": "",
"subject_locality": "",
"subject_organization": "",
"subject_organizational_unit": "",
"subject_province": "",
"uri": "https://api.ngrok.com/tls_certificates/cert_2gsqMHn9jP3GYN6piH3MKdD6ysE"
}

Fields

NameTypeDescription
idstringunique identifier for this TLS certificate
uristringURI of the TLS certificate API resource
created_atstringtimestamp when the TLS certificate was created, RFC 3339 format
descriptionstringhuman-readable description of this TLS certificate. optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.
certificate_pemstringchain of PEM-encoded certificates, leaf first. See Certificate Bundles.
subject_common_namestringsubject common name from the leaf of this TLS certificate
subject_alternative_namesTLSCertificateSANssubject alternative names (SANs) from the leaf of this TLS certificate
issued_atstringtimestamp (in RFC 3339 format) when this TLS certificate was issued automatically, or null if this certificate was user-uploaded
not_beforestringtimestamp when this TLS certificate becomes valid, RFC 3339 format
not_afterstringtimestamp when this TLS certificate becomes invalid, RFC 3339 format
key_usagesList<string>set of actions the private key of this TLS certificate can be used for
extended_key_usagesList<string>extended set of actions the private key of this TLS certificate can be used for
private_key_typestringtype of the private key of this TLS certificate. One of rsa, ecdsa, or ed25519.
issuer_common_namestringissuer common name from the leaf of this TLS certificate
serial_numberstringserial number of the leaf of this TLS certificate
subject_organizationstringsubject organization from the leaf of this TLS certificate
subject_organizational_unitstringsubject organizational unit from the leaf of this TLS certificate
subject_localitystringsubject locality from the leaf of this TLS certificate
subject_provincestringsubject province from the leaf of this TLS certificate
subject_countrystringsubject country from the leaf of this TLS certificate

TLSCertificateSANs fields

NameTypeDescription
dns_namesList<string>set of additional domains (including wildcards) this TLS certificate is valid for
ipsList<string>set of IP addresses this TLS certificate is also valid for

List TLS Certificates

List all TLS certificates on this account

Request

GET /tls_certificates

Example Request

curl \
-X GET \
-H "Authorization: Bearer {API_KEY}" \
-H "Ngrok-Version: 2" \
https://api.ngrok.com/tls_certificates

Response

Returns a 200 response on success

Example Response

{
"next_page_uri": null,
"tls_certificates": [
{
"certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIDDTCCAfWgAwIBAgIUBUunDdA4gjgtEbZA8w9Ljhvl3bEwDQYJKoZIhvcNAQEL\nBQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wHhcNMjAwMzI0MTgxODE5WhcNMjAw\nNDIzMTgxODE5WjAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAPKVkkKYNl3d9cqrz4tIFlwsohED5W4y1dcBixy4\nGANFFnw43nc2wPyKwYXumJqJIFrcW/NkUZL07bd+dou6mT6Gh/zbaTW91IkREPXL\n7b3KfVu4XkFosVXpWs0U6o4GrZ81CLiKBWI+H03x/ij5OSiJ1l71pqLeTJLOydAR\nAl8kpp7axeHU4UbDrAZkW5SnuZTjIKwVg0UNsBg1yNfUOu1Uah3BYaqPgQitC0Yg\nLW+NUGu/T91bkD7tLsVInkQXeQGdXBAqOycfJ7wj8OlIpyuXjTnGFA0izVmbQw5f\nrQnZ0geGyhLamvz9Gcd7mIlD/+/AEN9Lht82tAOzKG98/O8CAwEAAaNTMFEwHQYD\nVR0OBBYEFKv6RsvEC6T+zCtJZwB0FCR1sEkhMB8GA1UdIwQYMBaAFKv6RsvEC6T+\nzCtJZwB0FCR1sEkhMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB\nAC5fBrouinespo5+9AipjhY/HOKTg+OCnppFnSnqeU1eXZZJ0oakdHTpTNxtbQP9\ntOJTA2f3KWvmpNDMohEQXZz8wHDkdbrIXJKVp6zs1pEp+0BIjA4y9mSywa5xuyk0\noGeChRgGqp2JujDyPCb7LEaKKQEEdMqy73QG+jEAh14+wKixlAf1nATBdeCUvssK\n2x1uZMyqjJFB5y/5EdnWQzD4WJkrsCkxsZHVMN1d+dqf2sf3dTRV8fzsFGOG17NS\n6u2n9iGcFdBA82XN8yeLIWhy1t3GWutG1sdxENbFRRXea+iUqzDsmRtkaBma2GLQ\nd6JTpFbsCtwDjP23UEi7SZo=\n-----END CERTIFICATE-----\n",
"created_at": "2024-05-23T20:36:00Z",
"extended_key_usages": [],
"id": "cert_2gsqJSUdaNHhZLkyG7ZxW38lbNq",
"issued_at": null,
"issuer_common_name": "example.com",
"key_usages": [],
"not_after": "2020-04-23T18:18:19Z",
"not_before": "2020-03-24T18:18:19Z",
"private_key_type": "rsa",
"serial_number": "054ba70dd03882382d11b640f30f4b8e1be5ddb1",
"subject_alternative_names": {
"dns_names": [],
"ips": []
},
"subject_common_name": "example.com",
"subject_country": "",
"subject_locality": "",
"subject_organization": "",
"subject_organizational_unit": "",
"subject_province": "",
"uri": "https://api.ngrok.com/tls_certificates/cert_2gsqJSUdaNHhZLkyG7ZxW38lbNq"
},
{
"certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIDDTCCAfWgAwIBAgIUBUunDdA4gjgtEbZA8w9Ljhvl3bEwDQYJKoZIhvcNAQEL\nBQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wHhcNMjAwMzI0MTgxODE5WhcNMjAw\nNDIzMTgxODE5WjAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAPKVkkKYNl3d9cqrz4tIFlwsohED5W4y1dcBixy4\nGANFFnw43nc2wPyKwYXumJqJIFrcW/NkUZL07bd+dou6mT6Gh/zbaTW91IkREPXL\n7b3KfVu4XkFosVXpWs0U6o4GrZ81CLiKBWI+H03x/ij5OSiJ1l71pqLeTJLOydAR\nAl8kpp7axeHU4UbDrAZkW5SnuZTjIKwVg0UNsBg1yNfUOu1Uah3BYaqPgQitC0Yg\nLW+NUGu/T91bkD7tLsVInkQXeQGdXBAqOycfJ7wj8OlIpyuXjTnGFA0izVmbQw5f\nrQnZ0geGyhLamvz9Gcd7mIlD/+/AEN9Lht82tAOzKG98/O8CAwEAAaNTMFEwHQYD\nVR0OBBYEFKv6RsvEC6T+zCtJZwB0FCR1sEkhMB8GA1UdIwQYMBaAFKv6RsvEC6T+\nzCtJZwB0FCR1sEkhMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB\nAC5fBrouinespo5+9AipjhY/HOKTg+OCnppFnSnqeU1eXZZJ0oakdHTpTNxtbQP9\ntOJTA2f3KWvmpNDMohEQXZz8wHDkdbrIXJKVp6zs1pEp+0BIjA4y9mSywa5xuyk0\noGeChRgGqp2JujDyPCb7LEaKKQEEdMqy73QG+jEAh14+wKixlAf1nATBdeCUvssK\n2x1uZMyqjJFB5y/5EdnWQzD4WJkrsCkxsZHVMN1d+dqf2sf3dTRV8fzsFGOG17NS\n6u2n9iGcFdBA82XN8yeLIWhy1t3GWutG1sdxENbFRRXea+iUqzDsmRtkaBma2GLQ\nd6JTpFbsCtwDjP23UEi7SZo=\n-----END CERTIFICATE-----\n",
"created_at": "2024-05-23T20:36:22Z",
"extended_key_usages": [],
"id": "cert_2gsqMHn9jP3GYN6piH3MKdD6ysE",
"issued_at": null,
"issuer_common_name": "example.com",
"key_usages": [],
"not_after": "2020-04-23T18:18:19Z",
"not_before": "2020-03-24T18:18:19Z",
"private_key_type": "rsa",
"serial_number": "054ba70dd03882382d11b640f30f4b8e1be5ddb1",
"subject_alternative_names": {
"dns_names": [],
"ips": []
},
"subject_common_name": "example.com",
"subject_country": "",
"subject_locality": "",
"subject_organization": "",
"subject_organizational_unit": "",
"subject_province": "",
"uri": "https://api.ngrok.com/tls_certificates/cert_2gsqMHn9jP3GYN6piH3MKdD6ysE"
}
],
"uri": "https://api.ngrok.com/tls_certificates"
}

Fields

NameTypeDescription
tls_certificatesTLSCertificatethe list of all TLS certificates on this account
uristringURI of the TLS certificates list API resource
next_page_uristringURI of the next page, or null if there is no next page

TLSCertificate fields

NameTypeDescription
idstringunique identifier for this TLS certificate
uristringURI of the TLS certificate API resource
created_atstringtimestamp when the TLS certificate was created, RFC 3339 format
descriptionstringhuman-readable description of this TLS certificate. optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.
certificate_pemstringchain of PEM-encoded certificates, leaf first. See Certificate Bundles.
subject_common_namestringsubject common name from the leaf of this TLS certificate
subject_alternative_namesTLSCertificateSANssubject alternative names (SANs) from the leaf of this TLS certificate
issued_atstringtimestamp (in RFC 3339 format) when this TLS certificate was issued automatically, or null if this certificate was user-uploaded
not_beforestringtimestamp when this TLS certificate becomes valid, RFC 3339 format
not_afterstringtimestamp when this TLS certificate becomes invalid, RFC 3339 format
key_usagesList<string>set of actions the private key of this TLS certificate can be used for
extended_key_usagesList<string>extended set of actions the private key of this TLS certificate can be used for
private_key_typestringtype of the private key of this TLS certificate. One of rsa, ecdsa, or ed25519.
issuer_common_namestringissuer common name from the leaf of this TLS certificate
serial_numberstringserial number of the leaf of this TLS certificate
subject_organizationstringsubject organization from the leaf of this TLS certificate
subject_organizational_unitstringsubject organizational unit from the leaf of this TLS certificate
subject_localitystringsubject locality from the leaf of this TLS certificate
subject_provincestringsubject province from the leaf of this TLS certificate
subject_countrystringsubject country from the leaf of this TLS certificate

TLSCertificateSANs fields

NameTypeDescription
dns_namesList<string>set of additional domains (including wildcards) this TLS certificate is valid for
ipsList<string>set of IP addresses this TLS certificate is also valid for

Update TLS Certificate

Update attributes of a TLS Certificate by ID

Request

PATCH /tls_certificates/{id}

Example Request

curl \
-X PATCH \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"metadata":"{\"example\": true}"}' \
https://api.ngrok.com/tls_certificates/cert_2gsqMHn9jP3GYN6piH3MKdD6ysE

Parameters

NameTypeDescription
idstring
descriptionstringhuman-readable description of this TLS certificate. optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.

Response

Returns a 200 response on success

Example Response

{
"certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIDDTCCAfWgAwIBAgIUBUunDdA4gjgtEbZA8w9Ljhvl3bEwDQYJKoZIhvcNAQEL\nBQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wHhcNMjAwMzI0MTgxODE5WhcNMjAw\nNDIzMTgxODE5WjAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAPKVkkKYNl3d9cqrz4tIFlwsohED5W4y1dcBixy4\nGANFFnw43nc2wPyKwYXumJqJIFrcW/NkUZL07bd+dou6mT6Gh/zbaTW91IkREPXL\n7b3KfVu4XkFosVXpWs0U6o4GrZ81CLiKBWI+H03x/ij5OSiJ1l71pqLeTJLOydAR\nAl8kpp7axeHU4UbDrAZkW5SnuZTjIKwVg0UNsBg1yNfUOu1Uah3BYaqPgQitC0Yg\nLW+NUGu/T91bkD7tLsVInkQXeQGdXBAqOycfJ7wj8OlIpyuXjTnGFA0izVmbQw5f\nrQnZ0geGyhLamvz9Gcd7mIlD/+/AEN9Lht82tAOzKG98/O8CAwEAAaNTMFEwHQYD\nVR0OBBYEFKv6RsvEC6T+zCtJZwB0FCR1sEkhMB8GA1UdIwQYMBaAFKv6RsvEC6T+\nzCtJZwB0FCR1sEkhMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB\nAC5fBrouinespo5+9AipjhY/HOKTg+OCnppFnSnqeU1eXZZJ0oakdHTpTNxtbQP9\ntOJTA2f3KWvmpNDMohEQXZz8wHDkdbrIXJKVp6zs1pEp+0BIjA4y9mSywa5xuyk0\noGeChRgGqp2JujDyPCb7LEaKKQEEdMqy73QG+jEAh14+wKixlAf1nATBdeCUvssK\n2x1uZMyqjJFB5y/5EdnWQzD4WJkrsCkxsZHVMN1d+dqf2sf3dTRV8fzsFGOG17NS\n6u2n9iGcFdBA82XN8yeLIWhy1t3GWutG1sdxENbFRRXea+iUqzDsmRtkaBma2GLQ\nd6JTpFbsCtwDjP23UEi7SZo=\n-----END CERTIFICATE-----\n",
"created_at": "2024-05-23T20:36:22Z",
"extended_key_usages": [],
"id": "cert_2gsqMHn9jP3GYN6piH3MKdD6ysE",
"issued_at": null,
"issuer_common_name": "example.com",
"key_usages": [],
"metadata": "{\"example\": true}",
"not_after": "2020-04-23T18:18:19Z",
"not_before": "2020-03-24T18:18:19Z",
"private_key_type": "rsa",
"serial_number": "054ba70dd03882382d11b640f30f4b8e1be5ddb1",
"subject_alternative_names": {
"dns_names": [],
"ips": []
},
"subject_common_name": "example.com",
"subject_country": "",
"subject_locality": "",
"subject_organization": "",
"subject_organizational_unit": "",
"subject_province": "",
"uri": "https://api.ngrok.com/tls_certificates/cert_2gsqMHn9jP3GYN6piH3MKdD6ysE"
}

Fields

NameTypeDescription
idstringunique identifier for this TLS certificate
uristringURI of the TLS certificate API resource
created_atstringtimestamp when the TLS certificate was created, RFC 3339 format
descriptionstringhuman-readable description of this TLS certificate. optional, max 255 bytes.
metadatastringarbitrary user-defined machine-readable data of this TLS certificate. optional, max 4096 bytes.
certificate_pemstringchain of PEM-encoded certificates, leaf first. See Certificate Bundles.
subject_common_namestringsubject common name from the leaf of this TLS certificate
subject_alternative_namesTLSCertificateSANssubject alternative names (SANs) from the leaf of this TLS certificate
issued_atstringtimestamp (in RFC 3339 format) when this TLS certificate was issued automatically, or null if this certificate was user-uploaded
not_beforestringtimestamp when this TLS certificate becomes valid, RFC 3339 format
not_afterstringtimestamp when this TLS certificate becomes invalid, RFC 3339 format
key_usagesList<string>set of actions the private key of this TLS certificate can be used for
extended_key_usagesList<string>extended set of actions the private key of this TLS certificate can be used for
private_key_typestringtype of the private key of this TLS certificate. One of rsa, ecdsa, or ed25519.
issuer_common_namestringissuer common name from the leaf of this TLS certificate
serial_numberstringserial number of the leaf of this TLS certificate
subject_organizationstringsubject organization from the leaf of this TLS certificate
subject_organizational_unitstringsubject organizational unit from the leaf of this TLS certificate
subject_localitystringsubject locality from the leaf of this TLS certificate
subject_provincestringsubject province from the leaf of this TLS certificate
subject_countrystringsubject country from the leaf of this TLS certificate

TLSCertificateSANs fields

NameTypeDescription
dns_namesList<string>set of additional domains (including wildcards) this TLS certificate is valid for
ipsList<string>set of IP addresses this TLS certificate is also valid for