Skip to content

Commit dfb51cb

Browse files
authored
Add search endpoint (#987)
* Use sentence case for endpoints * add search endpoint * add link to search in API intro * rename `/chat` to `/assistant` * make it more clear which keys are for which endpoints * remove redundant security
1 parent 1a35928 commit dfb51cb

File tree

8 files changed

+103
-9
lines changed

8 files changed

+103
-9
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

api-reference/assistant/search.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
openapi: "POST /search/{domain}"
3+
---

api-reference/introduction.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,24 @@ The Mintlify REST API enables you to programmatically interact with your documen
88

99
## Endpoints
1010

11-
- [Trigger Update](/api-reference/update/trigger): Trigger an update of your site when desired.
12-
- [Get Update Status](/api-reference/update/status): Get the status of an update and other details about your docs.
13-
- [Generate Assistant Message](/api-reference/chat/create-assistant-message): Embed the assistant, trained on your docs, into any application of your choosing.
11+
- [Trigger update](/api-reference/update/trigger): Trigger an update of your site when desired.
12+
- [Get update status](/api-reference/update/status): Get the status of an update and other details about your docs.
13+
- [Generate assistant message](/api-reference/assistant/create-assistant-message): Embed the assistant, trained on your docs, into any application of your choosing.
14+
- [Search documentation](/api-reference/assistant/search): Search through your documentation.
1415

1516
## Authentication
1617

1718
You can generate an API key through [the dashboard](https://dashboard.mintlify.com/settings/organization/api-keys). API keys are associated with an entire organization and can be used across multiple deployments.
1819

1920
### Admin API key
2021

21-
The admin API key is used for the majority of the API. It is used to trigger updates and get update status.
22+
The admin API key is used for the [Trigger update](/api-reference/update/trigger) and [Get update status](/api-reference/update/status) endpoints.
2223

2324
Admin API keys begin with the `mint_` prefix. Keep your admin API keys secret.
2425

2526
### Assistant API key
2627

27-
The assistant API key is used for generating assistant chat messages through the API. Responses include citations so you can point your users to the right destinations for more information.
28+
The assistant API key is used for the [Generate assistant message](/api-reference/assistant/create-assistant-message) and [Search documentation](/api-reference/assistant/search) endpoints.
2829

2930
Assistant API keys begin with the `mint_dsc_` prefix.
3031

discovery-openapi.json

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"x-mcp": {
2222
"enabled": true
2323
},
24-
"summary": "Generate Assistant Message",
24+
"summary": "Generate assistant message",
2525
"description": "Generates a response message from the assistant for the specified domain. 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. You can set `fp`, `threadId`, and `filter` in the `body` field of the options parameter passed to the hook.",
2626
"parameters": [
2727
{
@@ -498,6 +498,91 @@
498498
}
499499
}
500500
}
501+
},
502+
"/search/{domain}": {
503+
"post": {
504+
"x-mcp": {
505+
"enabled": true
506+
},
507+
"summary": "Search documentation",
508+
"description": "Perform semantic and keyword searches across your documentation with configurable filtering and pagination.",
509+
"parameters": [
510+
{
511+
"name": "domain",
512+
"in": "path",
513+
"required": true,
514+
"schema": {
515+
"type": "string"
516+
},
517+
"description": "The domain identifier from your `domain.mintlify.app` URL. Can be found in the top left of your dashboard."
518+
}
519+
],
520+
"requestBody": {
521+
"required": true,
522+
"content": {
523+
"application/json": {
524+
"schema": {
525+
"type": "object",
526+
"required": ["query"],
527+
"properties": {
528+
"query": {
529+
"type": "string",
530+
"description": "The search query to execute against your documentation content."
531+
},
532+
"pageSize": {
533+
"type": "number",
534+
"default": 10,
535+
"description": "Number of search results to return. Defaults to 10 if not specified."
536+
},
537+
"filter": {
538+
"type": "object",
539+
"description": "Optional filtering parameters to narrow search results.",
540+
"properties": {
541+
"version": {
542+
"type": "string",
543+
"description": "Filter results by documentation version."
544+
},
545+
"language": {
546+
"type": "string",
547+
"description": "Filter results by content language."
548+
}
549+
}
550+
}
551+
}
552+
}
553+
}
554+
}
555+
},
556+
"responses": {
557+
"200": {
558+
"description": "Search results",
559+
"content": {
560+
"application/json": {
561+
"schema": {
562+
"type": "array",
563+
"items": {
564+
"type": "object",
565+
"properties": {
566+
"content": {
567+
"type": "string",
568+
"description": "The matching content from your documentation."
569+
},
570+
"path": {
571+
"type": "string",
572+
"description": "The path or URL to the source document."
573+
},
574+
"metadata": {
575+
"type": "object",
576+
"description": "Additional metadata about the search result, including relevance scoring and other contextual information."
577+
}
578+
}
579+
}
580+
}
581+
}
582+
}
583+
}
584+
}
585+
}
501586
}
502587
},
503588
"components": {

docs.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@
239239
{
240240
"group": "Assistant",
241241
"pages": [
242-
"api-reference/chat/create-assistant-message"
242+
"api-reference/assistant/create-assistant-message",
243+
"api-reference/assistant/search"
243244
]
244245
}
245246
]
@@ -493,6 +494,10 @@
493494
{
494495
"source": "ai-ingestion",
495496
"destination": "ai/llmstxt"
497+
},
498+
{
499+
"source": "api-reference/chat/*",
500+
"destination": "api-reference/assistant/*"
496501
}
497502
],
498503
"integrations": {

openapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"paths": {
2222
"/project/update/{projectId}": {
2323
"post": {
24-
"summary": "Trigger Update",
24+
"summary": "Trigger update",
2525
"description": "Trigger an update after updating your OpenAPI document by calling this endpoint in a CI check",
2626
"parameters": [
2727
{
@@ -56,7 +56,7 @@
5656
},
5757
"/project/update-status/{statusId}": {
5858
"get": {
59-
"summary": "Get Update Status",
59+
"summary": "Get update status",
6060
"description": "Get the status of an update from the status ID",
6161
"parameters": [
6262
{

0 commit comments

Comments
 (0)