Skip to content

Commit 82c2cfd

Browse files
Documentation edits made through Mintlify web editor
1 parent 2572781 commit 82c2cfd

File tree

17 files changed

+437
-498
lines changed

17 files changed

+437
-498
lines changed

advanced/rest-api/overview.mdx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ title: Overview
44

55
## Trigger Updates
66

7-
Leverage the REST API to programmatically trigger an update when desired.
8-
The primary use-case will be to trigger updates. We will be adding more and more
9-
functionality to the API overtime. Let us know what else you want to see in
7+
You can use our REST API to automatically start updates whenever you need them.
8+
The main purpose is to let you control when updates happen. We're working on adding more
9+
features to the API over time. Have suggestions? Share them with us in
1010
[our community](https://mintlify.com/community)!
1111

1212
## Authentication
1313

14-
You can generate an API key through
15-
[the dashboard](https://dashboard.mintlify.com/settings/integrations). The API key is
16-
associated with the entire org and can be used across multiple deployments.
14+
To use the API, you'll need an API key. You can create one through
15+
[the dashboard](https://dashboard.mintlify.com/settings/integrations). This key works for your whole organization and can be used across all your deployments.
1716

1817
<Frame>
1918
<img src="/images/external-api-key.png" />
2019
</Frame>
2120

2221
## Discovery API
2322

24-
The Discovery API allows you to embed an AI chat experience grounded in your docs and continually kept up to date into any application of your choosing.
25-
Responses include citations so you can point your users to the right places they need to get help.
23+
The Discovery API helps you add AI-powered chat to your documentation. This chat feature understands your docs and stays current with any changes you make.
24+
When the AI responds, it includes references to show users exactly where the information came from.
2625

2726
## Getting Started
2827

29-
To get started, you'll need to generate a Discovery API key in the [dashboard](https://dashboard.mintlify.com/products/chat/widget):
28+
Follow these steps to begin:
29+
1. First, create a Discovery API key in the [dashboard](https://dashboard.mintlify.com/products/chat/widget):
3030

3131
<Frame>
3232
<img
@@ -36,10 +36,9 @@ To get started, you'll need to generate a Discovery API key in the [dashboard](h
3636
</Frame>
3737

3838
<Note>
39-
The Discovery API token is a public token that can be referenced in your
40-
frontend code whereas the API key is a server-side token that should be kept
41-
secret.
39+
There are two types of keys:
40+
- The Discovery API token is public and can be used in your website's code
41+
- The API key is private and should be kept secure on your server
4242
</Note>
4343

44-
Now that you have an API key, check out our [example](https://github.com/mintlify/discovery-api-example) for how to use
45-
the API for AI chat. You can also see a deployed version of this example at [chat.mintlify.com](https://chat.mintlify.com).
44+
Once you have your API key, you can see how to use it by checking out our [example code](https://github.com/mintlify/discovery-api-example). Want to see it in action? Visit [chat.mintlify.com](https://chat.mintlify.com) to try a live demo.

advanced/subpath/cloudflare.mdx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ description: "Host documentation at a /docs subpath using Cloudflare Workers"
55

66
## Create Cloudflare Worker
77

8-
Navigate to the `Workers & Pages > Create application > Create worker`. You
9-
should be able to presented with the following screen where you can create a new
10-
Cloudlfare worker.
8+
To get started, go to `Workers & Pages > Create application > Create worker` in your Cloudflare dashboard. You'll see a screen where you can set up a new Cloudflare worker.
119

1210
<Frame>
1311
<img alt="Create a Cloudflare worker" src="/images/cloudflare/worker.png" />
1412
</Frame>
1513

1614
### Add custom domain
1715

18-
Once the worker is created, click `Configure worker`. Navigate to the worker
19-
`Settings > Triggers`. Click on `Add Custom Domain` to add your desired domain
20-
into the list - we recommend you add both the version with and without `www.`
21-
prepended to the domain.
16+
After creating your worker, follow these steps:
17+
1. Click `Configure worker`
18+
2. Go to `Settings > Triggers`
19+
3. Click `Add Custom Domain`
20+
4. Add your domain to the list
21+
- We suggest adding two versions: one with `www.` and one without it
2222

2323
<Frame>
2424
<img
@@ -27,21 +27,20 @@ prepended to the domain.
2727
/>
2828
</Frame>
2929

30-
If you have trouble setting up a custom subdirectory,
31-
[contact our support team](mailto:[email protected]) and we'll walk you through
32-
upgrading your hosting with us.
30+
Need help setting up your custom subdirectory? [Contact our support team](mailto:[email protected]) and we'll help you upgrade your hosting.
3331

3432
### Edit Worker Script
3533

36-
Click on `Edit Code` and add the following script into the worker's code.
34+
Now you'll need to add some code to your worker. Click on `Edit Code` and copy the script below into the code editor.
3735

3836
<Frame>
3937
<img alt="Cloudflare edit code" src="/images/cloudflare/edit-code.png" />
4038
</Frame>
4139

4240
<Tip>
43-
Edit `DOCS_URL` by replacing `[SUBDOMAIN]` with your unique subdomain and
44-
`CUSTOM_URL` with your website's base URL.
41+
Before using the code, you need to make two changes in `DOCS_URL`:
42+
1. Replace `[SUBDOMAIN]` with your unique subdomain
43+
2. Replace `CUSTOM_URL` with your website's base URL
4544
</Tip>
4645

4746
```javascript
@@ -76,5 +75,4 @@ async function handleRequest(request) {
7675
}
7776
```
7877

79-
Click on `Deploy` and wait for the changes to propagate (it can take up to a few
80-
hours).
78+
Click `Deploy` to save your changes. Please note that it might take a few hours before all changes are fully active across the network.

api-playground/openapi/advanced-features.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
22
title: "Advanced Features"
3-
description: "Support for advanced OpenAPI features"
3+
description: "Learn how to use powerful OpenAPI features"
44
---
55

6-
OpenAPI 3 has some advanced features for describing complex APIs. Here's how you can use them with Mintlify.
6+
OpenAPI 3 offers several advanced ways to describe complex APIs. Let's explore how to use these features with Mintlify.
77

88
## `oneOf`, `anyOf`, `allOf`
99

10-
For complex datatypes, OpenAPI provides the `oneOf`, `anyOf`, and `allOf` keywords, allowing you to combine schemas in certain ways. You can read more about these keywords in the [Swagger documentation](https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/), but essentially:
10+
OpenAPI provides three special keywords to help you work with complex data types: `oneOf`, `anyOf`, and `allOf`. These keywords let you combine different data structures. Here's what each one does:
1111

12-
- `oneOf` functions like an "exclusive-or" operator
13-
- `anyOf` functions like an "or" operator
14-
- `allOf` functions like an "and" operator
12+
- `oneOf`: Means "pick exactly one option from the list"
13+
- `anyOf`: Means "pick one or more options from the list"
14+
- `allOf`: Means "include everything from all options"
1515

16-
<Warning>Mintlify treats the `oneOf` and `anyOf` keywords the same. We have found that, when people use `oneOf`, they often *mean* `anyOf` - and there is often no meaningful difference to the user.</Warning>
16+
<Warning>In Mintlify, we handle `oneOf` and `anyOf` the same way. We've found that most developers use these terms interchangeably, and the difference rarely matters to users.</Warning>
1717

18-
<Info>Mintlify currently does not support the `not` keyword.</Info>
18+
<Info>Note: Mintlify doesn't support the `not` keyword at this time.</Info>
1919

20-
### Combining schemas with `allOf`
20+
### Using `allOf` to Combine Data Structures
2121

22-
Mintlify performs some preprocessing on your OpenAPI document to display these complex combinations in a readable way. For example, when you combine two object schemas with `allOf`, Mintlify combines the properties of both into a single object. This becomes especially useful when leveraging [OpenAPI's reusable `components`](https://swagger.io/docs/specification/components/).
22+
Mintlify makes it easy to read combined data structures. For example, when you join two objects with `allOf`, we show all their properties together in one place. This is especially helpful when you're using [reusable components in OpenAPI](https://swagger.io/docs/specification/components/).
2323

2424
```yaml
2525
org_with_users:
@@ -52,9 +52,9 @@ components:
5252
</Expandable>
5353
</ParamField>
5454
55-
### Providing options with `oneOf` and `anyOf`
55+
### Offering Choices with `oneOf` and `anyOf`
5656

57-
When you use `oneOf` or `anyOf`, Mintlify displays the options in a tabbed container. To give your options helpful names, make sure to give each subschema a `title` field. For example, here's how you might display two different types of delivery addresses:
57+
When you use `oneOf` or `anyOf`, Mintlify shows the options in tabs. To make these tabs easy to understand, give each option a clear title. Here's an example showing two different ways to write a delivery address:
5858

5959
```yaml
6060
delivery_address:
@@ -94,21 +94,21 @@ delivery_address:
9494

9595
## `x-codeSamples`
9696

97-
If your users interact with your API using an SDK rather than directly through a network request, you can add code samples to your OpenAPI document, and Mintlify will display them in your OpenAPI pages. You can define your code samples using the `x-codeSamples` extension. This property can be added within any request method, and has the following schema:
97+
If your users work with your API through an SDK instead of direct API calls, you can add example code to your documentation. Use the `x-codeSamples` feature to add these examples. You can add this to any API endpoint, and it needs:
9898

9999
<ParamField body="lang" type="string" required>
100-
The language of the code sample.
100+
The programming language used in the example
101101
</ParamField>
102102

103103
<ParamField body="label" type="string">
104-
The label for the sample. This is useful when providing multiple examples for a single endpoint.
104+
A name for the example (helpful when you have multiple examples)
105105
</ParamField>
106106

107107
<ParamField body="source" type="string" required>
108-
The source code of the sample.
108+
The actual code for the example
109109
</ParamField>
110110

111-
Here's an example of some code samples for a plant tracking app, which has both a Bash CLI tool and a JavaScript SDK.
111+
Here's an example from a plant tracking app that has both a command-line tool and a JavaScript SDK:
112112

113113
```yaml
114114
paths:
@@ -134,4 +134,4 @@ paths:
134134
source: |
135135
const planter = require('planter');
136136
planter.list({ potted: true });
137-
```
137+
```

api-playground/openapi/setup.mdx

Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
22
title: "OpenAPI Setup"
3-
description: "Reference OpenAPI endpoints in your docs pages"
3+
description: "Learn how to add API documentation to your pages"
44
---
55

6-
## Add an OpenAPI specification file
6+
## Add an OpenAPI File
77

8-
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI
9-
document in either JSON or YAML format that follows the
10-
[OpenAPI specification](https://swagger.io/specification/). Your document must
11-
follow OpenAPI specification 3.0+.
8+
To document your API endpoints, you'll need a valid OpenAPI file in either JSON or YAML format. This file needs to follow the [OpenAPI 3.0+ specification](https://swagger.io/specification/).
129

13-
## Auto-populate API pages
10+
## Quick Setup: Auto-generate API Pages
1411

15-
The fastest way to get started with OpenAPI is to add an `openapi` field to a tab or anchor in the `mint.json`. This field can contain either the path to an OpenAPI document in your docs repo, or the URL of a hosted OpenAPI document. Mintlify will automatically generate a page for each OpenAPI operation and place them in the tab/anchor.
12+
The easiest way to get started is to add an `openapi` field to your `mint.json` file. You can either:
13+
- Point to an OpenAPI file in your docs folder
14+
- Link to an OpenAPI file hosted online
1615

17-
**Example with Anchors:**
16+
Mintlify will then create pages for each API endpoint automatically.
17+
18+
**Setting up with Anchors:**
1819

1920
```json {5}
2021
{
@@ -31,7 +32,7 @@ The fastest way to get started with OpenAPI is to add an `openapi` field to a ta
3132

3233
![](/images/anchors-autogeneration-anchors.png)
3334

34-
**Example with Tabs:**
35+
**Setting up with Tabs:**
3536

3637
```json {6}
3738
{
@@ -47,66 +48,54 @@ The fastest way to get started with OpenAPI is to add an `openapi` field to a ta
4748

4849
![](/images/autogeneration-with-tabs.png)
4950

50-
<Tip>To validate your OpenAPI spec, you can use this command: <br/>`mintlify openapi-check <openapiFilenameOrUrl>`</Tip>
51-
52-
53-
When using this option, the metadata for the generated pages will have the following default values:
54-
55-
* `title`: The `summary` field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint.
51+
<Tip>Check if your OpenAPI file is valid with this command: <br/>`mintlify openapi-check <yourFile>`</Tip>
5652

57-
* `description`: The `description` field from the OpenAPI operation, if present.
53+
When you use this auto-generate option, your pages will have these default settings:
54+
* The page title will use the OpenAPI operation's `summary` field, or create one from the endpoint details
55+
* The description will come from the OpenAPI operation's `description` field
56+
* The version will match what's in your anchor or tab settings
5857

59-
* `version`: The `version` value from the anchor or tab, if present.
58+
Need more control? You can create custom pages for each API endpoint using MDX files.
6059

61-
There are some scenarios in which the default behavior isn't sufficient. If you need more customizability, you can create an MDX page for your OpenAPI operation, and modify it just like any other MDX page.
60+
## Custom API Pages with MDX
6261

63-
## Create MDX files for API pages
62+
Sometimes you might want to:
63+
- Change how the page information appears
64+
- Add extra content
65+
- Skip certain API endpoints
66+
- Change the order of pages
6467

65-
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you'll need an MDX page for each operation. Here is [an example MDX OpenAPI page](https://github.com/elevenlabs/elevenlabs-docs/blob/e5e267c97b8d1e4c21db1dcdb8b005eb1dfed7da/api-reference/speech-to-speech.mdx?plain=1#L2) from [Elevenlabs](https://elevenlabs.io/docs/api-reference/speech-to-speech).&#x20;
68+
In these cases, you'll need to create MDX files for your API endpoints. Here's [an example from Elevenlabs](https://github.com/elevenlabs/elevenlabs-docs/blob/e5e267c97b8d1e4c21db1dcdb8b005eb1dfed7da/api-reference/speech-to-speech.mdx?plain=1#L2).
6669

6770
![](/images/elevenlabs-mdx-autogeneration-example.png)
6871

69-
### Autogenerate files
72+
### Create MDX Files Automatically
7073

71-
For large OpenAPI documents, creating one MDX page for each OpenAPI operation can be a lot of work. To make it easier, we created a local OpenAPI page scraper.
72-
73-
Our Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping)
74-
autogenerates MDX files for your OpenAPI endpoints. Use the relative path to the
75-
OpenAPI document in your codebase.
74+
If you have many API endpoints, creating MDX files by hand can take a long time. Our Mintlify [scraper tool](https://www.npmjs.com/package/@mintlify/scraping) can create these files for you:
7675

7776
```bash
7877
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file>
7978
```
8079

81-
Add the `-o` flag to specify a folder to populate the files into. If a folder is
82-
not specified, the files will populate in the working directory.
80+
Want to save the files in a specific folder? Use the `-o` option:
8381

8482
```bash
8583
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file> -o api-reference
8684
```
8785

88-
Learn more about our scraping package [here](https://www.npmjs.com/package/@mintlify/scraping).
89-
90-
The scraper will output an array of
91-
[Navigation entries](/settings/global#structure) containing your OpenAPI MDX
92-
files. You can either append these entries to your existing Navigation, or
93-
reorder and add the files to your navigation manually.
94-
9586
<Note>
96-
If your OpenAPI document is invalid, the files will not autogenerate.
87+
Your OpenAPI file must be valid for this to work.
9788
</Note>
9889

99-
### Manually specify files
90+
### Create MDX Files by Hand
10091

101-
You can always create an MDX page manually, and reference the OpenAPI operation in the page's metadata using the `openapi` field.
92+
You can also create MDX pages manually. Just add an `openapi` field in the page's settings to link it to your API endpoint.
10293

10394
<Snippet file="api-playground/openapi.mdx" />
10495

105-
By using the OpenAPI reference, the name, description, parameters, responses,
106-
and the API playground will be automatically generated from the OpenAPI document.
96+
This will automatically add the endpoint's details and an interactive API playground to your page.
10797

108-
If you have multiple OpenAPI files, include the path to the OpenAPI file to ensure Mintlify finds the correct OpenAPI document. This is not required if you have
109-
only one OpenAPI file - it will automatically detect your OpenAPI file.
98+
If you have multiple OpenAPI files, include the file path to help Mintlify find the right one:
11099

111100
<CodeGroup>
112101
```md Example
@@ -118,7 +107,7 @@ only one OpenAPI file - it will automatically detect your OpenAPI file.
118107

119108
```md Format
120109
---
121-
title: "title of the page"
110+
title: "page title"
122111
openapi: openapi-file-path method path
123112
---
124113
```
@@ -127,15 +116,12 @@ only one OpenAPI file - it will automatically detect your OpenAPI file.
127116
<br />
128117

129118
<Note>
130-
The method and path must match the method and path specified in the OpenAPI
131-
document exactly. If the endpoint doesn't exist in the OpenAPI file,
132-
the page will be empty.
119+
Make sure the method and path match exactly what's in your OpenAPI file.
133120
</Note>
134121

135-
## Create MDX files for OpenAPI schemas
122+
## Pages for API Data Types
136123

137-
Mintlify also allows you to create individual pages for any OpenAPI schema
138-
defined in an OpenAPI document's `components.schemas` field:
124+
You can also create pages that explain the data types (schemas) defined in your OpenAPI file:
139125

140126
<CodeGroup>
141127
```md Example
@@ -146,7 +132,7 @@ defined in an OpenAPI document's `components.schemas` field:
146132

147133
```md Format
148134
---
149-
openapi-schema: "schema-key"
135+
openapi-schema: "schema-name"
150136
---
151137
```
152138
</CodeGroup>

0 commit comments

Comments
 (0)