# What is the agent?
Source: https://mintlify-docs.mintlify.app/agent/index
Automate documentation updates with the agent. Create updates from Slack messages, PRs, or API calls.
The agent is available on [Enterprise plans](https://mintlify.com/pricing?ref=agent) for anyone with access to your dashboard.
The agent is an AI tool that creates pull requests with proposed changes to your documentation based on your prompts. When you send a request, the agent:
* **Researches**: Reads your existing documentation, any connected repositories, and relevant context.
* **Plans**: Creates a structured task list for complex documentation work.
* **Writes**: Generates or updates content following writing standards and best practices.
* **Validates**: Runs Mintlify CLI checks to ensure documentation builds correctly.
* **Creates a PR**: Opens a pull request with proposed changes for review.
All changes go through pull requests. The agent never commits directly to your main branch.
## What you can do with the agent
Use the agent to:
* Write new content based on your prompts, pull requests, Slack threads, or file attachments.
* Update existing documentation for new features or API changes.
* Process and include images, diagrams, and other files from Slack attachments.
* Search and revise code examples and API references across your docs.
* Automate documentation maintenance with workflows.
* Answer questions about your docs and technical writing topics.
* Address code review feedback to maintain documentation quality.
* Capture knowledge from Slack conversations and pull requests before it gets lost.
* Navigate and coordinate changes across multiple files and directories efficiently.
## Where you can use the agent
From any page in your dashboard, use the keyboard shortcut ⌘+I (macOS) or Ctrl+I (Windows/Linux) to open the agent panel. Or click **Ask agent** on the [Overview](https://dashboard.mintlify.com/) page.
Add the agent to your Slack workspace and mention `@mintlify` in any channel. You can attach files and images directly to your messages for the agent to process.
Embed the agent in custom applications using the [agent endpoints](/api/agent/create-agent-job).
## Connect your GitHub account
By default, the agent opens pull requests attributed to the Mintlify bot. To attribute pull requests to you, connect your GitHub account on the [My profile](https://dashboard.mintlify.com/settings/account) page of the dashboard.
## Connect repositories as context
The agent can only access repositories that you connect through the Mintlify GitHub App. Configure which repositories the agent can access in the agent panel **Settings** or in the [GitHub App settings](https://github.com/apps/mintlify/installations/new).
## Next steps
Add the agent to your Slack workspace.
Configure the agent with an `AGENTS.md` file.
Get better results with focused prompts.
Automate recurring tasks and documentation maintenance with workflows.
# Add the agent to Slack
Source: https://mintlify-docs.mintlify.app/agent/slack
Use the agent in Slack to make documentation updates from conversations and capture team knowledge.
If your Slack Workspace Owner requires admin approval to install apps, ask them to approve the Mintlify app before you connect it.
## Connect your Slack workspace
Open the agent panel in your dashboard.
In the Slack integration section, click **Connect**.
Follow the Slack prompts to add the `mintlify` app to your workspace.
Follow the Slack prompts to link your Mintlify account to your Slack workspace.
Test that the agent is working and responds when you:
* Send a direct message to it.
* Mention it with `@mintlify` in a channel.
## Use the agent in Slack
Once connected, you can:
* Send direct messages to the agent to use it privately to update your documentation.
* Mention `@mintlify` in a channel to use it publicly and collaboratively.
* Attach files and images directly to your messages for the agent to process and include in your docs.
* Continue conversations in threads to iterate on changes.
* Share pull request links with the agent to update related documentation.
## Update documentation
Use the agent to update your documentation with a new request or in an existing thread.
* **New request**: Send a direct message to the agent or mention `@mintlify` in a channel with instructions on what to update.
* **Existing thread**: Reply in the thread and mention `@mintlify` with instructions on what to update.
* **With attachments**: Upload images, diagrams, code files, or other documents with your message. The agent automatically processes and includes them in your documentation.
The agent reads the context of the request or thread and creates a pull request in your connected repository with the updates.
## Best practices
* **Be specific**: Tell the agent exactly what you want documented and where it should go.
* **Add context**: If a thread doesn't contain all the necessary information, include additional details in your message to the agent.
* **Review carefully**: You should always review pull requests that the agent creates before merging them.
# Workflows
Source: https://mintlify-docs.mintlify.app/agent/workflows
Automate documentation maintenance with scheduled or event-triggered agent tasks.
Workflows are in beta. They are currently available on [Enterprise plans](https://mintlify.com/pricing).
[Contact us](mailto:gtm@mintlify.com) to enable workflows for your organization.
Workflows run the agent automatically on a schedule or on a push to a repository. Each workflow defines a prompt for the agent and a trigger for when to run it.
When a workflow runs, the agent clones any specified repositories as context, follows the prompt, and either opens a pull request or pushes changes directly to your deployment branch.
You can have up to 10 active workflows. Each workflow can run up to 20 times a day. Runs that fail do not count toward this limit.
Use workflows that run on a schedule to automate recurring tasks like publishing changelogs or checking for grammar and style issues.
Use workflows that run on push events to automate reactive maintenance tasks like updating API references or identifying documentation updates needed for new features.
## Create a workflow
### Create a workflow in the dashboard
On the [Workflows](https://dashboard.mintlify.com/products/workflows) page of your dashboard, click the **New workflow** button.
### Add a workflow file to your repository
Create a `.md` file for each workflow in a `.mintlify/workflows/` directory at the root of your documentation repository. Each file defines one workflow.
Workflow files use YAML frontmatter to configure the workflow, followed by a Markdown prompt for the agent.
```markdown .mintlify/workflows/update-changelog.md theme={null}
---
name: Update changelog
on:
cron: "0 9 * * 1"
context:
- repo: your-org/your-product
automerge: false
---
Review all changes since the last changelog update. Draft a new changelog post with any new features, bug fixes, or breaking changes.
Include information about what a change is and how it affects users.
Do not include any internal-only information or minor changes like bumping package versions or updating documentation.
Success criteria: Someone who reads the changelog knows the most up to date information about the product including what changed and whether or not it affects them.
```
## Frontmatter fields
| Field | Required | Description |
| ----------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `name` | Yes | Display name shown in the dashboard. |
| `on` | Yes | Trigger configuration. |
| `context` | No | Repositories cloned as reference when the workflow runs. |
| `automerge` | No | Defaults to `false`, which opens a pull request. If `true`, pushes changes directly to your deployment branch. |
You must have the Mintlify GitHub App installed on every repository listed in the `context` or `on.push.repo` fields. Add new repositories on the [GitHub app](https://dashboard.mintlify.com/settings/organization/github-app) page of your Mintlify dashboard.
### Triggers
Each workflow must define exactly one trigger using the `on` field.
#### On schedule (cron)
Run a workflow on a recurring schedule using a cron expression. All schedules run in UTC.
Workflows queue within 10 minutes of the scheduled time and may take up to 10 minutes to run.
```yaml theme={null}
on:
cron: "0 9 * * 1"
```
The value is a standard 5-field cron expression in `minute hour day-of-month month day-of-week` format. Use a tool like [crontab.guru](https://crontab.guru) to build and validate schedules.
| Expression | Schedule |
| --------------- | --------------------------------------- |
| `"0 9 * * 1"` | Every Monday at 9:00 AM UTC |
| `"0 0 1 * *"` | First day of each month at midnight UTC |
| `"0 8 * * 1-5"` | Weekdays at 8:00 AM UTC |
#### On push events
Run a workflow when changes push to a specific repository or branch. This includes both pull request merges and direct pushes to the branch.
```yaml theme={null}
on:
push:
- repo: your-org/your-product
branch: main
```
* `repo`: The GitHub repository in `owner/repo` format.
* `branch` (optional): The branch to watch for pushes. If you don't specify a branch, the workflow triggers on pushes to the repository's default branch.
A workflow can watch for pushes to multiple repositories or branches.
```yaml theme={null}
on:
push:
- repo: your-org/your-product
- repo: your-org/another-repo
branch: release
```
### Context repositories
Use `context` to give the agent read access to additional repositories when the workflow runs. This is useful when your prompt requires reviewing code or content outside your documentation repository.
```yaml theme={null}
context:
- repo: your-org/your-product
- repo: your-org/design-system
```
### Auto-merge changes
By default, the agent opens a pull request for each workflow run so you can review changes before they go live. Set `automerge: true` to push changes directly to your deployment branch without a pull request.
```yaml theme={null}
automerge: true
```
## Prompts
Effective prompts focus on one task and have a specific outcome in mind. Workflows always have some variance because of the nondeterministic nature of agents, but you can improve the consistency of workflow outputs by following these best practices.
* Describe the outcome you want the agent to achieve.
* Include success criteria.
* Specify the context you want the agent to use.
* Split complex tasks into steps or multiple workflows.
## Example workflows
### Draft documentation for new features
If you use agent suggestions in your dashboard, this workflow replicates that behavior.
Add this workflow with any modifications for your project to automatically draft documentation as you add new features to your product.
Runs when changes are pushed to your product repository to identify documentation updates needed for any new features or APIs introduced.
```markdown .mintlify/workflows/draft-feature-docs.md theme={null}
---
name: Draft docs for new features
on:
push:
- repo: your-org/your-product
branch: main
context:
- repo: your-org/your-docs
automerge: false
---
Review the diff from the last merged PR in `your-org/your-product`. Identify any new features, APIs, or other changes that require documentation.
For each new addition, draft documentation updates that explain what it does, when to use it, and how to configure it. Include a code example where relevant.
Success criteria: After reading any new or updated documentation, users understand what the feature is, if it applies to tasks they do, and how to use it.
## Important
- Only document changes that affect end users. Skip internal refactors or dependency updates.
- Match the style and structure of existing docs pages.
```
### Style audit
Runs when changes push to your documentation repository to catch style guide violations before they accumulate. This example workflow automatically fixes style guide violations and lists any violations that require human judgment in the PR body.
```markdown .mintlify/workflows/style-audit.md theme={null}
---
name: Style audit
on:
push:
- repo: your-org/your-docs
branch: main
automerge: false
---
Review all MDX files changed in the last merged PR against the style guide at `path/to/style-guide`.
Open a pull request to resolve any style violations that can be fixed automatically. For any edits that require judgment or nuance, note them in the PR body with the specific lines, rule violations, and suggested fixes.
Success criteria:
- All style violations have a proposed resolution.
- No new style violations are introduced.
## Important
- Do not change content meaning. Only correct style violations.
- Skip any files in language subdirectories (`es/`, `fr/`, `zh/`).
```
### Update API reference
Runs when pull requests merge to your product repository to keep API reference pages in sync with your product code. When endpoints or parameters change, this workflow updates the corresponding content in your documentation.
```markdown .mintlify/workflows/update-api-reference.md theme={null}
---
name: Update API reference
on:
push:
- repo: your-org/your-product
branch: main
context:
- repo: your-org/your-docs
automerge: false
---
Review the diff from the last merged PR in `your-org/your-product` for changes to API endpoints, parameters, response shapes, or error codes.
Update the corresponding API specifications or pages in the docs to reflect the changes. Include updated parameter descriptions, type information, and examples where affected.
Success criteria: All API specifications and pages are up to date with the changes in the product repository.
## Important
- If a parameter or endpoint was removed, mark it as deprecated rather than deleting it unless the code explicitly removes it with no deprecation period.
- If no API changes were introduced, do nothing.
```
### Track translation lag
Run weekly to compare English source files against their translations and identify pages that have fallen behind.
To use this workflow, update the example language subdirectories (`es/`, `fr/`, `zh/`) to your actual language subdirectories.
```markdown .mintlify/workflows/translation-lag.md theme={null}
---
name: Track translation lag
on:
cron: "0 9 * * 3"
---
Compare the English MDX files in the repo against their counterparts in the `es/`, `fr/`, and `zh/` subdirectories. Use git history to identify English files updated more recently than their translations.
Open a pull request that lists pages that are out of sync, organized by language. For each page, include the date of the last English update and a brief summary of what changed so translators have context on what to update.
Success criteria: Any discrepancies between the English and translated files are identified and listed in the pull request.
## Important
- If a translated file does not exist, flag it as missing rather than out of sync.
- Group findings by language, then by how far out of date they are (most stale first).
```
### SEO and metadata audit
Runs weekly to check for pages with missing or weak metadata and open a pull request with improvements. This example workflow checks for missing `description` frontmatter. Edit the workflow to check for other metadata or content issues that you prioritize for your documentation.
```markdown .mintlify/workflows/seo-audit.md theme={null}
---
name: SEO and metadata audit
on:
cron: "0 9 * * 1"
automerge: false
---
Audit all MDX files in the docs for SEO and metadata quality. Check for:
- Missing or empty `description` frontmatter
- Descriptions that are too short (under 50 characters) or too long (over 160 characters)
Open a pull request with improvements for any issues found. Write descriptions that accurately summarize the page content in plain language.
Success criteria: All pages have up to date descriptions that accurately summarize the page content in plain language.
## Important
- Only update frontmatter. Do not change page content.
- If all pages have complete and reasonable metadata, do nothing.
```
# AI-native documentation
Source: https://mintlify-docs.mintlify.app/ai-native
Learn how AI enhances reading, writing, and discovering your documentation
When you host your documentation on Mintlify, built-in AI features help your users find answers and your team maintain content more efficiently. Your content provides the context for these AI-native features to improve the experiences of reading, writing, and discovering your documentation.
## What makes your documentation AI-native
### Reading
In addition to reading individual pages, users can chat with the [assistant](/ai/assistant) in your documentation for immediate answers to their questions and links to relevant content. The assistant helps guide users through your product with accurate information from your documentation. Embed the assistant into custom apps with the [API](/api/assistant/create-assistant-message) to extend where users can access your documentation.
### Writing
The [agent](/agent) helps you write and maintain documentation. It creates pull requests with proposed changes based on your prompts, pull requests, and Slack threads. Add the agent to your Slack workspace so that anyone on your team can help maintain your documentation by chatting with the agent. Or embed the agent into custom apps via the [API](/api/agent/create-agent-job).
Create [workflows](/agent/workflows) to run the agent on a schedule or on a push to a repository. Each workflow defines a prompt for the agent and a trigger for when to run it.
Configure popular tools like [Cursor](/guides/cursor), [Claude Code](/guides/claude-code), and [Windsurf](/guides/windsurf) to reference the Mintlify schema, your style guide, and best practices.
### Discovering
Your site is automatically optimized for AI tools and search engines to help users discover your documentation. All pages send their content as Markdown to AI agents instead of HTML, which helps these tools process your content faster and use fewer tokens. Every page is also available to view as Markdown by appending `.md` to the URL.
Mintlify hosts `llms.txt` and `skill.md` files for your documentation. These industry-standard files help LLMs respond efficiently with relevant information to user queries and provide a list of capabilities for agents to use, so that users are more successful with your product.
Your documentation site also hosts an MCP server that lets users connect your documentation directly to their AI tools for up to date information about your product directly where they want it.
Full-text search and semantic understanding help users and AI tools find relevant information quickly. Search understands user intent rather than just matching keywords. And if a user encounters a 404 error, your site suggests related pages to help them find what they're looking for. No configuration required.
## Enable AI features
Select any of the following cards for more information.
Configure the assistant to search external sites or direct people to your support team if it can't answer their questions.
Get documentation updates automatically on a schedule or when a push event occurs.
Add a menu to pages that lets users query AI tools, connect to your MCP server, and copy pages as context with one click.
# Assistant
Source: https://mintlify-docs.mintlify.app/ai/assistant
Add AI-powered chat to your docs that answers questions, cites sources, and generates code examples.
The assistant is automatically enabled on [Pro and Enterprise plans](https://mintlify.com/pricing?ref=assistant).
## About the assistant
The assistant answers questions about your documentation through natural language queries. Users access the assistant on your documentation site, so they can find answers quickly and succeed with your product even if they don't know where to look.
The assistant uses agentic RAG (retrieval-augmented generation) with tool calling. When users ask questions, the assistant:
* **Searches and retrieves** relevant content from your documentation to provide accurate answers.
* **Cites sources** and provides navigable links to take users directly to referenced pages.
* **Generates copyable code examples** to help users implement solutions from your documentation.
You can view assistant usage through your dashboard to understand user behavior and documentation effectiveness. Export and analyze query data to help identify:
* Frequently asked questions that might need better coverage.
* Content gaps where users struggle to find answers.
* Popular topics that could benefit from additional content.
### How indexing works
The assistant automatically indexes your published documentation to answer questions accurately. When you publish changes, the assistant immediately indexes new, updated, or deleted content. The assistant does not index draft branches or preview deployments.
By default, the assistant does not index hidden pages. To include hidden pages in the assistant's index, set `seo.indexing: "all"` in your `docs.json`. See [Hidden pages](/organize/hidden-pages#search-seo-and-ai-indexing) for more information.
### How the assistant handles unknown questions
The assistant only answers questions based on information in your documentation. If it cannot find relevant information after searching, it responds that it doesn't have enough information to answer.
You can [set a deflection email](/ai/assistant#set-deflection-email) so that the assistant provides your support email to users whose questions it cannot answer. This gives users a path forward, even if the documentation doesn't address their specific question.
## Configure the assistant
The assistant is active on Pro and Enterprise plans by default.
Manage the assistant from the [Assistant Configurations](https://dashboard.mintlify.com/products/assistant/settings) page of your dashboard. Enable or disable the assistant, configure response handling, add default questions, and manage your message allowance.
### Enable or disable the assistant
Toggle the assistant status to enable or disable the assistant for your documentation site.
### Set deflection email
In the Response Handling section, enable the assistant to redirect unanswered questions to your support team.
Specify an email address for the assistant to give to users if it cannot answer their question. You can also enable a "Contact support" button to appear in the assistant chat panel.
### Search domains
In the Response Handling section, configure domains that the assistant can use for web search to find additional context when answering questions.
* Domains must be publicly available.
* Domains that require JavaScript to load are not supported.
For more precise control over what the assistant can search, use filtering syntax.
* **Domain-level filtering**
* `example.com`: Search only the `example.com` domain
* `docs.example.com`: Search only the `docs.example.com` subdomain
* `*.example.com`: Search all subdomains of `example.com`
* **Path-level filtering**
* `docs.example.com/api`: Search all pages under the `/api` subpath
* **Multiple patterns**
* Add multiple entries to target different sections of sites
### Add sample questions
Help your users begin conversations with the assistant by adding starter questions. Add commonly asked questions or questions about topics that you want your users to know about. You can add up to 5 starter questions. Click **Ask AI** for recommended questions based on your documentation.
## Customize assistant behavior
Add an `Assistant.md` (or `ASSISTANT.md`) file to your project to give the assistant custom instructions that shape how it responds. The assistant uses these instructions as system-level context for every response.
Create the file at `.mintlify/Assistant.md` (or `.mintlify/ASSISTANT.md`) in your project root.
Instructions in an `Assistant.md` file add to the assistant's system prompt. They do not replace or override the assistant's default instructions.
To remove the custom instructions, remove the `Assistant.md` file.
Use `Assistant.md` to:
* Adjust the assistant's persona and tone
* Provide product-specific context
* Define support escalation paths
* Specify terminology preferences
* Restrict or scope the assistant's focus areas
* Provide version-specific guidance
```markdown Example Assistant.md theme={null}
You are a helpful assistant for Acme Corp's developer platform.
## Tone
- Be concise and direct. Getting to the point helps people more than being exhaustive.
- Use technical language appropriate for software developers. Most people asking you questions are familiar with Acme's products.
## Product context
- Acme SDK v3 is the current stable release. v2 is deprecated. If people ask about v2, remind them it's deprecated but answer their questions.
- Direct billing questions to support@acme.com.
## Terminology
- Use "workspace" instead of "project" or "organization".
- Use "access token" instead of "API key".
```
## Manage billing
The assistant uses tiered message allowances. A message is any user interaction with the assistant that receives a correct response. If you have unused messages, up to half of your message allowance can carry over to the next billing cycle. For example, if you have a 1,000 message allowance and you use 300 messages, 500 messages carry over to the next billing cycle giving you a total of 1,500 messages for the next billing cycle.
By default, the assistant allows overages. You can disable overages to avoid incurring additional costs for usage beyond your tier. If you reach your message allowance with overages disabled, the assistant is unavailable until your message allowance resets. If you allow overages, each message beyond your allowance incurs an overage charge, but occasional overages may be cheaper than upgrading to a higher tier depending on your usage.
### Change your assistant tier
Assistant tiers determine your monthly message allowance and pricing.
View and change your current tier on the [Billing tab](https://dashboard.mintlify.com/products/assistant/settings/billing) of the assistant page in your dashboard.
In the **Spending Controls** section, select your preferred tier from the dropdown menu.
**Upgrade your tier:**
* Your new message allowance is available immediately.
* You pay a prorated difference for the current billing cycle.
**Downgrade your tier:**
* Your message allowance updates immediately.
* Pricing changes take effect at the start of your next billing cycle.
* Unused messages from your current tier **do not** carry over.
### Allow overages
If you want to disallow overages, disable them in the **Billing Controls** section of the [Billing tab](https://dashboard.mintlify.com/products/assistant/settings/billing) of the assistant page in your dashboard.
### Set usage alerts
In the Billing Controls section, set usage alerts to receive an email when you reach a certain percentage of your message allowance.
## Connect apps
In the connect apps section, add the assistant to your [Discord](/ai/discord) server and [Slack](/ai/slack-bot) workspace to allow users to get answers from your documentation on those platforms.
## Assistant insights
Use assistant insights to understand how users interact with your documentation and identify improvement opportunities.
The [assistant page](https://dashboard.mintlify.com/products/assistant) shows usage trends for the month to date. View more detailed insights on the [analytics](/optimize/analytics#assistant) page.
## Make content AI ingestible
Structure your documentation to help the assistant provide accurate, relevant answers. Clear organization and comprehensive context benefit both human readers and AI understanding.
* Use semantic markup.
* Write descriptive headings for sections.
* Create a logical information hierarchy.
* Use consistent formatting across your docs.
* Include comprehensive metadata in page frontmatter.
* Break up long blocks of text into shorter paragraphs.
* Define specific terms and acronyms when first introduced.
* Provide sufficient conceptual content about features and procedures.
* Include examples and use cases.
* Cross-reference related topics.
* Add [hidden pages](/organize/hidden-pages) with additional context that users don't need, but the assistant can reference.
## Use the assistant
Users have multiple ways to start a conversation with the assistant. Each method opens a chat panel on the right side of your docs. Users can ask any question and the assistant searches your documentation for an answer. If the assistant cannot retrieve relevant information, the assistant responds that it cannot answer the question.
Add the assistant as a bot to your [Slack workspace](/ai/slack-bot) or [Discord server](/ai/discord) so that your community can ask questions without leaving their preferred platform.
### UI placement
The assistant appears in two locations: as a button next to the search bar and as a bar at the bottom of the page.
### Keyboard shortcut
Open the assistant chat panel with the keyboard shortcut Command + I on macOS and Ctrl + I on Windows.
### Highlight text
Highlight text on a page and click the **Add to assistant** pop up button to open the assistant chat panel and add the highlighted text as context. You can add multiple text snippets or code blocks to the assistant's context.
### Code blocks
Click the **Ask AI** button in a code block to open the assistant chat panel and add the code block as context. You can add multiple code blocks or text snippets to the assistant's context.
### URLs
Open the assistant with a URL query parameter to create deep links that guide users to specific information or share assistant conversations with pre-filled questions.
* **Open the assistant**: Append `?assistant=open` to open the assistant chat panel when the page loads.
* Example: [https://mintlify.com/docs?assistant=open](https://mintlify.com/docs?assistant=open)
* **Open with a pre-filled query**: Append `?assistant=YOUR_QUERY` to open the assistant and automatically submit a question.
* Example: [https://mintlify.com/docs?assistant=explain webhooks](https://mintlify.com/docs?assistant=explain%20webhooks)
## Troubleshooting
If the assistant UI is not visible in specific browsers, you may need to submit a false positive report to [EasyList](https://easylist.to). Browsers that use the EasyList Cookies List like Brave and Comet sometimes block the assistant or other UI elements. The EasyList Cookies List includes a domain-specific rule that hides fixed elements on certain domains to block cookie banners. This rule inadvertently affects legitimate UI components.
Submit a false positive report to [EasyList](https://github.com/easylist/easylist) to request removal of the rule. This resolves the issue for all users once the filter list updates.
# Discord bot
Source: https://mintlify-docs.mintlify.app/ai/discord
Add a bot to your Discord server that answers questions based on your documentation.
Discord integrations are available on [Pro and Enterprise plans](https://mintlify.com/pricing?ref=discord) with access to the assistant.
The Discord bot supports your community with real-time answers from your documentation. The bot uses the Mintlify assistant to search your docs and provide accurate, cited responses, so it is always up-to-date.
The Discord bot only works in public channels. It replies to `@` mentions or to all messages in a specific channel.
Each message sent by the Discord bot counts toward your assistant message usage.
## Add the Discord bot to your server
You must have the "Manage Server" permission in Discord to add the bot.
Go to the [Assistant](https://dashboard.mintlify.com/products/assistant) page in your dashboard.
In the Discord card, click **Configure**. This opens Discord.
In Discord, select the server you want to add the bot to and authorize the bot to access your server.
Mention the bot to add it to a channel. The bot's default name is `@Mintlify Bot`.
## Create an `#ask-ai` channel
To help your community quickly get answers to their questions, the bot can reply to every message in a channel that you choose. By default, the bot replies to every message in channels named `#ask-ai`. Create an `#ask-ai` channel and let your community know that the bot replies to messages in that channel.
If you want the bot to reply to messages in a different channel, select a channel in the Discord bot [configuration menu](https://dashboard.mintlify.com/products/assistant/settings/integrations).
See [Starting Your First Discord Server](https://discord.com/blog/starting-your-first-discord-server) on the Discord blog for more information on creating a channel.
## Manage the Discord bot
After you add the Discord bot to your server, you can manage or remove the bot from the [Integrations](https://dashboard.mintlify.com/products/assistant/settings/integrations) tab in your dashboard.
In the Discord bot configuration menu, customize the bot by changing its avatar or name, and choose which channel it automatically replies to all messages in.
# llms.txt
Source: https://mintlify-docs.mintlify.app/ai/llmstxt
Optimize your docs for LLMs to read and index.
The [llms.txt file](https://llmstxt.org) is an industry standard that helps LLMs index content more efficiently, similar to how a sitemap helps search engines. AI tools can use this file to understand your documentation structure and find content relevant to user queries.
Mintlify automatically hosts an `llms.txt` file at the root of your project that lists all available pages in your documentation. This file is always up to date and requires zero maintenance. You can optionally add a custom `llms.txt` file to the root of your project.
If your site requires authentication to access your documentation, your `llms.txt` and `llms-full.txt` files are not available to LLMs and AI tools. LLMs and AI tools can only index publicly available content.
View your `llms.txt` by appending `/llms.txt` to your documentation site's URL.
## llms.txt structure
An `llms.txt` file is a plain Markdown file that contains:
* **Site title** as an H1 heading.
* **Structured content sections** with links and a description of each page in your documentation.
* **API specification links** to your OpenAPI and AsyncAPI specs, if your documentation includes them.
The `llms.txt` file lists your pages alphabetically in the order they appear in your repository, starting from the root directory.
Each page's description comes from the `description` field in its frontmatter. For API reference pages, the description also includes the specification information from the `openapi` or `api` frontmatter field. Pages without a `description` field appear in the `llms.txt` file without a description.
```mdx Example llms.txt theme={null}
# Site title
## Docs
- [API](https://example.com/docs/api): Endpoint list and usage
- [Install](https://example.com/docs/install): Setup steps
- [Getting started](https://example.com/docs/start): Intro guide
## API specifications
- [openapi](https://example.com/docs/openapi.json)
- [asyncapi](https://example.com/docs/asyncapi.yaml)
```
This structured approach allows LLMs to efficiently process your documentation at a high level and locate relevant content for user queries, improving the accuracy and speed of AI-assisted documentation searches.
## llms-full.txt
The `llms-full.txt` file combines your entire documentation site into a single file as context for AI tools and LLM indexing.
Mintlify automatically hosts an `llms-full.txt` file at the root of your project. View your `llms-full.txt` by appending `/llms-full.txt` to your documentation site's URL.
## Custom files
To add a custom `llms.txt` or `llms-full.txt` file, create an `llms.txt` or `llms-full.txt` file at the root of your project. Adding a custom file overrides the automatically generated file of the same name. If you delete a custom file, Mintlify restores the automatically generated file.
Your custom `llms.txt` or `llms-full.txt` file must have a site title as an H1 heading. Other content is optional. See [Format](https://llmstxt.org/#format) in the `llms.txt` specification for more information on optional sections and best practices.
# Model Context Protocol
Source: https://mintlify-docs.mintlify.app/ai/model-context-protocol
Connect your documentation and API endpoints to AI tools with a hosted MCP server.
## About MCP servers
The Model Context Protocol (MCP) is an open protocol that creates standardized connections between AI applications and external services, like documentation. Mintlify generates an MCP server from your documentation, preparing your content for the broader AI ecosystem where any MCP client like Claude, Cursor, Goose, ChatGPT, and others can connect to your documentation.
Your MCP server exposes a search tool for AI applications to query your documentation. Your users must connect your MCP server to their tools.
### How MCP servers work
When an AI application connects to your documentation MCP server, it can search your documentation directly instead of making a generic web search in response to a user's prompt. Your MCP server provides access to all indexed content on your documentation site.
* The AI application can proactively search your documentation while generating a response, not just when explicitly asked.
* The AI application determines when to use the search tool based on the context of the conversation and the relevance of your documentation.
* Each search (tool call) happens during the generation process, so the AI application searches up-to-date information from your documentation to generate its response.
Some AI tools like Claude support both MCP and Skills. MCP gives the AI access to your documentation content, while Skills instruct the AI how to use that content effectively. They're complementary. MCP provides the data and Skills provide the instructions.
### Search filtering parameters
The MCP search tool supports optional filtering parameters that AI applications can use to narrow search results.
* **`version`**: Filter results to a specific documentation version. For example, `'v0.7'`. Only returns content tagged with the specified version or content available across all versions.
* **`language`**: Filter results to a specific language code. For example, `'en'`, `'zh'`, or `'es'`. Only returns content in the specified language or content available across all languages.
AI applications determine when to apply these filters based on the context of the user's query. For example, if a user asks about a specific API version, the AI application may automatically apply the appropriate filter to provide more relevant results.
### MCP compared to web search
AI tools can search the web, but MCP provides distinct advantages for documentation.
* **Direct source access**: Web search depends on what search engines have indexed, which may be stale or incomplete. MCP searches your current indexed documentation directly.
* **Integrated workflow**: MCP allows the AI to search during response generation rather than performing a separate web search.
* **No search noise**: SEO and ranking algorithms influence web search results. MCP goes straight to your documentation content.
## Access your MCP server
MCP servers are available for public documentation and documentation using [partial authentication](/deploy/authentication-setup#make-pages-public). Your MCP server only searches public pages. Documentation that requires authentication for all pages cannot generate an MCP server.
Mintlify automatically generates an MCP server for your documentation and hosts it at your documentation URL with the `/mcp` path. For example, Mintlify's MCP server is available at `https://mintlify.com/docs/mcp`.
View and copy your MCP server URL on the [MCP server page](https://dashboard.mintlify.com/products/mcp) in your dashboard.
Hosted MCP servers use the `/mcp` path in their URLs. Other navigation elements cannot use the `/mcp` path.
### Rate limits
To protect availability, Mintlify applies rate limits to MCP servers.
| Scope | Limit | Description |
| :------------------------------ | :---------------------- | :----------------------------------------------------------------- |
| Per user (IP address) | 200 requests per hour | Limits how frequently a single user can search your documentation. |
| Per documentation site (domain) | 1,000 requests per hour | Limits total searches across all users of your MCP server. |
## Content filtering and indexing
Your MCP server searches content that Mintlify indexes from your documentation repository. File processing and search indexing control what content is available through your MCP server.
### File processing with `.mintignore`
If files match [.mintignore](/organize/mintignore) patterns, Mintlify does not process or index them. These files are not available through your MCP server.
### Search indexing with `docs.json`
By default, Mintlify only indexes pages included in your `docs.json` navigation for search through your MCP server.
Mintlify excludes [hidden pages](/organize/hidden-pages) (pages not in your navigation) from the search index unless you choose to index all pages. To include hidden pages in your MCP server's search results, add the `seo.indexing` property to your `docs.json`.
```json theme={null}
"seo": {
"indexing": "all"
}
```
To exclude a specific page from search indexing, add `noindex: true` to its frontmatter.
```mdx theme={null}
---
title: "Hidden page"
description: "This page is not in the navigation and is not available through search."
noindex: true
---
```
## Use your MCP server
Your users must connect your MCP server to their preferred AI tools.
Publish your MCP server URL for users to access.
Users copy your MCP server URL and add it to their AI tools.
Once connected, users can search your documentation directly from their AI tools.
These are some of the ways you can help your users connect to your MCP server:
Add options in the [contextual menu](/ai/contextual-menu) for your users to connect to your MCP server from any page of your documentation.
| Option | Identifier | Description |
| :--------------------------- | :--------- | :---------------------------------------------------------- |
| **Copy MCP server URL** | `mcp` | Copies your MCP server URL to the user's clipboard. |
| **Copy MCP install command** | `add-mcp` | Copies the `npx add-mcp` command to install the MCP server. |
| **Connect to Cursor** | `cursor` | Installs your MCP server in Cursor. |
| **Connect to VS Code** | `vscode` | Installs your MCP server in VS Code. |
Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
Create a guide for your users that includes your MCP server URL and the steps to connect it to Claude.
1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.
2. Select **Add custom connector**.
3. Add your MCP server name and URL.
4. Select **Add**.
5. When using Claude, select the attachments button (the plus icon).
6. Select your MCP server.
See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.
Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
Create a guide for your users that includes your MCP server URL and the command to connect it to Claude Code.
```bash theme={null}
claude mcp add --transport http
```
See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.
Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
Create a guide for your users that includes your MCP server URL and the steps to connect it to Cursor.
1. Use Command + Shift + P (Ctrl + Shift + P on Windows) to open the command palette.
2. Search for "Open MCP settings".
3. Select **Add custom MCP**. This opens the `mcp.json` file.
4. In `mcp.json`, configure your server:
```json theme={null}
{
"mcpServers": {
"": {
"url": ""
}
}
}
```
See the [Cursor documentation](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) for more details.
Navigate to your [dashboard](https://dashboard.mintlify.com/products/mcp) and find your MCP server URL.
Create a guide for your users that includes your MCP server URL and the steps to connect it to VS Code.
1. Create a `.vscode/mcp.json` file.
2. In `mcp.json`, configure your server:
```json theme={null}
{
"servers": {
"": {
"type": "http",
"url": ""
}
}
}
```
See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.
### Example: Connect to the Mintlify MCP server
Connect to the Mintlify MCP server to search this documentation site within your preferred AI tool. This gives you more accurate answers about how to use Mintlify in your local environment and demonstrates how you can help your users connect to your MCP server.
At the top of this page, select the contextual menu and choose **Connect to Cursor** or **Connect to VS Code** to connect the Mintlify MCP server to the IDE of your choice.
To use the Mintlify MCP server with Claude:
1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.
2. Select **Add custom connector**.
3. Add the Mintlify MCP server:
* Name: `Mintlify`
* URL: `https://mintlify.com/docs/mcp`
4. Select **Add**.
1. When using Claude, select the attachments button (the plus icon).
2. Select the Mintlify MCP server.
3. Ask Claude a question about Mintlify.
See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.
To use the Mintlify MCP server with Claude Code, run the following command:
```bash theme={null}
claude mcp add --transport http Mintlify https://mintlify.com/docs/mcp
```
Test the connection by running:
```bash theme={null}
claude mcp list
```
See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.
To connect the Mintlify MCP server to Cursor:
1. Use Command + Shift + P (Ctrl + Shift + P on Windows) to open the command palette.
2. Search for "Open MCP settings".
3. Select **Add custom MCP**. This opens the `mcp.json` file.
In `mcp.json`, add:
```json theme={null}
{
"mcpServers": {
"Mintlify": {
"url": "https://mintlify.com/docs/mcp"
}
}
}
```
In Cursor's chat, ask "What tools do you have available?" Cursor should show the Mintlify MCP server as an available tool.
See [Installing MCP servers](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) in the Cursor documentation for more details.
To connect the Mintlify MCP server to VS Code, create a `.vscode/mcp.json` file and add:
```json theme={null}
{
"servers": {
"Mintlify": {
"type": "http",
"url": "https://mintlify.com/docs/mcp"
}
}
}
```
See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.
### Using multiple MCP servers
Users can connect multiple MCP servers to their AI tools. Connected MCP servers do not consume context until the AI calls a search tool. The AI decides when to search based on query relevance, so it doesn't search every connected server for every question.
When the AI searches, each query returns multiple results that add to the conversation's context. If the AI searches several servers for a single question, this can use up significant context.
Best practices for using multiple MCP servers:
* Connect only the MCP servers relevant to your current work.
* Be specific in your prompts so the AI searches the most relevant server.
* Disconnect servers you're not actively using to reduce potential context usage.
# skill.md
Source: https://mintlify-docs.mintlify.app/ai/skillmd
Make your docs agent-ready with a structured capability file.
Mintlify hosts a `skill.md` file at the root of your project that describes what AI agents can do with your product.
The [skill.md specification](https://agentskills.io/specification) is a structured, machine-readable format that makes capabilities, required inputs, and constraints for products explicit so that agents can use them more reliably.
Mintlify automatically generates a `skill.md` file for your project by analyzing your documentation with an agentic loop. This file stays up to date as you make updates to your documentation and requires no maintenance. You can optionally add a custom `skill.md` file to the root of your project that overrides the automatically generated one.
View your `skill.md` by appending `/skill.md` to your documentation site's URL. Mintlify only generates `skill.md` files for documentation sites that are public.
Both `llms.txt` and `skill.md` files help agents work with your documentation, but they serve different purposes.
* `llms.txt` is a directory. It lists all your documentation pages with descriptions so agents know where to find information.
* `skill.md` is a capability summary. It tells agents what they can accomplish with your product, what inputs they need, and what constraints apply.
## Use `skill.md` files with agents
If you use a [reverse proxy](/deploy/reverse-proxy), configure it to forward `/skill.md` and `/.well-known/skills/*` paths (with caching disabled) to your Mintlify subdomain.
Agents can process your `skill.md` with the [skills CLI](https://www.npmjs.com/package/skills).
```bash theme={null}
npx skills add https://your-docs-domain.com
```
This adds your product's capabilities to the agent's context so it can take actions on behalf of users.
Teach your users how to use `skill.md` files with agents so that they have better results using your product with their AI tools.
## `skill.md` structure
Mintlify generates a `skill.md` file following the [agentskills.io specification](https://agentskills.io/specification). The generated file includes:
* **Metadata**: Project name, description, and version.
* **Capabilities**: What agents can accomplish with your product.
* **Skills**: Specific actions organized by category.
* **Workflows**: Step-by-step procedures for common tasks.
* **Integration**: Supported tools and services.
* **Context**: Background on your product's architecture.
## Custom `skill.md` files
Add a `skill.md` file to the root of your project to override the automatically generated file. If you delete a custom file, Mintlify generates a new `skill.md` file.
Write a custom file when you want precise control over how agents interact with your product. Follow the [agentskills.io specification](https://agentskills.io/specification) to ensure compatibility with agent tooling.
### Frontmatter fields
Custom `skill.md` files must start with YAML frontmatter.
| Field | Type | Description |
| --------------- | ------ | ----------------------------------------------------------------------------------- |
| `name` | string | The name of your skill. |
| `description` | string | A brief description of what your skill does. |
| `license` | string | The license for your skill (for example, `MIT` or `Apache-2.0`). |
| `compatibility` | string | Requirements or compatibility notes (for example, runtime dependencies). |
| `metadata` | object | Additional metadata as string key-value pairs (for example, `author` or `version`). |
| `allowed-tools` | string | Space-delimited list of pre-approved tools the skill may use (experimental). |
```md Example frontmatter theme={null}
---
name: mintlify
description: Build and maintain documentation sites with Mintlify. Use when creating docs pages, configuring navigation, adding components, or setting up API references.
license: MIT
compatibility: Requires Node.js for CLI. Works with any Git-based workflow.
metadata:
author: mintlify
version: "1.0"
---
```
# Slack bot
Source: https://mintlify-docs.mintlify.app/ai/slack-bot
Add a bot to your Slack workspace that answers questions based on your documentation.
The Slack app is available for [Pro and Custom plans](https://mintlify.com/pricing?ref=slack-app) with access to the assistant.
The Slack app adds a bot to your workspace that supports your community with real-time answers. The bot uses the Mintlify assistant to search your docs and provide accurate, cited responses, so it is always up-to-date.
The bot can only see messages in channels you specifically add it to. It does not have global read access to your workspace.
The bot responds to `@` mentions or to all messages in a specific channel that you configure.
Each message sent by the bot counts toward your assistant message usage.
## Set up the Slack app
You can only install the Slack app once per workspace. If you have multiple Mintlify deployments, you can only connect one deployment at a time to a workspace. You must disconnect the app from one deployment before connecting it to another.
If your Slack Workspace Owner requires admin approval to install apps, ask them to approve the Mintlify Slack app before you add it.
Go to the [Assistant](https://dashboard.mintlify.com/products/assistant) page in your dashboard.
In the Slack card, click **Configure**. This opens Slack.
Follow the Slack prompts to add the app to your workspace.
Mention the bot to add it to a channel. The bot's default name is `@mintlify-assistant`.
## Create an `#ask-ai` channel
To help your users quickly get answers to their questions, the bot can reply to every message in a channel that you choose. By default, the bot replies to every message in channels named `#ask-ai`. Create an `#ask-ai` channel and let your users know that the bot replies to messages in that channel. See [Create a channel](https://slack.com/help/articles/201402297-Create-a-channel) in the Slack Help Center for more information.
If you want the bot to reply to messages in a different channel, select a channel in the Slack bot [configuration menu](https://dashboard.mintlify.com/products/assistant/settings/integrations).
## Manage the Slack app
After you add the app to your workspace, you can manage or remove the app from the [Integrations](https://dashboard.mintlify.com/products/assistant/settings/integrations) tab.
In the Slack bot configuration menu, customize the bot by changing its avatar or name, and choose which channel it automatically replies to all messages in.
# AsyncAPI Setup
Source: https://mintlify-docs.mintlify.app/api-playground/asyncapi-setup
Create WebSocket documentation with AsyncAPI specifications for real-time API endpoints.
AsyncAPI is a specification for describing asynchronous APIs, particularly WebSockets. Mintlify supports AsyncAPI 3.0 documents to generate interactive WebSocket documentation.
## Add an AsyncAPI specification file
To create pages for your websockets, you must have a valid AsyncAPI schema document in either JSON or YAML format that follows the [AsyncAPI specification 3.0](https://www.asyncapi.com/docs/reference/specification/v3.0.0).
Use the [AsyncAPI Studio](https://studio.asyncapi.com/) to validate your AsyncAPI schema.
```bash {3} theme={null}
/your-project
|- docs.json
|- asyncapi.json
```
## Auto-populate websockets pages
To automatically generate pages for all channels in your AsyncAPI schema, add an `asyncapi` property to any navigation element. The `asyncapi` property accepts:
* A path to an AsyncAPI schema document in your documentation repo
* A URL to a hosted AsyncAPI document
* An array of links to AsyncAPI schema documents
### Examples with tabs
```json theme={null}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"asyncapi": "/path/to/asyncapi.json"
}
]
}
```
```json theme={null}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"asyncapi": "https://github.com/asyncapi/spec/blob/master/examples/simple-asyncapi.yml"
}
]
}
```
```json theme={null}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"asyncapi": [
"/path/to/events.json",
"/path/to/webhooks.json"
]
}
]
}
```
When you specify multiple AsyncAPI files, each file generates its own set of channel pages.
### Examples with groups
For more organization, use groups to structure your AsyncAPI documentation:
```json theme={null}
"navigation": {
"tabs": [
{
"tab": "AsyncAPI",
"groups": [
{
"group": "Websockets",
"asyncapi": {
"source": "/path/to/asyncapi.json",
"directory": "websockets"
}
}
]
}
]
}
```
The `directory` field is optional. If not specified, Mintlify adds the files to the `api-reference` folder of the docs repo.
## Channel page
If you want more control over how you order your channels or if you want to reference only specific channels, create an MDX file with the `asyncapi` property in the frontmatter.
```mdx theme={null}
---
title: "Websocket Channel"
asyncapi: "/path/to/asyncapi.json channelName"
---
```
This approach allows you to:
* Customize page metadata and titles
* Add additional context and documentation around the channel
* Control which channels appear in your documentation
* Order channels manually in your navigation
The channel name must exactly match the channel identifier in your AsyncAPI specification.
# Create Manual API Pages
Source: https://mintlify-docs.mintlify.app/api-playground/mdx-setup
Document API endpoints manually with MDX files for full control over your API documentation.
You can manually define API endpoints in individual MDX pages. This approach is useful for small APIs or prototyping.
## Setup
In your `docs.json` file, define your base URL and authentication method.
```json Example docs.json theme={null}
"api": {
"mdx": {
"server": "https://api.acme.com/",
"auth": {
"method": "key",
"name": "x-api-key"
}
}
}
```
If you want to hide the API playground, set the `display` field to `none`. You don't need to include an authentication method if you hide the playground.
```json theme={null}
"api": {
"playground": {
"display": "none"
}
}
```
Find a full list of API configurations in [Settings](/organize/settings#api-configurations).
Create an MDX file for each endpoint. Define the `title` and `api` in the frontmatter:
```mdx theme={null}
---
title: 'Create new user'
api: 'POST /v1/users'
---
```
The `api` frontmatter field accepts either a full URL or a relative path:
* **Full URL** like `POST https://api.acme.com/v1/users`. The `server` field in `docs.json` is ignored for that endpoint.
* **Relative path** like `POST /v1/users`. Requires a `server` field in `docs.json`. The server URL is prepended to the path.
Specify path parameters by wrapping them in `{}`:
```bash theme={null}
https://api.example.com/v1/endpoint/{userId}
```
To override the global playground display mode for a specific page, add `playground` to the frontmatter:
```mdx theme={null}
---
title: 'Create new user'
api: 'POST https://api.mintlify.com/user'
playground: 'none'
---
```
**Options:**
* `playground: 'interactive'` - Display the interactive playground (default)
* `playground: 'simple'` - Display a copyable endpoint with no playground
* `playground: 'none'` - Hide the playground entirely
Use [parameter and response fields](/components/fields) to document your endpoint's parameters and return values.
```mdx theme={null}
Unique identifier for the user
User's email address
Unique identifier for the newly created user
User's email address
```
Add your endpoint pages to the navigation by updating the `pages` field in your `docs.json`:
```json docs.json theme={null}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"groups": [
{
"group": "Users",
"pages": [
"api-reference/users/create-user",
"api-reference/users/get-user",
"api-reference/users/update-user"
]
},
{
"group": "Orders",
"pages": [
"api-reference/orders/create-order",
"api-reference/orders/list-orders"
]
}
]
}
]
}
```
Each page path corresponds to an MDX file in your docs repository. For example, `api-reference/users/create-user.mdx`.
### Using OpenAPI endpoints in navigation
If you have an OpenAPI specification, you can reference endpoints directly in your navigation without creating individual MDX files.
```json docs.json theme={null}
"navigation": {
"pages": [
"introduction",
"/path/to/users-openapi.json POST /users",
"/path/to/orders-openapi.json GET /orders"
]
}
```
You can also set a default OpenAPI spec for a navigation group and reference endpoints by method and path:
```json docs.json theme={null}
{
"group": "API reference",
"openapi": "/path/to/openapi-v1.json",
"pages": [
"overview",
"authentication",
"GET /users",
"POST /users",
{
"group": "Orders",
"openapi": "/path/to/openapi-v2.json",
"pages": [
"GET /orders",
"POST /orders"
]
}
]
}
```
For more details on OpenAPI integration, see [OpenAPI setup](/api-playground/openapi-setup).
## Enable authentication
You can set authentication globally in `docs.json` or override it on individual pages using the `authMethod` field in frontmatter. A page-specific method overrides the global setting.
### Bearer token
```json theme={null}
"api": {
"mdx": {
"auth": {
"method": "bearer"
}
}
}
```
```mdx theme={null}
---
title: "Your page title"
authMethod: "bearer"
---
```
### Basic authentication
```json theme={null}
"api": {
"mdx": {
"auth": {
"method": "basic"
}
}
}
```
```mdx theme={null}
---
title: "Your page title"
authMethod: "basic"
---
```
### API key
```json theme={null}
"api": {
"mdx": {
"auth": {
"method": "key",
"name": "x-api-key"
}
}
}
```
```mdx theme={null}
---
title: "Your page title"
authMethod: "key"
---
```
### None
To disable authentication on a specific page, set `authMethod` to `none`:
```mdx Page Metadata theme={null}
---
title: "Your page title"
authMethod: "none"
---
```
# OpenAPI Setup
Source: https://mintlify-docs.mintlify.app/api-playground/openapi-setup
Generate API pages from your OpenAPI specification automatically.
OpenAPI is a specification for describing APIs. Mintlify supports OpenAPI 3.0 and 3.1 documents to generate interactive API documentation and keep it up to date.
## Add an OpenAPI specification file
To document your endpoints with OpenAPI, you need one or more valid OpenAPI specifications in either JSON or YAML format that follow the [OpenAPI specification 3.0 or 3.1](https://swagger.io/specification/).
Add OpenAPI specifications to your documentation repository or host them online where you can access the specifications by URL. Specifications stored in your repository are served as downloadable files at their path on your docs domain.
Mintlify supports `$ref` for **internal references only** within a single OpenAPI document. External references are not supported.
### Describe your API
We recommend the following resources to learn about and construct your OpenAPI specification:
* [Swagger's OpenAPI Guide](https://swagger.io/docs/specification/v3_0/basic-structure/) to learn the OpenAPI syntax
* [The OpenAPI specification](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/) to reference details of the latest specification
* [Swagger Editor](https://editor.swagger.io/) to edit, validate, and debug your OpenAPI document
* [The Mint CLI](https://www.npmjs.com/package/mint) to validate your OpenAPI document with `mint openapi-check `
### Specify the base URL for your API
To enable the API playground, add a `servers` field to your OpenAPI specification with your API's base URL.
```json theme={null}
{
"servers": [
{
"url": "https://api.example.com/v1"
}
]
}
```
In an OpenAPI specification, different API endpoints are specified by their paths, like `/users/{id}` or simply `/`. The base URL defines where these paths should be appended.
The API playground uses these server URLs to determine where to send requests. If you specify multiple servers, a dropdown allows users to toggle between servers.
If your API has endpoints that exist at different URLs, you can [override the servers field](https://swagger.io/docs/specification/v3_0/api-host-and-base-path/#overriding-servers) for a given path or operation.
### Specify authentication
To enable authentication in your API documentation and playground, configure the `securitySchemes` and `security` fields in your OpenAPI specification.
Add a `securitySchemes` field to define how users authenticate.
This example shows a configuration for bearer authentication.
```json theme={null}
{
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
}
}
```
Add a `security` field to require authentication.
```json theme={null}
{
"security": [
{
"bearerAuth": []
}
]
}
```
Common authentication types include:
* [API Keys](https://swagger.io/docs/specification/authentication/api-keys/): For header, query, or cookie-based keys
* [Bearer](https://swagger.io/docs/specification/authentication/bearer-authentication/): For JWT or OAuth tokens
* [Basic](https://swagger.io/docs/specification/authentication/basic-authentication/): For username and password
If different endpoints require different authentication methods, you can [override the security field](https://swagger.io/docs/specification/authentication/#:~:text=you%20can%20apply%20them%20to%20the%20whole%20API%20or%20individual%20operations) per operation.
## Customize your endpoint pages
Customize your endpoint pages by adding the `x-mint` extension to your OpenAPI specification. The `x-mint` extension provides additional control over how your API documentation is generated and displayed.
### Metadata
Override the default metadata for generated API pages by adding `x-mint: metadata` to any operation. You can use any metadata field that would be valid in MDX frontmatter except for `openapi`.
```json {7-13} theme={null}
{
"paths": {
"/users": {
"get": {
"summary": "Get users",
"description": "Retrieve a list of users",
"x-mint": {
"metadata": {
"title": "List all users",
"description": "Fetch paginated user data with filtering options",
"og:title": "Display a list of users"
}
}
}
}
}
}
```
You can also control playground display per endpoint using the `playground` and `groups` metadata fields:
```json {7-11} theme={null}
{
"paths": {
"/admin/users": {
"post": {
"summary": "Create admin user",
"x-mint": {
"metadata": {
"playground": "auth",
"groups": ["admin"],
"public": true
}
}
}
}
}
}
```
This configuration makes the page publicly visible while restricting the interactive playground to authenticated users in the `admin` group.
### Content
Add content before the auto-generated API documentation using `x-mint: content`. The `x-mint: content` extension supports all Mintlify MDX components and formatting.
```json {6-8} theme={null}
{
"paths": {
"/users": {
"post": {
"summary": "Create user",
"x-mint": {
"content": "## Prerequisites\n\nThis endpoint requires admin privileges and has rate limiting.\n\nUser emails must be unique across the system."
}
}
}
}
}
```
### Href
Set the URL of the autogenerated endpoint page using `x-mint: href`. When `x-mint: href` is present, the generated API page uses the specified URL instead of the default autogenerated URL.
```json {6-8} theme={null}
{
"paths": {
"/legacy-endpoint": {
"get": {
"summary": "Legacy endpoint",
"x-mint": {
"href": "/deprecated-endpoints/legacy-endpoint"
}
}
}
}
}
```
## Auto-populate API pages
Add an `openapi` field to any navigation element in your `docs.json` to automatically generate pages for OpenAPI endpoints.
The `openapi` field accepts either a file path in your docs repo or a URL to a hosted OpenAPI document.
To exclude specific endpoints from your auto-generated API pages, add the `x-hidden` property to the operation in your OpenAPI spec.
There are two approaches for adding endpoint pages into your documentation:
### Dedicated API sections
Generate dedicated API sections by adding an `openapi` field to a navigation element. All endpoints in the specification are included.
```json Single specification theme={null}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"openapi": "openapi.json"
}
]
}
```
```json Multiple specifications theme={null}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"openapi": [
"openapi/v1.json",
"openapi/v2.json"
]
}
]
}
```
To organize multiple OpenAPI specifications in separate sections, assign each specification to a different group:
```json {8-11, 15-18} theme={null}
"navigation": {
"tabs": [
{
"tab": "API Reference",
"groups": [
{
"group": "Users API",
"openapi": {
"source": "/path/to/users-openapi.json",
"directory": "users-api-reference"
}
},
{
"group": "Admin API",
"openapi": {
"source": "/path/to/admin-openapi.json",
"directory": "admin-api-reference"
}
}
]
}
]
}
```
The `directory` field is optional and specifies where generated API pages are stored in your docs repo. If not specified, defaults to the `api-reference` directory.
### Selective endpoints
When you want more control over where endpoints appear in your documentation, you can reference specific endpoints in your navigation.
#### Set a default OpenAPI spec
Configure a default OpenAPI specification for a navigation element, then reference specific endpoints in the `pages` field:
```json {12, 15-16} theme={null}
"navigation": {
"tabs": [
{
"tab": "Getting started",
"pages": [
"quickstart",
"installation"
]
},
{
"tab": "API reference",
"openapi": "/path/to/openapi.json",
"pages": [
"api-overview",
"GET /users",
"POST /users",
"guides/authentication"
]
}
]
}
```
Any page entry matching the format `METHOD /path` generates an API page for that endpoint using the default OpenAPI specification.
#### OpenAPI spec inheritance
OpenAPI specifications are inherited down the navigation hierarchy. Child navigation elements inherit their parent's OpenAPI specification unless they define their own.
```json {3, 7-8, 11, 13-14} theme={null}
{
"group": "API reference",
"openapi": "/path/to/openapi-v1.json",
"pages": [
"overview",
"authentication",
"GET /users",
"POST /users",
{
"group": "Orders",
"openapi": "/path/to/openapi-v2.json",
"pages": [
"GET /orders",
"POST /orders"
]
}
]
}
```
## Create MDX pages from your OpenAPI specification
For more granular control over individual endpoint pages, create MDX pages from your OpenAPI specification. This lets you customize page metadata, content, and reorder or exclude pages in your navigation.
### Document endpoints
Create a page for each endpoint and specify which OpenAPI operation to display using the `openapi` field in the frontmatter.
```mdx Example theme={null}
---
title: "Get users"
description: "Returns all plants from the system that the user has access to"
openapi: "/path/to/openapi-1.json GET /users"
deprecated: true
version: "1.0"
---
```
```mdx Format theme={null}
---
title: "title of the page"
description: "description of the page"
openapi: openapi-file-path method path
deprecated: boolean (not required)
version: "version-string" (not required)
---
```
The method and path must exactly match your OpenAPI spec.
#### Autogenerate endpoint pages
To autogenerate MDX files from your OpenAPI specification, use the Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping):
```bash theme={null}
npx @mintlify/scraping@latest openapi-file -o
```
Add the `-o` flag to specify a folder to populate the files into. If a folder is not specified, the files populate in the working directory.
### Document data models
Create a page for each data structure defined in your OpenAPI specification's `components.schemas` using the `openapi-schema` field in the frontmatter.
```mdx Example theme={null}
---
openapi-schema: OrderItem
---
```
```mdx With file path theme={null}
---
openapi-schema: en-schema.json OrderItem
---
```
If you have schemas with the same name in multiple files, specify the OpenAPI file.
## Webhooks
Webhooks are HTTP callbacks that your API sends to notify external systems when events occur. Webhooks are supported in OpenAPI 3.1+ documents.
Add a `webhooks` field to your OpenAPI document alongside the `paths` field.
To create an MDX page for a webhook (OpenAPI 3.1+), use `webhook` instead of an HTTP method:
```mdx theme={null}
---
title: "Order updated webhook"
description: "Triggered when an order is updated"
openapi: "openapi.json webhook orderUpdated"
---
```
The webhook name must exactly match the key in your OpenAPI spec's `webhooks` field.
# API Playground
Source: https://mintlify-docs.mintlify.app/api-playground/overview
Let developers test API endpoints directly in your documentation with interactive playgrounds.
The API playground is an interactive environment that lets users test and explore your API endpoints. Developers can craft API requests, submit them, and view responses without leaving your documentation.
The playground generates interactive pages for your endpoints based on your OpenAPI specification or AsyncAPI schema. If you modify your API, the playground automatically updates the relevant pages.
We recommend generating your API playground from an OpenAPI specification. However, you can manually create API reference pages after defining a base URL and authentication method in your `docs.json`.
## Get started
Validate your OpenAPI specification file using the [Swagger Editor](https://editor.swagger.io/) or [Mint CLI](https://www.npmjs.com/package/mint) command `mint openapi-check `.
```bash {3} theme={null}
/your-project
|- docs.json
|- openapi.json
```
Update your `docs.json` to reference your OpenAPI specification.
**To automatically generate pages for all endpoints in your OpenAPI specification**, add an `openapi` property to any navigation element.
This example generates a page for each endpoint specified in `openapi.json` and organizes the pages in the "API reference" group.
```json Generate all endpoint pages theme={null}
"navigation": {
"groups": [
{
"group": "API reference",
"openapi": "openapi.json"
}
]
}
```
**To generate pages for only specific endpoints**, list the endpoints in the `pages` property of the navigation element.
This example generates pages for only the `GET /users` and `POST /users` endpoints. To generate other endpoint pages, add additional endpoints to the `pages` array.
```json Generate specific endpoint pages theme={null}
"navigation": {
"groups": [
{
"group": "API reference",
"openapi": "openapi.json",
"pages": [
"GET /users",
"POST /users"
]
}
]
}
```
## Customize your playground
Customize your API playground by defining the following properties in your `docs.json`.
### Playground display
Control how the API playground appears to users with the `playground.display` property:
* `"interactive"`: Display the interactive playground (default)
* `"simple"`: Display a copyable endpoint with no playground
* `"none"`: Display nothing
* `"auth"`: Display the interactive playground only to authenticated users
```json theme={null}
{
"api": {
"playground": {
"display": "interactive",
"proxy": true
}
}
}
```
The `proxy` option controls whether to pass API requests through a proxy server. Defaults to `true`.
### Example code snippets
Configure the autogenerated API examples with the `examples` property:
```json theme={null}
{
"api": {
"examples": {
"languages": ["curl", "python", "javascript"],
"defaults": "required",
"prefill": true,
"autogenerate": true
}
}
}
```
**Available options:**
* `languages`: Array of programming languages to show in code examples. Languages display in the order specified.
* `defaults`: Whether to show optional parameters (`"all"`) or only required ones (`"required"`). Defaults to `"all"`.
* `prefill`: Whether to prefill the API playground with data from schema examples. Defaults to `false`.
* `autogenerate`: Whether to generate code samples from API specifications. Defaults to `true`.
Supported languages include: cURL, Python, JavaScript, Node.js, PHP, Go, Java, Ruby, PowerShell, Swift, C#, .NET, TypeScript, C, C++, Kotlin, Rust, and Dart.
### Example configuration
This example configures the API playground to be interactive with example code snippets for cURL, Python, and JavaScript. Only required parameters are shown in the code snippets, and the playground prefills the request body with example values.
```json theme={null}
{
"api": {
"playground": {
"display": "interactive"
},
"examples": {
"languages": ["curl", "python", "javascript"],
"defaults": "required",
"prefill": true
}
}
}
```
## Auth-based playground display
Use the `auth` display mode to show the interactive playground only to authenticated users. This is useful when you want to let users view your API documentation publicly while restricting playground access to logged-in users.
When `display` is set to `auth`:
* Authenticated users see the interactive playground
* Unauthenticated users see no playground (equivalent to `none`)
You can also combine `auth` with the `groups` property in page frontmatter to restrict playground access to specific user groups.
```mdx Page with group-restricted playground theme={null}
---
title: "Create user"
openapi: POST /users
playground: auth
groups: ["admin", "developer"]
public: true
---
```
In this example:
* The page is publicly visible (anyone can view the documentation)
* Only authenticated users in the `admin` or `developer` groups see the interactive playground
* Users not in those groups see no playground
The `auth` display mode requires [authentication](/deploy/authentication-setup) to be configured for your documentation.
## Custom endpoint pages
When you need more control over your API documentation, use the `x-mint` extension in your OpenAPI specification or create individual MDX pages for your endpoints.
Both options allow you to:
* Customize page metadata
* Add additional content like examples
* Control playground behavior per page
The `x-mint` extension is recommended so that all of your API documentation is automatically generated from your OpenAPI specification and maintained in one file.
Individual MDX pages are recommended for small APIs or when you want to experiment with changes on a per-page basis.
## Further reading
Learn how to create and configure your OpenAPI document
Create manual API reference pages with MDX files
Document WebSocket APIs with AsyncAPI schemas
# Create agent job
Source: https://mintlify-docs.mintlify.app/api/agent/create-agent-job
Create an agent job to automatically edit your documentation
This endpoint creates an agent job based on provided messages and branch information. The job executes asynchronously and returns a streaming response with the execution details and results.
If a branch doesn't exist, the agent creates one. If files are edited successfully, a pull request is automatically created at the end of the job.
## Rate limits
The agent API has the following limits:
* 100 uses per Mintlify project per hour
## Suggested usage
For best results, use the [useChat hook from ai-sdk](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat#usechat) to send requests and handle responses.
```bash cURL theme={null}
curl -X POST https://api.mintlify.com/v1/agent/{projectId}/job \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"branch": "agent-update-docs",
"messages": [
{
"role": "user",
"content": "Update the introduction page to include information about our new API endpoint"
}
],
"asDraft": false,
"model": "sonnet"
}'
```
```javascript JavaScript theme={null}
const response = await fetch(
`https://api.mintlify.com/v1/agent/${projectId}/job`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
branch: 'agent-update-docs',
messages: [
{
role: 'user',
content: 'Update the introduction page to include information about our new API endpoint'
}
],
asDraft: false,
model: 'sonnet'
})
}
);
// The response is a streaming text response
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
```
```python Python theme={null}
import requests
response = requests.post(
f"https://api.mintlify.com/v1/agent/{project_id}/job",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"branch": "agent-update-docs",
"messages": [
{
"role": "user",
"content": "Update the introduction page to include information about our new API endpoint"
}
],
"asDraft": False,
"model": "sonnet"
},
stream=True
)
# Stream the response
for chunk in response.iter_content(chunk_size=None):
if chunk:
print(chunk.decode('utf-8'), end='')
```
## Endpoint
Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard.
## Request Body
The name of the Git branch that the agent should work on. Will be automatically created if it doesn't exist.
A list of messages to provide to the agent. A default system prompt is always prepended automatically, so you typically only need to include user messages.
The role of the message sender. Use `user` for task instructions. Use `system` to add supplementary instructions that are appended after the default system prompt (does not replace it).
The content of the message.
Control whether the pull request is created in draft or non-draft mode. When true, creates a draft pull request. When false (default), creates a regular pull request ready for review.
The AI model to use for the agent job. Use `sonnet` for faster, cost-effective processing. Use `opus` for more capable, but slower processing.
## Response
The endpoint returns a streaming text response containing the agent job execution details and results. The response includes an `X-Message-Id` header containing the message identifier for the created job.
```text Streaming Response theme={null}
Agent job started...
Reading documentation files...
Updating introduction.mdx...
Creating pull request...
Pull request created: https://github.com/your-org/your-repo/pull/123
Agent job completed successfully.
```
## Authentication
This endpoint requires an admin API key (prefixed with `mint_`). Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Get agent job
Source: https://mintlify-docs.mintlify.app/api/agent/get-agent-job
Retrieve the details and status of a specific agent job
This endpoint retrieves the details and status of a specific agent job by its unique identifier. Use this to check the progress, status, and results of a previously created agent job.
## Usage
The response includes information such as:
* Job execution status and completion state
* Branch information and pull request details
* Session metadata and timestamps
```bash cURL theme={null}
curl -X GET https://api.mintlify.com/v1/agent/{projectId}/job/{id} \
-H "Authorization: Bearer YOUR_API_KEY"
```
```javascript JavaScript theme={null}
const response = await fetch(
`https://api.mintlify.com/v1/agent/${projectId}/job/${jobId}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const job = await response.json();
console.log('Job status:', job.haulted ? 'Completed' : 'Running');
console.log('Pull request:', job.pullRequestLink);
```
```python Python theme={null}
import requests
response = requests.get(
f"https://api.mintlify.com/v1/agent/{project_id}/job/{job_id}",
headers={
"Authorization": "Bearer YOUR_API_KEY"
}
)
job = response.json()
print(f"Job status: {'Completed' if job['haulted'] else 'Running'}")
print(f"Pull request: {job.get('pullRequestLink', 'N/A')}")
```
## Endpoint
Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard.
The unique identifier of the agent job to retrieve.
## Response
The session ID for this job.
The subdomain this session belongs to.
Git branch name where changes were made.
Whether the session execution was halted (completed).
Reason for session halt. One of: `completed`, `github_missconfigured`, `error`.
Link to the created pull request.
Message for the user about the session outcome.
List of todo items from the session.
Brief description of the task.
Current status of the task. One of: `pending`, `in_progress`, `completed`, `cancelled`.
Priority level of the task. One of: `high`, `medium`, `low`.
Unique identifier for the todo item.
ISO 8601 timestamp when the session was created.
```json Response theme={null}
{
"sessionId": "abc123xyz789",
"subdomain": "example",
"branch": "agent-update-docs",
"haulted": true,
"haultReason": "completed",
"pullRequestLink": "https://github.com/your-org/your-repo/pull/123",
"messageToUser": "Successfully updated the introduction page with new API endpoint information.",
"todos": [
{
"content": "Update introduction.mdx with new API endpoint",
"status": "completed",
"priority": "high",
"id": "todo-1"
},
{
"content": "Create pull request",
"status": "completed",
"priority": "medium",
"id": "todo-2"
}
],
"createdAt": "2024-01-15T10:30:00.000Z"
}
```
## Authentication
This endpoint requires an admin API key (prefixed with `mint_`). Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Get all agent jobs
Source: https://mintlify-docs.mintlify.app/api/agent/get-all-jobs
Retrieve all agent jobs for the specified domain
This endpoint retrieves all agent jobs for the specified domain, providing an overview of all agent activities and their current status. This is useful for monitoring and managing multiple concurrent or historical agent jobs.
## Usage
Use this endpoint to get a comprehensive view of all previous agent sessions.
```bash cURL theme={null}
curl -X GET https://api.mintlify.com/v1/agent/{projectId}/jobs \
-H "Authorization: Bearer YOUR_API_KEY"
```
```javascript JavaScript theme={null}
const response = await fetch(
`https://api.mintlify.com/v1/agent/${projectId}/jobs`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(`Found ${data.allSessions.length} agent jobs`);
```
```python Python theme={null}
import requests
response = requests.get(
f"https://api.mintlify.com/v1/agent/{project_id}/jobs",
headers={
"Authorization": "Bearer YOUR_API_KEY"
}
)
data = response.json()
print(f"Found {len(data['allSessions'])} agent jobs")
```
## Endpoint
Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard.
## Response
Array of all agent sessions for the domain.
The session ID for this job.
The subdomain this session belongs to.
Git branch name where changes were made.
Whether the session execution was halted (completed).
Reason for session halt. One of: `completed`, `github_missconfigured`, `error`.
Link to the created pull request.
Message for the user about the session outcome.
List of todo items from the session.
Brief description of the task.
Current status of the task. One of: `pending`, `in_progress`, `completed`, `cancelled`.
Priority level of the task. One of: `high`, `medium`, `low`.
Unique identifier for the todo item.
ISO 8601 timestamp when the session was created.
```json Response theme={null}
{
"allSessions": [
{
"sessionId": "abc123xyz789",
"subdomain": "example",
"branch": "agent-update-docs",
"haulted": true,
"haultReason": "completed",
"pullRequestLink": "https://github.com/your-org/your-repo/pull/123",
"messageToUser": "Successfully updated the introduction page.",
"todos": [
{
"content": "Update introduction.mdx",
"status": "completed",
"priority": "high",
"id": "todo-1"
}
],
"createdAt": "2024-01-15T10:30:00.000Z"
},
{
"sessionId": "def456uvw012",
"subdomain": "example",
"branch": "agent-add-api-docs",
"haulted": true,
"haultReason": "completed",
"pullRequestLink": "https://github.com/your-org/your-repo/pull/124",
"messageToUser": "Created new API documentation pages.",
"todos": [
{
"content": "Create API reference pages",
"status": "completed",
"priority": "high",
"id": "todo-1"
}
],
"createdAt": "2024-01-14T14:20:00.000Z"
}
]
}
```
## Authentication
This endpoint requires an admin API key (prefixed with `mint_`). Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Get assistant conversations
Source: https://mintlify-docs.mintlify.app/api/analytics/assistant-conversations
Export AI assistant conversation history from your documentation
Use this endpoint to export AI assistant conversation history from your documentation. Each conversation includes the user query, assistant response, sources cited, and query category.
Paginate through results using the `cursor` parameter returned in the response. Continue fetching while `hasMore` is `true`.
## Filtering
Filter conversations by date range using `dateFrom` and `dateTo` parameters.
## Conversation data
Each conversation includes:
* **query**: The user's question
* **response**: The assistant's answer
* **sources**: Pages referenced in the response, with title and URL
* **queryCategory**: Classification of the query type (if available)
```bash cURL theme={null}
curl -X GET "https://api.mintlify.com/v1/analytics/{projectId}/assistant?dateFrom=2024-01-01&dateTo=2024-01-31&limit=100" \
-H "Authorization: Bearer YOUR_API_KEY"
```
```javascript JavaScript theme={null}
const projectId = 'your-project-id';
const dateFrom = '2024-01-01';
const dateTo = '2024-01-31';
const response = await fetch(
`https://api.mintlify.com/v1/analytics/${projectId}/assistant?dateFrom=${dateFrom}&dateTo=${dateTo}&limit=100`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(`Retrieved ${data.conversations.length} conversations`);
// Paginate through results
let cursor = data.nextCursor;
while (data.hasMore && cursor) {
const nextResponse = await fetch(
`https://api.mintlify.com/v1/analytics/${projectId}/assistant?cursor=${cursor}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const nextData = await nextResponse.json();
console.log(`Retrieved ${nextData.conversations.length} more conversations`);
cursor = nextData.nextCursor;
}
```
```python Python theme={null}
import requests
project_id = 'your-project-id'
date_from = '2024-01-01'
date_to = '2024-01-31'
response = requests.get(
f"https://api.mintlify.com/v1/analytics/{project_id}/assistant",
headers={
"Authorization": "Bearer YOUR_API_KEY"
},
params={
"dateFrom": date_from,
"dateTo": date_to,
"limit": 100
}
)
data = response.json()
print(f"Retrieved {len(data['conversations'])} conversations")
# Paginate through results
cursor = data.get('nextCursor')
while data['hasMore'] and cursor:
next_response = requests.get(
f"https://api.mintlify.com/v1/analytics/{project_id}/assistant",
headers={
"Authorization": "Bearer YOUR_API_KEY"
},
params={
"cursor": cursor
}
)
next_data = next_response.json()
print(f"Retrieved {len(next_data['conversations'])} more conversations")
cursor = next_data.get('nextCursor')
```
## Endpoint
Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard.
## Query Parameters
Date in ISO 8601 or YYYY-MM-DD format. Filter conversations that occurred on or after this date.
Date in ISO 8601 or YYYY-MM-DD format. `dateTo` is an exclusive upper limit. Results include dates before, but not on, the specified date.
Max results per page. Minimum: 1, Maximum: 1000.
Pagination cursor (ULID format) returned from a previous response.
## Response
List of assistant conversations.
Unique conversation identifier.
ISO 8601 timestamp when the conversation occurred.
The user's question to the assistant.
The assistant's response.
Documentation pages referenced in the response.
Title of the referenced documentation page.
URL of the referenced documentation page.
Auto-assigned category grouping for the conversation, if applicable.
Cursor to retrieve the next page of results. Null if no more results.
Whether additional results are available beyond this page.
```json Response theme={null}
{
"conversations": [
{
"id": "conv_123abc",
"timestamp": "2024-01-15T10:30:00.000Z",
"query": "How do I authenticate with the API?",
"response": "To authenticate with the API, you need to include your API key in the Authorization header of your requests. You can generate an API key from your dashboard settings...",
"sources": [
{
"title": "Authentication",
"url": "https://docs.example.com/api-reference/authentication"
},
{
"title": "API Keys",
"url": "https://docs.example.com/api-reference/api-keys"
}
],
"queryCategory": "authentication"
},
{
"id": "conv_456def",
"timestamp": "2024-01-14T14:20:00.000Z",
"query": "What programming languages are supported?",
"response": "We provide SDKs and examples for JavaScript, Python, Ruby, Go, and PHP. You can find code examples in each language throughout our documentation...",
"sources": [
{
"title": "SDKs",
"url": "https://docs.example.com/sdks"
},
{
"title": "Code Examples",
"url": "https://docs.example.com/examples"
}
],
"queryCategory": "general"
}
],
"nextCursor": "01HQZX9K2MNBVCXZ7GQRST8WVY",
"hasMore": true
}
```
## Authentication
This endpoint requires an admin API key (prefixed with `mint_`). Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Get user feedback
Source: https://mintlify-docs.mintlify.app/api/analytics/feedback
Export user feedback collected from your documentation
Use this endpoint to export user feedback collected from your documentation. Feedback includes contextual feedback from page ratings and code snippet feedback.
Paginate through results using the `cursor` parameter returned in the response. Continue fetching while `hasMore` is `true`.
## Filtering
Filter feedback by:
* **Date range**: Use `dateFrom` and `dateTo` to limit results to a specific time period
* **Source**: Filter by `code_snippet` or `contextual` feedback types
* **Status**: Filter by status values like `pending`, `in_progress`, `resolved`, or `dismissed`
## Response types
The response contains different feedback types based on the source:
* **Contextual feedback**: Includes `helpful` boolean and optional `contact` email
* **Code snippet feedback**: Includes `code`, `filename`, and `lang` fields
```bash cURL theme={null}
curl -X GET "https://api.mintlify.com/v1/analytics/{projectId}/feedback?dateFrom=2024-01-01&dateTo=2024-01-31&limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"
```
```javascript JavaScript theme={null}
const projectId = 'your-project-id';
const dateFrom = '2024-01-01';
const dateTo = '2024-01-31';
const response = await fetch(
`https://api.mintlify.com/v1/analytics/${projectId}/feedback?dateFrom=${dateFrom}&dateTo=${dateTo}&limit=50`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(`Retrieved ${data.feedback.length} feedback items`);
// Paginate through results
let cursor = data.nextCursor;
while (data.hasMore && cursor) {
const nextResponse = await fetch(
`https://api.mintlify.com/v1/analytics/${projectId}/feedback?cursor=${cursor}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const nextData = await nextResponse.json();
console.log(`Retrieved ${nextData.feedback.length} more feedback items`);
cursor = nextData.nextCursor;
}
```
```python Python theme={null}
import requests
project_id = 'your-project-id'
date_from = '2024-01-01'
date_to = '2024-01-31'
response = requests.get(
f"https://api.mintlify.com/v1/analytics/{project_id}/feedback",
headers={
"Authorization": "Bearer YOUR_API_KEY"
},
params={
"dateFrom": date_from,
"dateTo": date_to,
"limit": 50
}
)
data = response.json()
print(f"Retrieved {len(data['feedback'])} feedback items")
# Paginate through results
cursor = data.get('nextCursor')
while data['hasMore'] and cursor:
next_response = requests.get(
f"https://api.mintlify.com/v1/analytics/{project_id}/feedback",
headers={
"Authorization": "Bearer YOUR_API_KEY"
},
params={
"cursor": cursor
}
)
next_data = next_response.json()
print(f"Retrieved {len(next_data['feedback'])} more feedback items")
cursor = next_data.get('nextCursor')
```
## Endpoint
Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard.
## Query Parameters
Date in ISO 8601 or YYYY-MM-DD format. Filter feedback created on or after this date.
Date in ISO 8601 or YYYY-MM-DD format. `dateTo` is an exclusive upper limit. Results include dates before, but not on, the specified date.
Filter by feedback source. One of: `code_snippet`, `contextual`.
Comma-separated list of statuses to filter by. Values: `pending`, `in_progress`, `resolved`, `dismissed`.
Max results per page. Minimum: 1, Maximum: 100.
Pagination cursor returned from a previous response.
## Response
List of feedback entries. Each entry contains different fields based on the feedback source.
Unique feedback identifier.
The path or URL to the source document.
Text of the user's feedback comment.
ISO 8601 timestamp when the feedback was submitted.
Where the feedback originated. `code_snippet` is feedback on a code block, `contextual` is page-level feedback.
Current review status of the feedback. One of: `pending`, `in_progress`, `resolved`, `dismissed`.
(Contextual feedback only) Whether the user found the content helpful.
(Contextual feedback only) Email address the user provided for follow-up.
(Code snippet feedback only) The code snippet the feedback relates to.
(Code snippet feedback only) Filename associated with the code snippet.
(Code snippet feedback only) Programming language of the code snippet.
Cursor to retrieve the next page of results. Null if no more results.
Whether additional results are available beyond this page.
```json Response theme={null}
{
"feedback": [
{
"id": "fb_123abc",
"path": "/getting-started",
"comment": "This page was very helpful!",
"createdAt": "2024-01-15T10:30:00.000Z",
"source": "contextual",
"status": "pending",
"helpful": true,
"contact": "user@example.com"
},
{
"id": "fb_456def",
"path": "/api-reference/authentication",
"comment": "This code example has a typo",
"createdAt": "2024-01-14T14:20:00.000Z",
"source": "code_snippet",
"status": "in_progress",
"code": "const apiKey = 'YOUR_API_KEY';\nfetch('/api/data', {\n headers: { Authorization: `Bearer ${apiKey}` }\n});",
"filename": "example.js",
"lang": "javascript"
}
],
"nextCursor": "cursor_789ghi",
"hasMore": true
}
```
## Authentication
This endpoint requires an admin API key (prefixed with `mint_`). Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Assistant message
Source: https://mintlify-docs.mintlify.app/api/assistant/create-assistant-message-v2
Generate AI assistant responses for your documentation (AI SDK v5+)
The assistant message v2 endpoint is compatible with **AI SDK v5+**. If you use AI SDK v4, use the [assistant message v1 endpoint](/api/assistant/create-assistant-message) instead.
## Integration with `useChat`
The `useChat` hook from Vercel's AI SDK is the recommended way to integrate the assistant API into your application.
```bash theme={null}
npm i ai@^6 @ai-sdk/react
```
```tsx theme={null}
import { useState } from "react";
import { useChat } from "@ai-sdk/react";
import { DefaultChatTransport } from "ai";
function MyComponent({ domain }) {
const [input, setInput] = useState("");
const { messages, sendMessage } = useChat({
transport: new DefaultChatTransport({
api: `https://api.mintlify.com/discovery/v2/assistant/${domain}/message`,
headers: {
Authorization: `Bearer ${process.env.PUBLIC_MINTLIFY_ASSISTANT_KEY}`,
},
body: {
fp: "anonymous",
retrievalPageSize: 5,
context: [
{
type: "code",
value: 'const example = "code snippet";',
elementId: "code-block-1",
},
],
},
}),
});
return (
);
}
```
**Required configuration:**
* `transport` - Use `DefaultChatTransport` to configure the API connection.
* `body.fp` - Fingerprint identifier (use `'anonymous'` or a unique user identifier).
* `body.retrievalPageSize` - Number of search results to use (recommended: 5).
**Optional configuration:**
* `body.context` - Array of contextual information to provide to the assistant. Each context object contains:
* `type` - Either `'code'` or `'textSelection'`.
* `value` - The code snippet or selected text content.
* `path` (optional) - Path to the source file or page.
* `elementId` (optional) - Identifier for the UI element containing the context.
See [useChat](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat) and [Transport](https://ai-sdk.dev/docs/ai-sdk-ui/transport) in the AI SDK documentation for more details.
## Rate limits
The assistant API has the following limits:
* 10,000 uses per key per month
* 10,000 requests per Mintlify organization per hour
* 10,000 requests per IP per day
```bash cURL theme={null}
curl -X POST https://api.mintlify.com/discovery/v2/assistant/{domain}/message \
-H "Authorization: Bearer YOUR_ASSISTANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fp": "anonymous",
"messages": [
{
"id": "msg-1",
"role": "user",
"parts": [
{
"type": "text",
"text": "How do I get started?"
}
]
}
],
"retrievalPageSize": 5
}'
```
```javascript JavaScript theme={null}
const response = await fetch(
`https://api.mintlify.com/discovery/v2/assistant/${domain}/message`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ASSISTANT_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fp: 'anonymous',
messages: [
{
id: 'msg-1',
role: 'user',
parts: [
{
type: 'text',
text: 'How do I get started?'
}
]
}
],
retrievalPageSize: 5
})
}
);
```
```python Python theme={null}
import requests
response = requests.post(
f"https://api.mintlify.com/discovery/v2/assistant/{domain}/message",
headers={
"Authorization": "Bearer YOUR_ASSISTANT_API_KEY",
"Content-Type": "application/json"
},
json={
"fp": "anonymous",
"messages": [
{
"id": "msg-1",
"role": "user",
"parts": [
{
"type": "text",
"text": "How do I get started?"
}
]
}
],
"retrievalPageSize": 5
}
)
```
## Endpoint
The domain identifier from your `domain.mintlify.app` URL. Can be found at the end of your dashboard URL. For example, `dashboard.mintlify.com/organization/domain` has a domain identifier of `domain`.
## Request Body
Fingerprint identifier for tracking conversation sessions. Use `anonymous` for anonymous users or provide a unique user identifier.
Array of messages in the conversation. Use the handleSubmit function from the @ai-sdk/react package's useChat hook to manage messages and streaming responses.
Unique identifier for the message.
The role of the message sender. One of: `system`, `assistant`, `user`.
Array of message parts. Each part has a type and type-specific fields.
Must be `text` for text content.
The text content.
ISO 8601 timestamp when the message was created.
Optional metadata associated with the message.
Number of documentation search results to use for generating the response. Higher values provide more context but may increase response time. Recommended: 5.
An optional identifier used to maintain conversation continuity across multiple messages. When provided, it allows the system to associate follow-up messages with the same conversation thread. The `threadId` is returned in the response as `event.threadId` when `event.type === 'finish'`.
Optional filter criteria for the search.
Optional version filter.
Optional language filter.
Optional array of group identifiers to filter results.
Optional array of contextual information to provide to the assistant.
The type of context being provided. Either `code` or `textSelection`.
The code snippet or selected text content.
Optional path to the source file or page.
Optional identifier for the UI element containing the context.
## Response
Streaming response compatible with AI SDK v5. Use the [useChat hook from @ai-sdk/react](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat#usechat) to handle the response stream.
## Authentication
This endpoint requires an assistant API key (prefixed with `mint_dsc_`). This is a public key safe for use in client-side code. Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Search documentation
Source: https://mintlify-docs.mintlify.app/api/assistant/search
Perform semantic and keyword searches across your documentation
Perform semantic and keyword searches across your documentation with configurable filtering and pagination.
```bash cURL theme={null}
curl -X POST https://api.mintlify.com/discovery/v1/search/{domain} \
-H "Authorization: Bearer YOUR_ASSISTANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "how to authenticate",
"pageSize": 10,
"filter": {
"version": "v2",
"language": "en"
}
}'
```
```javascript JavaScript theme={null}
const response = await fetch(
`https://api.mintlify.com/discovery/v1/search/${domain}`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ASSISTANT_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'how to authenticate',
pageSize: 10,
filter: {
version: 'v2',
language: 'en'
}
})
}
);
const results = await response.json();
console.log(`Found ${results.length} results`);
```
```python Python theme={null}
import requests
response = requests.post(
f"https://api.mintlify.com/discovery/v1/search/{domain}",
headers={
"Authorization": "Bearer YOUR_ASSISTANT_API_KEY",
"Content-Type": "application/json"
},
json={
"query": "how to authenticate",
"pageSize": 10,
"filter": {
"version": "v2",
"language": "en"
}
}
)
results = response.json()
print(f"Found {len(results)} results")
```
## Endpoint
The domain identifier from your `domain.mintlify.app` URL. Can be found at the end of your dashboard URL. For example, `dashboard.mintlify.com/organization/domain` has a domain identifier of `domain`.
## Request Body
The search query to execute against your documentation content.
Number of search results to return. Defaults to 10 if not specified.
Optional filtering parameters to narrow search results.
Filter results by documentation version.
Filter results by content language.
## Response
Array of search results.
The matching content from your documentation.
The path or URL to the source document.
Additional metadata about the search result.
```json Response theme={null}
[
{
"content": "To authenticate with the API, include your API key in the Authorization header...",
"path": "/api-reference/authentication",
"metadata": {
"title": "Authentication",
"description": "Learn how to authenticate with our API"
}
},
{
"content": "API keys can be generated from your dashboard settings...",
"path": "/api-reference/api-keys",
"metadata": {
"title": "API Keys",
"description": "Manage your API keys"
}
}
]
```
## Authentication
This endpoint requires an assistant API key (prefixed with `mint_dsc_`). This is a public key safe for use in client-side code. Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Introduction
Source: https://mintlify-docs.mintlify.app/api/introduction
Trigger updates, embed AI assistant, export analytics, and more
The Mintlify REST API enables you to programmatically interact with your documentation, trigger updates, embed AI-powered chat experiences, and export analytics data.
## Endpoints
* [Trigger update](/api/update/trigger): Trigger an update of your site when desired.
* [Get update status](/api/update/status): Get the status of an update and other details about your docs.
* [Create agent job](/api/agent/create-agent-job): Create an agent job to automatically edit your documentation.
* [Get agent job](/api/agent/get-agent-job): Retrieve the details and status of a specific agent job.
* [Get all agent jobs](/api/agent/get-all-jobs): Retrieve all agent jobs for a domain.
* [Generate assistant message](/api/assistant/create-assistant-message-v2): Embed the assistant, trained on your docs, into any application of your choosing.
* [Search documentation](/api/assistant/search): Search through your documentation.
* [Get user feedback](/api/analytics/feedback): Export user feedback from your documentation.
* [Get assistant conversations](/api/analytics/assistant-conversations): Export AI assistant conversation history.
### Common use cases
* **Automated deployments**: Trigger site updates at set intervals or when events occur with [Trigger update](/api/update/trigger) and [Get update status](/api/update/status).
* **CI/CD integration**: Update documentation as part of your deployment pipeline when code changes with [Trigger update](/api/update/trigger).
* **Custom integrations**: Embed the AI assistant into your product, support portal, or internal tools with [Generate assistant message](/api/assistant/create-assistant-message-v2) and [Search documentation](/api/assistant/search).
* **Automated editing**: Use agent jobs to programmatically update documentation at scale with [Create agent job](/api/agent/create-agent-job), [Get agent job](/api/agent/get-agent-job), and [Get all agent jobs](/api/agent/get-all-jobs).
* **Analytics export**: Export feedback and assistant conversations for external analysis with [Get user feedback](/api/analytics/feedback) and [Get assistant conversations](/api/analytics/assistant-conversations).
## Authentication
Generate API keys on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard. Each API key belongs to an organization--you can use keys across multiple deployments within the same organization.
You can create up to 10 API keys per hour per organization.
### Admin API key
Use the admin API key to authenticate requests to [Trigger update](/api/update/trigger), [Get update status](/api/update/status), [Create agent job](/api/agent/create-agent-job), [Get agent job](/api/agent/get-agent-job), [Get all agent jobs](/api/agent/get-all-jobs), [Get user feedback](/api/analytics/feedback), and [Get assistant conversations](/api/analytics/assistant-conversations).
Admin API keys begin with the `mint_` prefix.
The admin API key is a server-side secret. Do not expose it in client-side code.
### Assistant API key
Use the assistant API key to authenticate requests to [Generate assistant message](/api/assistant/create-assistant-message-v2) and [Search documentation](/api/assistant/search) endpoints.
Assistant API keys begin with the `mint_dsc_` prefix.
The assistant API key is a public token that you can reference in frontend code.
Calls using the assistant API token can incur costs: either using your assistant credits or incurring overages.
# Get update status
Source: https://mintlify-docs.mintlify.app/api/update/status
Get the status of an update and deployment details
```bash cURL theme={null}
curl -X GET https://api.mintlify.com/v1/project/update-status/{statusId} \
-H "Authorization: Bearer YOUR_API_KEY"
```
```javascript JavaScript theme={null}
const response = await fetch(
`https://api.mintlify.com/v1/project/update-status/${statusId}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const status = await response.json();
console.log('Update status:', status.status);
```
```python Python theme={null}
import requests
response = requests.get(
f"https://api.mintlify.com/v1/project/update-status/{status_id}",
headers={
"Authorization": "Bearer YOUR_API_KEY"
}
)
status = response.json()
print(f"Update status: {status['status']}")
```
## Endpoint
The status ID of a triggered update. Returned from the [Trigger update](/api/update/trigger) endpoint.
## Response
The status ID of the triggered update.
The documentation project ID.
The status of the update. One of: `queued`, `in_progress`, `success`, `failure`.
Summary of the status of the update.
An ISO 8601 datetime string with the specified datetime in UTC.
An ISO 8601 datetime string with the specified datetime in UTC.
An array of log messages from the update process.
The subdomain of the docs being updated.
A screenshot URL of the docs.
A screenshot URL of the docs in light mode.
A screenshot URL of the docs in dark mode.
The author of the update.
The commit details
The SHA of the commit.
The ref of the commit.
The commit message.
Details on the changed files.
New files added.
Existing files that were modified.
Files that were removed.
The source of the update trigger. One of: `internal`, `github-app-installation`, `api`, `github`, `dashboard`.
```json Response theme={null}
{
"_id": "67890abcdef1234567890abc",
"projectId": "12345abc",
"status": "success",
"summary": "Successfully deployed documentation",
"createdAt": "2024-01-15T10:30:00.000Z",
"endedAt": "2024-01-15T10:32:45.000Z",
"logs": [
"Starting build...",
"Building pages...",
"Deployment successful"
],
"subdomain": "example",
"author": "john@example.com",
"commit": {
"sha": "abc123def456",
"ref": "main",
"message": "Update documentation",
"filesChanged": {
"added": ["new-page.mdx"],
"modified": ["introduction.mdx"],
"removed": []
}
},
"source": "api"
}
```
## Authentication
This endpoint requires an admin API key (prefixed with `mint_`). Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Trigger update
Source: https://mintlify-docs.mintlify.app/api/update/trigger
Queue a deployment update for your documentation project
```bash cURL theme={null}
curl -X POST https://api.mintlify.com/v1/project/update/{projectId} \
-H "Authorization: Bearer YOUR_API_KEY"
```
```javascript JavaScript theme={null}
const response = await fetch(
`https://api.mintlify.com/v1/project/update/${projectId}`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log('Status ID:', data.statusId);
```
```python Python theme={null}
import requests
response = requests.post(
f"https://api.mintlify.com/v1/project/update/{project_id}",
headers={
"Authorization": "Bearer YOUR_API_KEY"
}
)
data = response.json()
print(f"Status ID: {data['statusId']}")
```
## Endpoint
Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard.
## Response
The status ID of the triggered update. Use this ID with the [Get update status](/api/update/status) endpoint to track the update progress.
```json Response theme={null}
{
"statusId": "67890abcdef1234567890abc"
}
```
## Details
This endpoint queues a deployment update for your documentation project. The update is triggered from your configured deployment branch. Returns a status ID that can be used to track the update progress with the [Get update status](/api/update/status) endpoint.
Use this endpoint to:
* Trigger site updates at set intervals or when events occur
* Update documentation as part of your CI/CD pipeline when code changes
* Programmatically deploy documentation updates
## Authentication
This endpoint requires an admin API key (prefixed with `mint_`). Generate one on the [API keys page](https://dashboard.mintlify.com/settings/organization/api-keys) in your dashboard.
# Accordions
Source: https://mintlify-docs.mintlify.app/components/accordions
Use accordions to show and hide content.
Accordions allow users to expand and collapse content sections. Use accordions for progressive disclosure and to organize information.
## Single accordion
You can put any content in here, including other components, like code:
```java HelloWorld.java theme={null}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````mdx Accordion example theme={null}
You can put any content in here, including other components, like code:
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
## Accordion groups
Group related accordions together using ``. This creates a cohesive section of accordions that can be individually expanded or collapsed.
You can put other components inside Accordions.
```java HelloWorld.java theme={null}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
Add icons to make accordions more visually distinct and scannable.
Keep related content organized into groups.
````mdx Accordion Group Example theme={null}
You can put other components inside Accordions.
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
Add icons to make accordions more visually distinct and scannable.
Keep related content organized into groups.
````
## Properties
Title in the Accordion preview.
Detail below the title in the Accordion preview.
Whether the Accordion is open by default.
The icon to display.
Options:
* [Font Awesome](https://fontawesome.com/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `fontawesome` in your `docs.json`
* [Lucide](https://lucide.dev/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `lucide` in your `docs.json`
* [Tabler](https://tabler.io/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `tabler` in your `docs.json`
* URL to an externally hosted icon
* Path to an icon file in your project
* SVG code wrapped in curly braces
For custom SVG icons:
1. Convert your SVG using the [SVGR converter](https://react-svgr.com/playground/).
2. Paste your SVG code into the SVG input field.
3. Copy the complete `` element from the JSX output field.
4. Wrap the JSX-compatible SVG code in curly braces: `icon={}`.
5. Adjust `height` and `width` as needed.
The [Font Awesome](https://fontawesome.com/icons) icon style. Only used with Font Awesome icons.
Options: `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`.
# Callouts
Source: https://mintlify-docs.mintlify.app/components/callouts
Use callouts to style and emphasize important content.
Callouts can be styled as a Note, Warning, Info, Tip, Check, Danger, or create your own callout:
This adds a note in the content
```mdx theme={null}
This adds a note in the content
```
This raises a warning to watch out for
```mdx theme={null}
This raises a warning to watch out for
```
This draws attention to important information
```mdx theme={null}
This draws attention to important information
```
This suggests a helpful tip
```mdx theme={null}
This suggests a helpful tip
```
This brings us a checked status
```mdx theme={null}
This brings us a checked status
```
This is a danger callout
```mdx theme={null}
This is a danger callout
```
This is a custom callout
```mdx wrap theme={null}
This is a custom callout
```
# Cards
Source: https://mintlify-docs.mintlify.app/components/cards
Highlight main points or links with customizable layouts and icons.
Use cards to create visual containers for content. Cards are flexible containers that can include text, icons, images, and links.
## Basic card
This is how you use a card with an icon and a link. Clicking on this card
brings you to the Columns page.
```mdx Card example theme={null}
This is how you use a card with an icon and a link. Clicking on this card
brings you to the Columns page.
```
## Card variations
Cards support several layout and styling options to fit different content needs.
### Horizontal layout
Add the `horizontal` property to display cards in a more compact, horizontal layout.
This is an example of a horizontal card.
```mdx Horizontal card example theme={null}
This is an example of a horizontal card.
```
### Image cards
Add an `img` property to display an image at the top of the card.
This is an example of a card with an image.
```mdx Image card example theme={null}
This is an example of a card with an image.
```
### Link cards with custom CTAs
You can customize the call-to-action text and control whether an arrow appears. By default, arrows only show for external links.
This is an example of a card with an icon and a link. Clicking on this card brings you to the Columns page.
```mdx Link card example theme={null}
This is an example of a card with an icon and a link. Clicking on this card brings you to the Columns page.
```
## Group cards
Use the [Columns component](/components/columns) to organize multiple cards side by side. The Columns component supports one to four columns and automatically adjusts for smaller screens.
This is the first card.
This is the second card.
```mdx Columns example theme={null}
This is the first card.
This is the second card.
```
## Properties
The title displayed on the card
The icon to display.
Options:
* [Font Awesome](https://fontawesome.com/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `fontawesome` in your `docs.json`
* [Lucide](https://lucide.dev/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `lucide` in your `docs.json`
* [Tabler](https://tabler.io/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `tabler` in your `docs.json`
* URL to an externally hosted icon
* Path to an icon file in your project
* SVG code wrapped in curly braces
For custom SVG icons:
1. Convert your SVG using the [SVGR converter](https://react-svgr.com/playground/).
2. Paste your SVG code into the SVG input field.
3. Copy the complete `` element from the JSX output field.
4. Wrap the JSX-compatible SVG code in curly braces: `icon={}`.
5. Adjust `height` and `width` as needed.
The [Font Awesome](https://fontawesome.com/icons) icon style. Only used with Font Awesome icons.
Options: `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`.
Icon color as a hex code (for example, `#FF6B6B`).
URL to navigate to when the card is clicked.
Display the card in a compact horizontal layout.
URL or local path to an image displayed at the top of the card.
Custom text for the action button.
Show or hide the link arrow icon.
# Code groups
Source: https://mintlify-docs.mintlify.app/components/code-groups
Display multiple code examples in one component
Use the `CodeGroup` component to display multiple code blocks in a tabbed interface, allowing users to compare implementations across different programming languages or see alternative approaches for the same task.
```javascript helloWorld.js theme={null}
console.log("Hello World");
```
```python hello_world.py theme={null}
print('Hello World!')
```
```java HelloWorld.java theme={null}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
Code groups inherit global styling from your `docs.json` file. Customize your theme using `styling.codeblocks`. See [Settings](/organize/settings#param-styling) for configuration options.
Code groups automatically synchronize with other code groups and [tabs](/components/tabs) on the same page when their labels match. When you select a language in one code group, all tabs and code groups with matching labels update to show the same language.
## Create code groups
To create a code group, wrap multiple code blocks with `` tags. Each code block must include a title, which becomes the tab label.
````mdx theme={null}
```javascript helloWorld.js
console.log("Hello World");
```
```python hello_world.py
print('Hello World!')
```
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
## Language dropdown
You can replace the tabs in a code group with a dropdown menu to toggle between languages using the `dropdown` prop.
```javascript helloWorld.js theme={null}
console.log("Hello World");
```
```python hello_world.py theme={null}
print('Hello World!')
```
```java HelloWorld.java theme={null}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````mdx highlight=1 theme={null}
```javascript helloWorld.js
console.log("Hello World");
```
```python hello_world.py
print('Hello World!')
```
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
# Fields
Source: https://mintlify-docs.mintlify.app/components/fields
Document API request and response parameters with type information.
Use fields to document API parameters and responses. There are two types of fields: parameter fields and response fields.
## Parameter field
The `` component is used to define parameters for your APIs or SDKs. Adding a `ParamField` automatically adds an [API Playground](/api-playground/overview).
An example of a parameter field
```mdx theme={null}
An example of a parameter field
```
### Properties
Whether the parameter is a query, path, body, or header. Followed by the
parameter name.
Expected type of the parameter's value.
Supports `number`, `string`, `boolean`, `object`.
Arrays can be defined using the `[]` suffix. For example `string[]`.
Indicate whether the parameter is required.
Indicate whether the parameter is deprecated.
Default value populated when the request value is empty
Placeholder text for the input in the playground.
Description of the parameter (Markdown-enabled).
## Response field
The `` component defines the return values of an API.
An example of a response field
```mdx theme={null}
A response field example
```
### Properties
The name of the response value.
Expected type of the response value. This can be any arbitrary string.
The default value.
Indicate whether the response is required.
Whether a field is deprecated.
Labels that are shown before the name of the field.
Labels that are shown after the name of the field.
# Frames
Source: https://mintlify-docs.mintlify.app/components/frames
Add visual emphasis with styled frames around images and other components.
Use frames to display images, diagrams, or other visual content with consistent styling and optional captions. Frames center content and provide visual separation from surrounding text.
## Captions
Add additional context to an image using the optional `caption` prop. Captions appear in the frame below the image.
### Markdown in captions
Captions support markdown formatting, including links and bold text.
## Hints
Add text that precedes the frame using the optional `hint` prop. Hints appear above the frame.
## Properties
Text that appears as part of the frame, centered below the content. Supports markdown formatting including links and bold text.
Text that precedes the frame.
```mdx Frame theme={null}
```
```mdx Frame with a caption theme={null}
```
```mdx Frame with markdown in caption theme={null}
```
```mdx Frame with bold text and links in caption theme={null}
```
```mdx Frame with a hint theme={null}
```
```mdx Frame with both hint and caption theme={null}
```
# Icons
Source: https://mintlify-docs.mintlify.app/components/icons
Use icons from popular libraries, external URLs, or files in your project.
Use icons from Font Awesome, Lucide, Tabler, SVGs, external URLs, or files in your project to enhance your documentation.
```mdx Icon example theme={null}
```
## Inline icons
Icons are placed inline when used within a sentence, paragraph, or heading. Use icons for decoration or to add visual emphasis.
```markdown Inline icon example theme={null}
Icons are placed inline when used within a sentence, paragraph, or heading. Use icons for decoration or to add visual emphasis.
```
## Properties
The icon to display.
Options:
* [Font Awesome icon](https://fontawesome.com/icons) name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `fontawesome` in your `docs.json`
* [Lucide icon](https://lucide.dev/icons) name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `lucide` in your `docs.json`
* [Tabler icon](https://tabler.io/icons) name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `tabler` in your `docs.json`
* URL to an externally hosted icon
* Path to an icon file in your project
The [Font Awesome](https://fontawesome.com/icons) icon style. Only used with Font Awesome icons.
Options: `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`.
The color of the icon as a hex code (for example, `#FF5733`).
The size of the icon in pixels.
Custom CSS class name to apply to the icon.
# Overview
Source: https://mintlify-docs.mintlify.app/components/index
Component library for layout, emphasis, API documentation, and navigation.
Mintlify provides built-in MDX components for your documentation pages. Use these components to structure content, draw attention to important information, document APIs, and guide navigation.
## Structure your content
Organize related content into switchable tabbed views.
Display code examples in multiple languages.
Display sequential instructions in a numbered format.
Arrange content side by side in responsive layouts.
Create sidebar panels for supplementary content.
## Draw attention
Emphasize important information with styled alerts.
Display prominent announcements at the top of pages.
Add inline labels and status indicators.
Highlight new or updated content.
Add borders and styling to images and content.
Display additional information on hover.
## Showcase AI prompts
Display copyable AI prompts with Cursor integration.
## Show and hide content
Expandable sections for progressive disclosure of content.
Show and hide detailed content on demand.
Conditionally show content based on context.
## Document your API
Display parameter and property definitions.
Document API response structures and fields.
Show request and response examples side by side.
## Link to other pages
Highlight content with customizable containers and icons.
Display content in a grid of clickable tiles.
## Add visual context
Add visual indicators using the Lucide icon library.
Create flowcharts, sequence diagrams, and more.
Display color swatches with hex values.
# Response fields
Source: https://mintlify-docs.mintlify.app/components/responses
Display API response values.
The `` component is designed to define the return values of an API. Many docs also use `` on pages when you need to list the types of something.
A response field example
```mdx theme={null}
A response field example
```
## Props
The name of the response value.
Expected type of the response value - this can be any arbitrary string.
The default value.
Show "required" beside the field name.
Whether a field is deprecated or not.
Labels that are shown before the name of the field
Labels that are shown after the name of the field
```mdx Response Field Example theme={null}
A response field example
```
# Steps
Source: https://mintlify-docs.mintlify.app/components/steps
Create numbered step-by-step procedures.
Use steps to display a series of sequential actions or events. You can add as many steps as needed.
These are instructions or content that only pertain to the first step.
These are instructions or content that only pertain to the second step.
These are instructions or content that only pertain to the third step.
```mdx Steps example theme={null}
These are instructions or content that only pertain to the first step.
These are instructions or content that only pertain to the second step.
These are instructions or content that only pertain to the third step.
```
## Steps properties
A list of `Step` components.
The size of the step titles. One of `p`, `h2`, and `h3`.
## Individual step properties
The content of a step either as plain text or components.
The icon to display.
Options:
* [Font Awesome](https://fontawesome.com/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `fontawesome` in your `docs.json`
* [Lucide](https://lucide.dev/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `lucide` in your `docs.json`
* [Tabler](https://tabler.io/icons) icon name, if you have the `icons.library` [property](/organize/settings#param-icons) set to `tabler` in your `docs.json`
* URL to an externally hosted icon
* Path to an icon file in your project
* SVG code wrapped in curly braces
For custom SVG icons:
1. Convert your SVG using the [SVGR converter](https://react-svgr.com/playground/).
2. Paste your SVG code into the SVG input field.
3. Copy the complete `` element from the JSX output field.
4. Wrap the JSX-compatible SVG code in curly braces: `icon={}`.
5. Adjust `height` and `width` as needed.
The [Font Awesome](https://fontawesome.com/icons) icon style. Only used with Font Awesome icons.
Options: `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`.
The title is the primary text for the step and shows up next to the indicator.
The number of the step.
The size of the step titles. One of `p`, `h2`, and `h3`.
# Tabs
Source: https://mintlify-docs.mintlify.app/components/tabs
Organize content with tabs to show different options or versions.
Use tabs to organize content into multiple panels that users can switch between. You can add any number of tabs and include other components inside each tab.
☝️ Welcome to the content that you can only see inside the first tab.
You can add any number of components inside of tabs. For example, a code block:
```java HelloWorld.java theme={null}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
✌️ Here's content that's only inside the second tab.
This one has a icon!
💪 Here's content that's only inside the third tab.
````mdx Tabs example theme={null}
☝️ Welcome to the content that you can only see inside the first tab.
You can add any number of components inside of tabs. For example, a code block:
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
✌️ Here's content that's only inside the second tab.
This one has a icon!
💪 Here's content that's only inside the third tab.
````
Tabs with matching titles stay in sync across the page. For example, if you have multiple tab groups that include a `JavaScript` tab title, selecting `JavaScript` in one tab group automatically selects `JavaScript` in the others. This helps users who choose a language or framework once see that choice reflected everywhere. Tabs also sync with [code groups](/components/code-groups) that have matching titles.
To disable tab synchronization, add `sync={false}` to a `` component.
```mdx Disable tab sync example theme={null}
This tab group operates independently.
Selecting tabs here won't affect other tab groups.
```
## Properties
The title of the tab. Short titles are easier to navigate. Tabs with matching titles synchronize their selections.
A [Font Awesome](https://fontawesome.com/icons) icon, [Lucide](https://lucide.dev/icons) icon, URL to an icon, or relative path to an icon.
For Font Awesome icons only: One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`.
When `true`, tabs synchronize with other tabs and code groups on the page that have matching titles. Set to `false` to make tabs independent.
Adds a bottom border and padding to the tabs container. Useful to visually separate tabbed content from the rest of the page, especially when tabs contain content of varying lengths.
# Changelogs
Source: https://mintlify-docs.mintlify.app/create/changelogs
Create product changelogs with RSS feed support for subscribers.
Create a changelog for your docs by adding [Update components](/components/update) to a page.
Check out the [Mintlify changelog](/changelog) as an example: you can include links, images, text, and demos of your new features in each update.
## Setting up your changelog
1. Create a new page in your docs such as `changelog.mdx` or `updates.mdx`.
2. Add your changelog page to your navigation scheme in your `docs.json`.
Add an `Update` for each changelog entry.
Include relevant information like feature releases, bug fixes, or other announcements.
```mdx Example changelog.mdx theme={null}
---
title: "Changelog"
description: "Product updates and announcements"
---
Added a new Wintergreen flavor.
Released a new version of the Spearmint flavor, now with 10% more mint.
Released a new version of the Spearmint flavor.
```
## Customizing your changelog
Control how people navigate your changelog and stay up to date with your product information.
### Table of contents
Each `label` property for an `Update` automatically creates an entry in the right sidebar's table of contents. This is the default navigation for your changelog.
### Tag filters
Add `tags` to your `Update` components to replace the table of contents with tag filters. Users can filter the changelog by selecting one or more tags:
```mdx Tag filters example wrap theme={null}
Added a new Wintergreen flavor.
Released a new version of the Spearmint flavor, now with 10% more mint.
Released a new version of the Spearmint flavor.
Deprecated the Peppermint flavor.
Released a new version of the Spearmint flavor.
```
The table of contents and changelog filters are hidden when using `custom`, `center`, or `wide` page modes. Learn more about [page modes](/organize/pages#page-mode).
### Subscribable changelogs
RSS feeds are only available on public documentation.
Use `Update` components to create a subscribable RSS feed at your page URL with `/rss.xml` appended. For example, `mintlify.com/docs/changelog/rss.xml`.
The RSS feed publishes entries when you add new `Update` components and when modify headings inside of existing `Update` components.
RSS feed entries contain pure Markdown only. Components, code, and HTML elements are excluded. Use the `rss` property to provide alternative text descriptions for RSS subscribers when your updates include content that is excluded.
```xml Example RSS feed theme={null}
https://mintlify.com/docs
RSS for NodeMon, 21 Jul 2025 21:21:47 GMThttps://mintlify.com/docs
https://mintlify.com/docs/changelog#june-2025
https://mintlify.com/docs/changelog#june-2025Mon, 23 Jun 2025 16:54:22 GMT
```
RSS feeds can integrate with Slack, email, or other subscription tools to notify users of product changes. Some options include:
* [Slack](https://slack.com/help/articles/218688467-Add-RSS-feeds-to-Slack)
* [Email](https://zapier.com/apps/email/integrations/rss/1441/send-new-rss-feed-entries-via-email) via Zapier
* Discord bots like [Readybot](https://readybot.io) or [RSS Feeds to Discord Bot](https://rss.app/en/bots/rssfeeds-discord-bot)
To make the RSS feed discoverable, you can display an RSS icon button that links to the feed at the top of the page. Add `rss: true` to the page frontmatter:
```mdx theme={null}
---
rss: true
---
```
# Format code
Source: https://mintlify-docs.mintlify.app/create/code
Display and style inline code and code blocks.
## Adding code samples
You can add inline code snippets or code blocks. Code blocks support meta options for syntax highlighting, titles, line highlighting, icons, and more.
### Inline code
To denote a `word` or `phrase` as code, enclose it in backticks (\`).
```mdx theme={null}
To denote a `word` or `phrase` as code, enclose it in backticks (`).
```
### Code blocks
Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks. Code blocks are copyable, and if you have the assistant enabled, users can ask AI to explain the code.
Specify the programming language for syntax highlighting and to enable meta options. Add any meta options, like a title or icon, after the language.
```java HelloWorld.java example icon=java lines theme={null}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````mdx Format theme={null}
```java HelloWorld.java example lines icon="java"
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
## Code block options
Add meta options to your code blocks to customize their appearance.
You must specify a programming language for a code block before adding any other meta options.
### Option syntax
* **String and boolean options**: Wrap with `""`, `''`, or no quotes.
* **Expression options**: Wrap with `{}`, `""`, or `''`.
### Syntax highlighting
Enable syntax highlighting by specifying the programming language after the opening backticks of a code block.
We use [Shiki](https://shiki.style/) for syntax highlighting and support all available languages. See the full list of [languages](https://shiki.style/languages) in Shiki's documentation.
Customize code block themes globally using `styling.codeblocks` in your `docs.json` file. Set simple themes like `system` or `dark`, or configure custom [Shiki themes](https://shiki.style/themes) for light and dark modes. See [Settings](/organize/settings#param-styling) for configuration options.
```java Syntax highlighting example theme={null}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````mdx Format theme={null}
```java Syntax highlighting example
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
For custom themes, set your theme in `docs.json` to `"css-variables"` and override syntax highlighting colors using CSS variables with the `--mint-` prefix.
The following variables are available:
**Basic colors**
* `--mint-color-text`: Default text color
* `--mint-color-background`: Background color
**Token colors**
* `--mint-token-constant`: Constants and literals
* `--mint-token-string`: String values
* `--mint-token-comment`: Comments
* `--mint-token-keyword`: Keywords
* `--mint-token-parameter`: Function parameters
* `--mint-token-function`: Function names
* `--mint-token-string-expression`: String expressions
* `--mint-token-punctuation`: Punctuation marks
* `--mint-token-link`: Links
**ANSI colors**
* `--mint-ansi-black`, `--mint-ansi-black-dim`
* `--mint-ansi-red`, `--mint-ansi-red-dim`
* `--mint-ansi-green`, `--mint-ansi-green-dim`
* `--mint-ansi-yellow`, `--mint-ansi-yellow-dim`
* `--mint-ansi-blue`, `--mint-ansi-blue-dim`
* `--mint-ansi-magenta`, `--mint-ansi-magenta-dim`
* `--mint-ansi-cyan`, `--mint-ansi-cyan-dim`
* `--mint-ansi-white`, `--mint-ansi-white-dim`
* `--mint-ansi-bright-black`, `--mint-ansi-bright-black-dim`
* `--mint-ansi-bright-red`, `--mint-ansi-bright-red-dim`
* `--mint-ansi-bright-green`, `--mint-ansi-bright-green-dim`
* `--mint-ansi-bright-yellow`, `--mint-ansi-bright-yellow-dim`
* `--mint-ansi-bright-blue`, `--mint-ansi-bright-blue-dim`
* `--mint-ansi-bright-magenta`, `--mint-ansi-bright-magenta-dim`
* `--mint-ansi-bright-cyan`, `--mint-ansi-bright-cyan-dim`
* `--mint-ansi-bright-white`, `--mint-ansi-bright-white-dim`
**Custom syntax highlighting**
Add syntax highlighting for languages not included in Shiki's default set by providing custom TextMate grammar files. Create a JSON file following the [TextMate grammar format](https://macromates.com/manual/en/language_grammars), then reference it in your `docs.json`. You can add multiple custom languages by including additional paths in the array.
```json docs.json theme={null}
{
"styling": {
"codeblocks": {
"languages": {
"custom": ["/languages/my-custom-language.json"]
}
}
}
}
```
### Twoslash
In JavaScript and TypeScript code blocks, use `twoslash` to enable interactive type information. Users can hover over variables, functions, and parameters to see types and errors like in an IDE.
```ts twoslash Twoslash example theme={null}
type Pet = "cat" | "dog" | "hamster";
function adoptPet(name: string, type: Pet) {
return `${name} the ${type} is now adopted!`;
}
// Hover to see the inferred types
const message = adoptPet("Mintie", "cat");
```
````mdx Format theme={null}
```ts twoslash Twoslash example
type Pet = "cat" | "dog" | "hamster";
function adoptPet(name: string, type: Pet) {
return `${name} the ${type} is now adopted!`;
}
// Hover to see the inferred types
const message = adoptPet("Mintie", "cat");
```
````
### Title
Add a title to label your code example. Use `title="Your title"` or a string on a single line.
```javascript Title example theme={null}
const hello = "world";
```
````mdx Format theme={null}
```javascript Title example
const hello = "world";
```
````
### Icon
Add an icon to your code block using the `icon` property. See [Icons](/components/icons) for all available options.
```javascript Icon example icon=square-js theme={null}
const hello = "world";
```
````mdx Format theme={null}
```javascript Icon example icon="square-js"
const hello = "world";
```
````
### Line highlighting
Highlight specific lines in your code blocks using `highlight` with the line numbers or ranges you want to highlight.
```javascript Line highlighting example {1,2,5} theme={null}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````mdx Format theme={null}
```javascript Line highlighting example highlight={1-2,5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````
### Line focusing
Focus on specific lines in your code blocks using `focus` with line numbers or ranges.
```javascript Line focusing example focus=2,4,5 theme={null}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````mdx Format theme={null}
```javascript Line focusing example focus={2,4-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````
### Show line numbers
Display line numbers on the left side of your code block using `lines`.
```javascript Show line numbers example lines theme={null}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````mdx Format theme={null}
```javascript Show line numbers example lines
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````
### Expandable
Allow users to expand and collapse long code blocks using `expandable`.
```python Expandable example expandable theme={null}
from datetime import datetime, timedelta
from typing import Dict, List, Optional
from dataclasses import dataclass
@dataclass
class Book:
title: str
author: str
isbn: str
checked_out: bool = False
due_date: Optional[datetime] = None
class Library:
def __init__(self):
self.books: Dict[str, Book] = {}
self.checkouts: Dict[str, List[str]] = {} # patron -> list of ISBNs
def add_book(self, book: Book) -> None:
if book.isbn in self.books:
raise ValueError(f"Book with ISBN {book.isbn} already exists")
self.books[book.isbn] = book
def checkout_book(self, isbn: str, patron: str, days: int = 14) -> None:
if patron not in self.checkouts:
self.checkouts[patron] = []
book = self.books.get(isbn)
if not book:
raise ValueError("Book not found")
if book.checked_out:
raise ValueError("Book is already checked out")
if len(self.checkouts[patron]) >= 3:
raise ValueError("Patron has reached checkout limit")
book.checked_out = True
book.due_date = datetime.now() + timedelta(days=days)
self.checkouts[patron].append(isbn)
def return_book(self, isbn: str) -> float:
book = self.books.get(isbn)
if not book or not book.checked_out:
raise ValueError("Book not found or not checked out")
late_fee = 0.0
if datetime.now() > book.due_date:
days_late = (datetime.now() - book.due_date).days
late_fee = days_late * 0.50
book.checked_out = False
book.due_date = None
# Remove from patron's checkouts
for patron, books in self.checkouts.items():
if isbn in books:
books.remove(isbn)
break
return late_fee
def search(self, query: str) -> List[Book]:
query = query.lower()
return [
book for book in self.books.values()
if query in book.title.lower() or query in book.author.lower()
]
def main():
library = Library()
# Add some books
books = [
Book("The Hobbit", "J.R.R. Tolkien", "978-0-261-10295-4"),
Book("1984", "George Orwell", "978-0-452-28423-4"),
]
for book in books:
library.add_book(book)
# Checkout and return example
library.checkout_book("978-0-261-10295-4", "patron123")
late_fee = library.return_book("978-0-261-10295-4")
print(f"Late fee: ${late_fee:.2f}")
if __name__ == "__main__":
main()
```
````text Format theme={null}
```python Expandable example expandable
from datetime import datetime, timedelta
from typing import Dict, List, Optional
from dataclasses import dataclass
# ...
if __name__ == "__main__":
main()
```
````
### Wrap
Enable text wrapping for long lines using `wrap`. This prevents horizontal scrolling and makes long lines easier to read.
```javascript Wrap example wrap theme={null}
const greeting =
"Hello, World! I am a long line of text that will wrap to the next line.";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````mdx Format theme={null}
```javascript Wrap example wrap
const greeting =
"Hello, World! I am a long line of text that will wrap to the next line.";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````
### Diff
Show a visual diff of added or removed lines in your code blocks. Added lines are highlighted in green and removed lines are highlighted in red.
To create diffs, add these special comments at the end of lines in your code block:
* `// [!code ++]`: Mark a line as added (green highlight).
* `// [!code --]`: Mark a line as removed (red highlight).
For multiple consecutive lines, specify the number of lines after a colon:
* `// [!code ++:3]`: Mark the current line plus the next two lines as added.
* `// [!code --:5]`: Mark the current line plus the next four lines as removed.
The comment syntax must match your programming language (for example, `//` for JavaScript or `#` for Python).
```js Diff example lines theme={null}
const greeting = "Hello, World!"; // [!code ++]
function sayHello() {
console.log("Hello, World!"); // [!code --]
console.log(greeting); // [!code ++]
}
sayHello();
```
````text Format theme={null}
```js Diff example lines
const greeting = "Hello, World!"; // [!code ++]
function sayHello() {
console.log("Hello, World!"); // [!code --]
console.log(greeting); // [!code ++]
}
sayHello();
```
````
## CodeBlock component
Use the `` component in custom React components to programmatically render code blocks with the same styling and features as markdown code blocks.
### Props
The programming language for syntax highlighting.
The filename to display in the code block header.
The icon to display in the code block header. See [Icons](/components/icons)
for available options.
Whether to show line numbers.
Whether to wrap the code block.
Whether to expand the code block.
The lines to highlight. Provide a stringified array of numbers. Example:
`"[1,3,4,5]"`.
The lines to focus on. Provide a stringified array of numbers. Example:
`"[1,3,4,5]"`.
### Example
```jsx theme={null}
export const CustomCodeBlock = ({
filename,
icon,
language,
highlight,
children,
}) => {
return (
{children}
);
};
```
# Images and embeds
Source: https://mintlify-docs.mintlify.app/create/image-embeds
Add images, videos, and iframes.
Add images, embed videos, and include interactive content with iframes to your documentation.
## Images
Add images to provide visual context, examples, or decoration to your documentation.
### Basic image syntax
Use [Markdown syntax](https://www.markdownguide.org/basic-syntax/#images) to add images to your documentation:
```mdx theme={null}

```
Always include descriptive alt text to improve accessibility and SEO. The alt text should clearly describe what the image shows.
Image files must be less than 20 MB. For larger files, host them on a CDN service like [Amazon S3](https://aws.amazon.com/s3) or [Cloudinary](https://cloudinary.com).
### HTML image embeds
For more control over image display, use HTML `` tags:
```jsx theme={null}
```
#### Resize images with inline styles
Use JSX inline styles with the `style` attribute to resize images:
```jsx theme={null}
```
#### Disable image zoom
To disable the default zoom on click for images, add the `noZoom` property:
```html highlight="4" theme={null}
```
#### Link images
To make an image a clickable link, wrap the image in an anchor tag and add the `noZoom` property:
```html theme={null}
```
Images within anchor tags automatically display a pointer cursor to indicate they are clickable.
#### Light and dark mode images
To display different images for light and dark themes, use Tailwind CSS classes:
```html theme={null}
```
### SVG images
SVG files that use `foreignObject` elements render differently in production than in local development. Mintlify's image CDN strips `foreignObject` from SVGs as a security measure, which can truncate or hide text and other embedded HTML content.
This commonly affects SVGs exported from tools like [draw.io](https://www.drawio.com) that have HTML text formatting or word wrap turned on. To fix this, disable **Formatted Text** and **Word Wrap** on all labels in your diagram before exporting to SVG. See the [draw.io documentation](https://www.drawio.com/doc/faq/svg-export-text-problems) for more information on SVG exports.
## Videos
Mintlify supports [HTML tags in Markdown](https://www.markdownguide.org/basic-syntax/#html), giving you flexibility to create rich content.
Always include fallback text content within video elements for browsers that don't support video playback.
### YouTube embeds
Embed YouTube videos using iframe elements:
```html theme={null}
```
### Self-hosted videos
Use the HTML `