How do I find out when a Heroku SSL (SNI) endpoint was created or last updated?

Issue

You want to see when changes to a Heroku SSL endpoint took place.

Resolution

Information about an SSL certificate's expiration can be obtained via the CLI with the heroku certs command. However, information about when the certificate was created can only be obtained via the Heroku API directly.

This information is currently available via the Heroku Platform API here: https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint-info

First, you'll want to obtain the name of your API endpoint. You can do this with the CLI command: heroku certs. Example:

Name                   Common Name(s)      Expires               Trusted  Type

andesaurus-56621       mydomain.com      2023-09-21 15:57 UTC  True     ACM
argentinosaurus-68132  www.mydomain.com  2023-09-21 16:01 UTC  True     ACM

Then, to find out additional information about the endpoint in question (we'll use the argentinosaurus-68132 endpoint in this example), you can run the following curl command against the Heroku API:

$ curl -n GET https://api.heroku.com/apps/my-heroku-app-name/sni-endpoints/argentinosaurus-68132 \
-H "Accept: application/vnd.heroku+json; version=3" \
-H "Authorization: Bearer HEROKU_API_KEY"

(make sure to replace my-heroku-app-name with your Heroku app's name, argentinosaurus-68132 with your endpoint name, and HEROKU_API_KEY with your Heroku API token)

The output of this command will include the certificate chain, as well as the created_at and updated_at information. For example:

{
  "app": {
    "id": "061x7fa0-1350-40b5-943c-372d3d60e77a",
    "name": "my-heroku-app-name"
  },
...
  "created_at": "2023-06-23T17:01:28Z",
  "id": "f81c3e55-8793-46f8-8651-ac17b672c18f",
  "name": "argentinosaurus-68132",
  "updated_at": "2023-06-23T17:01:28Z",
...
}

Note the created_at and updated_at endpoints.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support