This document outlines how the API reference section works.
---
config:
flowchart:
defaultRenderer: "elk"
---
flowchart TD
docs_json["docs.json"]
mdx_pages["api-reference/{category}/*.mdx"]
openapi["api-reference/openapi.json"]
workflow[".github/workflows/update-api-spec.yml"]
script["update-api-spec.sh"]
subgraph ci["Github Actions"]
workflow -->|"runs every 48h"| script
end
subgraph docs["Documentation Content"]
docs_json -->|"defines sidebar navigation that points to"| mdx_pages
mdx_pages -->|"points to endpoint and auto-generates documentation based on"| openapi
end
ci -->|"pulls updated OpenAPI spec and formats it for Mintlify"| openapi
Defines the navigational structure of the docs. The "API" section determines the sidebar navigation structure of the API reference. Each path points to an MDX page in /api-reference.
Each page has an openapi attribute that points to an endpoint listed in api-reference/openapi.json. Mintlify auto-generates the documentation based on this information.
Contains a copy of the OpenAPI spec that all our API reference pages pull from. It's automatically updated every 48 hours by our Github Actions workflow.
Checkly's public OpenAPI spec can be found here: https://api.checklyhq.com/openapi.json. We have a copy saved to api-reference/openapi.json that we update every 48 hours. This copy is formatted to play nicely with how Mintlify renders pages, and all our API reference pages use this file to auto-generate the API reference documentation.
-
.github/workflows/update-api-spec.ymlruns the update script (update-api-spec.sh) every 48 hours and commits the changes tomain. View all recent runs. -
The update script (
update-api-spec.sh) pulls the most recent OpenAPI spec, cleans it up for use with Mintlify, and applies those edits toapi-reference/openapi.json.
If you need to add an endpoint to an API reference:
- Create the sidebar navigation item in
docs.json - Create a new file in
api-reference/{category}/\*.mdx. That file should have anopenapiattribute that references the corresponding endpoint. You can also define a custom title, if the OpenAPI spec doesn't have a nice one. For example:
---
openapi: get /v1/analytics/api-checks/{id}
title: API checks
---If you need to update your local copy of the OpenAPI spec, run ./update-api-spec.sh
That's it! Your new endpoint should be showing properly now.