diff --git a/api/introduction.mdx b/api/introduction.mdx index a3602ae23..4ce71208c 100644 --- a/api/introduction.mdx +++ b/api/introduction.mdx @@ -10,6 +10,7 @@ The Mintlify REST (Representational State Transfer) API enables you to programma - [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. +- [Trigger preview deployment](/api/preview/trigger): Create or rebuild a preview deployment for a specific branch. - [Create agent job](/api/agent/v2/create-agent-job): Create an agent job to automatically edit your documentation. - [Get agent job](/api/agent/v2/get-agent-job): Retrieve the details and status of a specific agent job. - [Send follow-up message](/api/agent/v2/send-message): Send a follow-up message to an existing agent job. @@ -28,6 +29,7 @@ The Mintlify REST (Representational State Transfer) API enables you to programma - **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). +- **Preview deployments**: Programmatically create preview deployments for branches in your CI/CD pipeline with [Trigger preview deployment](/api/preview/trigger). - **Custom integrations**: Embed the AI assistant into your product, support portal, or internal tools with [Create assistant message](/api/assistant/create-assistant-message-v2), [Search documentation](/api/assistant/search), and [Get page content](/api/assistant/get-page-content). - **Automated editing**: Use agent jobs to programmatically update documentation at scale with [Create agent job](/api/agent/v2/create-agent-job), [Get agent job](/api/agent/v2/get-agent-job), and [Send follow-up message](/api/agent/v2/send-message). - **Analytics export**: Export feedback, assistant conversations, search analytics, page views, and visitor data for external analysis with [Get user feedback](/api/analytics/feedback), [Get feedback by page](/api/analytics/feedback-by-page), [Get assistant conversations](/api/analytics/assistant-conversations), [Get assistant caller stats](/api/analytics/assistant-caller-stats), [Get search queries](/api/analytics/searches), [Get page views](/api/analytics/views), and [Get unique visitors](/api/analytics/visitors). @@ -40,7 +42,7 @@ 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/v2/create-agent-job), [Get agent job](/api/agent/v2/get-agent-job), [Send follow-up message](/api/agent/v2/send-message), [Get user feedback](/api/analytics/feedback), [Get feedback by page](/api/analytics/feedback-by-page), [Get assistant conversations](/api/analytics/assistant-conversations), [Get assistant caller stats](/api/analytics/assistant-caller-stats), [Get search queries](/api/analytics/searches), [Get page views](/api/analytics/views), and [Get unique visitors](/api/analytics/visitors). +Use the admin API key to authenticate requests to [Trigger update](/api/update/trigger), [Get update status](/api/update/status), [Trigger preview deployment](/api/preview/trigger), [Create agent job](/api/agent/v2/create-agent-job), [Get agent job](/api/agent/v2/get-agent-job), [Send follow-up message](/api/agent/v2/send-message), [Get user feedback](/api/analytics/feedback), [Get feedback by page](/api/analytics/feedback-by-page), [Get assistant conversations](/api/analytics/assistant-conversations), [Get assistant caller stats](/api/analytics/assistant-caller-stats), [Get search queries](/api/analytics/searches), [Get page views](/api/analytics/views), and [Get unique visitors](/api/analytics/visitors). Admin API keys begin with the `mint_` prefix. diff --git a/api/preview/trigger.mdx b/api/preview/trigger.mdx new file mode 100644 index 000000000..32bd8e9b2 --- /dev/null +++ b/api/preview/trigger.mdx @@ -0,0 +1,6 @@ +--- +title: "Trigger preview deployment" +description: "Create or rebuild a preview deployment for a specific branch programmatically." +openapi: "/openapi.json POST /project/preview/{projectId}" +keywords: [ "preview", "deployment", "branch", "programmatic" ] +--- diff --git a/docs.json b/docs.json index b750e4c75..627e84dcc 100644 --- a/docs.json +++ b/docs.json @@ -362,7 +362,8 @@ "icon": "activity", "pages": [ "api/update/trigger", - "api/update/status" + "api/update/status", + "api/preview/trigger" ] }, { @@ -747,7 +748,8 @@ "icon": "activity", "pages": [ "fr/api/update/trigger", - "fr/api/update/status" + "fr/api/update/status", + "fr/api/preview/trigger" ] }, { @@ -1128,7 +1130,8 @@ "icon": "activity", "pages": [ "es/api/update/trigger", - "es/api/update/status" + "es/api/update/status", + "es/api/preview/trigger" ] }, { @@ -1509,7 +1512,8 @@ "icon": "activity", "pages": [ "zh/api/update/trigger", - "zh/api/update/status" + "zh/api/update/status", + "zh/api/preview/trigger" ] }, { diff --git a/es/api/introduction.mdx b/es/api/introduction.mdx index e22343dd6..00fb8a99e 100644 --- a/es/api/introduction.mdx +++ b/es/api/introduction.mdx @@ -12,6 +12,7 @@ La REST (Representational State Transfer) API de Mintlify te permite interactuar * [Trigger update](/es/api/update/trigger): Activa una actualización de tu sitio cuando quieras. * [Get update status](/es/api/update/status): Obtén el estado de una actualización y otros detalles de tu documentación. +* [Trigger preview deployment](/es/api/preview/trigger): Crea o reconstruye un despliegue de vista previa para una rama específica. * [Create agent job](/es/api/agent/v2/create-agent-job): Crea una tarea de agente para editar tu documentación automáticamente. * [Get agent job](/es/api/agent/v2/get-agent-job): Obtén los detalles y el estado de una tarea de agente específica. * [Send follow-up message](/es/api/agent/v2/send-message): Envía un mensaje de seguimiento a una tarea de agente existente. @@ -28,6 +29,7 @@ La REST (Representational State Transfer) API de Mintlify te permite interactuar * **Implementaciones automatizadas**: Activa actualizaciones del sitio a intervalos establecidos o cuando se produzcan eventos con [Trigger update](/es/api/update/trigger) y [Get update status](/es/api/update/status). * **Integración CI/CD**: Actualiza la documentación como parte de tu pipeline de implementación cuando el código cambie con [Trigger update](/es/api/update/trigger). +* **Despliegues de vista previa**: Crea despliegues de vista previa para ramas en tu pipeline CI/CD con [Trigger preview deployment](/es/api/preview/trigger). * **Integraciones personalizadas**: Inserta el Asistente de IA en tu producto, portal de soporte o herramientas internas con [Create assistant message](/es/api/assistant/create-assistant-message-v2), [Search documentation](/es/api/assistant/search) y [Get page content](/es/api/assistant/get-page-content). * **Edición automatizada**: Usa trabajos de agente para actualizar la documentación programáticamente y a escala con [Create agent job](/es/api/agent/v2/create-agent-job), [Get agent job](/es/api/agent/v2/get-agent-job) y [Send follow-up message](/es/api/agent/v2/send-message). * **Exportación de Analytics**: Exporta comentarios, conversaciones del assistant y datos de visitantes para análisis externo con [Get user feedback](/es/api/analytics/feedback), [Get assistant conversations](/es/api/analytics/assistant-conversations) y [Get assistant caller stats](/es/api/analytics/assistant-caller-stats). @@ -44,7 +46,7 @@ Puedes crear hasta 10 API keys por hora y por organización. ### Clave de la API de administrador -Usa la clave de la API de administrador para autenticar solicitudes a [Trigger update](/es/api/update/trigger), [Get update status](/es/api/update/status), [Create agent job](/es/api/agent/v2/create-agent-job), [Get agent job](/es/api/agent/v2/get-agent-job), [Send follow-up message](/es/api/agent/v2/send-message), [Get user feedback](/es/api/analytics/feedback), [Get assistant conversations](/es/api/analytics/assistant-conversations) y [Get assistant caller stats](/es/api/analytics/assistant-caller-stats). +Usa la clave de la API de administrador para autenticar solicitudes a [Trigger update](/es/api/update/trigger), [Get update status](/es/api/update/status), [Trigger preview deployment](/es/api/preview/trigger), [Create agent job](/es/api/agent/v2/create-agent-job), [Get agent job](/es/api/agent/v2/get-agent-job), [Send follow-up message](/es/api/agent/v2/send-message), [Get user feedback](/es/api/analytics/feedback), [Get assistant conversations](/es/api/analytics/assistant-conversations) y [Get assistant caller stats](/es/api/analytics/assistant-caller-stats). Las claves de la API de administrador comienzan con el prefijo `mint_`. diff --git a/es/api/preview/trigger.mdx b/es/api/preview/trigger.mdx new file mode 100644 index 000000000..b37b3a564 --- /dev/null +++ b/es/api/preview/trigger.mdx @@ -0,0 +1,6 @@ +--- +title: "Iniciar despliegue de vista previa" +description: "Crea o reconstruye un despliegue de vista previa para una rama específica de forma programática." +openapi: "/es/openapi.json POST /project/preview/{projectId}" +keywords: [ "vista previa", "despliegue", "rama", "programático" ] +--- diff --git a/es/openapi.json b/es/openapi.json index a130df6b7..0dbfd6d6f 100644 --- a/es/openapi.json +++ b/es/openapi.json @@ -214,6 +214,95 @@ } } } + }, + "/project/preview/{projectId}": { + "post": { + "summary": "Iniciar despliegue de vista previa", + "description": "Crea o reconstruye un despliegue de vista previa para una rama específica. Si ya existe un despliegue de vista previa para la rama dada, lo reutiliza y activa una reconstrucción. Devuelve un ID de estado para consultar el progreso y la URL de vista previa. Requiere el derecho de Preview Deployments.", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "El ID de tu proyecto. Puedes copiarlo de la página de [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) de tu dashboard.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["branch"], + "properties": { + "branch": { + "type": "string", + "description": "El nombre de la rama para la cual crear un despliegue de vista previa.", + "minLength": 1 + } + } + } + } + } + }, + "responses": { + "202": { + "description": "Despliegue de vista previa puesto en cola correctamente", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "statusId": { + "type": "string", + "description": "El ID de estado del despliegue de vista previa activado. Úsalo con el endpoint [Obtener el estado del despliegue](/es/api/update/status) para consultar el progreso." + }, + "previewUrl": { + "type": "string", + "description": "La URL donde se podrá acceder al despliegue de vista previa." + } + } + } + } + } + }, + "400": { + "description": "Cuerpo de solicitud inválido", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "branch is required" + } + } + } + } + } + }, + "403": { + "description": "Los despliegues de vista previa no están disponibles en tu plan actual", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Preview deployments are not available on your current plan." + } + } + } + } + } + } + } + } } }, "components": { diff --git a/fr/api/introduction.mdx b/fr/api/introduction.mdx index 2c64797a6..b954f158d 100644 --- a/fr/api/introduction.mdx +++ b/fr/api/introduction.mdx @@ -12,6 +12,7 @@ L'API REST (Representational State Transfer) de Mintlify vous permet d'interagir * [Trigger update](/fr/api/update/trigger): Déclenchez une mise à jour de votre site quand vous le souhaitez. * [Get update status](/fr/api/update/status): Récupérez le statut d'une mise à jour et d'autres détails sur votre documentation. +* [Trigger preview deployment](/fr/api/preview/trigger): Créez ou reconstruisez un déploiement de prévisualisation pour une branche spécifique. * [Create agent job](/fr/api/agent/v2/create-agent-job): Créez une tâche d'agent pour modifier automatiquement votre documentation. * [Get agent job](/fr/api/agent/v2/get-agent-job): Récupérez les détails et le statut d'une tâche d'agent spécifique. * [Send follow-up message](/fr/api/agent/v2/send-message): Envoyez un message de suivi à une tâche d'agent existante. @@ -28,6 +29,7 @@ L'API REST (Representational State Transfer) de Mintlify vous permet d'interagir * **Déploiements automatisés** : Déclenchez les mises à jour du site à intervalles réguliers ou lorsqu'un événement se produit avec [Trigger update](/fr/api/update/trigger) et [Get update status](/fr/api/update/status). * **Intégration CI/CD** : Mettez à jour la documentation dans le cadre de votre pipeline de déploiement lorsque le code change avec [Trigger update](/fr/api/update/trigger). +* **Déploiements de prévisualisation** : Créez des déploiements de prévisualisation pour des branches dans votre pipeline CI/CD avec [Trigger preview deployment](/fr/api/preview/trigger). * **Intégrations personnalisées** : Intégrez l'Assistant IA à votre produit, portail d'assistance ou outils internes avec [Create assistant message](/fr/api/assistant/create-assistant-message-v2), [Search documentation](/fr/api/assistant/search) et [Get page content](/fr/api/assistant/get-page-content). * **Édition automatisée** : Utilisez des jobs d'agent pour mettre à jour la documentation de manière programmatique et à grande échelle avec [Create agent job](/fr/api/agent/v2/create-agent-job), [Get agent job](/fr/api/agent/v2/get-agent-job), et [Send follow-up message](/fr/api/agent/v2/send-message). * **Export Analytics** : Exportez les retours utilisateurs, les conversations de l'Assistant et les données de visiteurs pour une analyse externe avec [Get user feedback](/fr/api/analytics/feedback), [Get assistant conversations](/fr/api/analytics/assistant-conversations) et [Get assistant caller stats](/fr/api/analytics/assistant-caller-stats). @@ -44,7 +46,7 @@ Vous pouvez créer jusqu'à 10 clés d'API par heure et par organisation. ### Clé d'API administrateur -Utilisez la clé d'API administrateur pour authentifier les requêtes vers [Trigger update](/fr/api/update/trigger), [Get update status](/fr/api/update/status), [Create agent job](/fr/api/agent/v2/create-agent-job), [Get agent job](/fr/api/agent/v2/get-agent-job), [Send follow-up message](/fr/api/agent/v2/send-message), [Get user feedback](/fr/api/analytics/feedback), [Get assistant conversations](/fr/api/analytics/assistant-conversations) et [Get assistant caller stats](/fr/api/analytics/assistant-caller-stats). +Utilisez la clé d'API administrateur pour authentifier les requêtes vers [Trigger update](/fr/api/update/trigger), [Get update status](/fr/api/update/status), [Trigger preview deployment](/fr/api/preview/trigger), [Create agent job](/fr/api/agent/v2/create-agent-job), [Get agent job](/fr/api/agent/v2/get-agent-job), [Send follow-up message](/fr/api/agent/v2/send-message), [Get user feedback](/fr/api/analytics/feedback), [Get assistant conversations](/fr/api/analytics/assistant-conversations) et [Get assistant caller stats](/fr/api/analytics/assistant-caller-stats). Les clés d'API administrateur commencent par le préfixe `mint_`. diff --git a/fr/api/preview/trigger.mdx b/fr/api/preview/trigger.mdx new file mode 100644 index 000000000..e37261257 --- /dev/null +++ b/fr/api/preview/trigger.mdx @@ -0,0 +1,6 @@ +--- +title: "Déclencher un déploiement de prévisualisation" +description: "Créez ou reconstruisez un déploiement de prévisualisation pour une branche spécifique de manière programmatique." +openapi: "/fr/openapi.json POST /project/preview/{projectId}" +keywords: [ "prévisualisation", "déploiement", "branche", "programmatiquement" ] +--- diff --git a/fr/openapi.json b/fr/openapi.json index 90e207123..23e6d93ab 100644 --- a/fr/openapi.json +++ b/fr/openapi.json @@ -214,6 +214,95 @@ } } } + }, + "/project/preview/{projectId}": { + "post": { + "summary": "Déclencher un déploiement de prévisualisation", + "description": "Créez ou reconstruisez un déploiement de prévisualisation pour une branche spécifique. Si un déploiement de prévisualisation existe déjà pour la branche donnée, il est réutilisé et une reconstruction est lancée. Retourne un identifiant de statut pour suivre la progression et l'URL de prévisualisation. Nécessite le droit Preview Deployments.", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "Identifiant de votre projet. Vous pouvez le copier à partir de la page [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) de votre Dashboard.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["branch"], + "properties": { + "branch": { + "type": "string", + "description": "Le nom de la branche pour laquelle créer un déploiement de prévisualisation.", + "minLength": 1 + } + } + } + } + } + }, + "responses": { + "202": { + "description": "Déploiement de prévisualisation mis en file d'attente avec succès", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "statusId": { + "type": "string", + "description": "L'identifiant de statut du déploiement de prévisualisation déclenché. Utilisez-le avec l'endpoint [Obtenir le statut du déploiement](/fr/api/update/status) pour suivre la progression." + }, + "previewUrl": { + "type": "string", + "description": "L'URL à laquelle le déploiement de prévisualisation sera accessible." + } + } + } + } + } + }, + "400": { + "description": "Corps de requête invalide", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "branch is required" + } + } + } + } + } + }, + "403": { + "description": "Les déploiements de prévisualisation ne sont pas disponibles sur votre offre actuelle", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Preview deployments are not available on your current plan." + } + } + } + } + } + } + } + } } }, "components": { diff --git a/openapi.json b/openapi.json index fcd4d140f..f9e37d0be 100644 --- a/openapi.json +++ b/openapi.json @@ -209,6 +209,95 @@ } } } + }, + "/project/preview/{projectId}": { + "post": { + "summary": "Trigger preview deployment", + "description": "Create or rebuild a preview deployment for a specific branch. If a preview deployment already exists for the given branch, it reuses that deployment and triggers a rebuild. Returns a status ID for polling progress and the preview URL. Requires the Preview Deployments entitlement.", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "Your project ID. Can be copied from the [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) page in your dashboard.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["branch"], + "properties": { + "branch": { + "type": "string", + "description": "The name of the branch to create a preview deployment for.", + "minLength": 1 + } + } + } + } + } + }, + "responses": { + "202": { + "description": "Preview deployment queued successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "statusId": { + "type": "string", + "description": "The status ID of the triggered preview deployment. Use this with the [Get deployment status](/api/update/status) endpoint to poll for progress." + }, + "previewUrl": { + "type": "string", + "description": "The URL where the preview deployment will be accessible." + } + } + } + } + } + }, + "400": { + "description": "Invalid request body", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "branch is required" + } + } + } + } + } + }, + "403": { + "description": "Preview deployments not available on your current plan", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Preview deployments are not available on your current plan." + } + } + } + } + } + } + } + } } }, "components": { diff --git a/zh/api/introduction.mdx b/zh/api/introduction.mdx index 593d00ef1..aa924f20f 100644 --- a/zh/api/introduction.mdx +++ b/zh/api/introduction.mdx @@ -12,6 +12,7 @@ Mintlify 的 REST(Representational State Transfer)API 让你可以以编程 * [Trigger update](/zh/api/update/trigger):在需要时触发您站点的更新。 * [Get update status](/zh/api/update/status):获取某次更新的状态以及与您的文档相关的其他详细信息。 +* [Trigger preview deployment](/zh/api/preview/trigger):为指定分支创建或重新构建预览部署。 * [Create agent job](/zh/api/agent/v2/create-agent-job):创建一个代理任务以自动编辑您的文档。 * [Get agent job](/zh/api/agent/v2/get-agent-job):获取特定代理任务的详细信息和状态。 * [Send follow-up message](/zh/api/agent/v2/send-message):向已有的代理任务发送后续消息。 @@ -28,6 +29,7 @@ Mintlify 的 REST(Representational State Transfer)API 让你可以以编程 * **自动化部署**:使用 [Trigger update](/zh/api/update/trigger) 和 [Get update status](/zh/api/update/status),在设定的时间间隔或当特定事件发生时触发站点更新。 * **CI/CD 集成**:在代码变更时,将文档更新作为部署流水线的一部分来执行,使用 [Trigger update](/zh/api/update/trigger)。 +* **预览部署**:在 CI/CD 流水线中使用 [Trigger preview deployment](/zh/api/preview/trigger) 以编程方式为分支创建预览部署。 * **自定义集成**:使用 [Create assistant message](/zh/api/assistant/create-assistant-message-v2)、[Search documentation](/zh/api/assistant/search) 和 [Get page content](/zh/api/assistant/get-page-content),将 AI 助手嵌入到你的产品、支持门户或内部工具中。 * **自动化编辑**:使用 agent 任务,以编程方式大规模更新文档,配合 [Create agent job](/zh/api/agent/v2/create-agent-job)、[Get agent job](/zh/api/agent/v2/get-agent-job) 和 [Send follow-up message](/zh/api/agent/v2/send-message)。 * **Analytics 导出**:使用 [Get user feedback](/zh/api/analytics/feedback)、[Get assistant conversations](/zh/api/analytics/assistant-conversations) 和 [Get assistant caller stats](/zh/api/analytics/assistant-caller-stats),导出反馈、助手会话和调用方统计数据以进行外部分析。 @@ -44,7 +46,7 @@ Mintlify 的 REST(Representational State Transfer)API 让你可以以编程 ### 管理员 API key -使用管理员 API key 对发送到 [Trigger update](/zh/api/update/trigger)、[Get update status](/zh/api/update/status)、[Create agent job](/zh/api/agent/v2/create-agent-job)、[Get agent job](/zh/api/agent/v2/get-agent-job)、[Send follow-up message](/zh/api/agent/v2/send-message)、[Get user feedback](/zh/api/analytics/feedback)、[Get assistant conversations](/zh/api/analytics/assistant-conversations) 和 [Get assistant caller stats](/zh/api/analytics/assistant-caller-stats) 的请求进行身份验证。 +使用管理员 API key 对发送到 [Trigger update](/zh/api/update/trigger)、[Get update status](/zh/api/update/status)、[Trigger preview deployment](/zh/api/preview/trigger)、[Create agent job](/zh/api/agent/v2/create-agent-job)、[Get agent job](/zh/api/agent/v2/get-agent-job)、[Send follow-up message](/zh/api/agent/v2/send-message)、[Get user feedback](/zh/api/analytics/feedback)、[Get assistant conversations](/zh/api/analytics/assistant-conversations) 和 [Get assistant caller stats](/zh/api/analytics/assistant-caller-stats) 的请求进行身份验证。 管理员 API key 以 `mint_` 前缀开头。 diff --git a/zh/api/preview/trigger.mdx b/zh/api/preview/trigger.mdx new file mode 100644 index 000000000..618748d27 --- /dev/null +++ b/zh/api/preview/trigger.mdx @@ -0,0 +1,6 @@ +--- +title: "触发预览部署" +description: "以编程方式为指定分支创建或重新构建预览部署。" +openapi: "/zh/openapi.json POST /project/preview/{projectId}" +keywords: [ "预览", "部署", "分支", "编程方式" ] +--- diff --git a/zh/openapi.json b/zh/openapi.json index a6ec005e1..06da85f50 100644 --- a/zh/openapi.json +++ b/zh/openapi.json @@ -214,6 +214,95 @@ } } } + }, + "/project/preview/{projectId}": { + "post": { + "summary": "触发预览部署", + "description": "为指定分支创建或重新构建预览部署。如果该分支已存在预览部署,则复用该部署并触发重新构建。返回一个状态 ID 用于轮询进度,以及预览 URL。需要 Preview Deployments 权限。", + "parameters": [ + { + "name": "projectId", + "in": "path", + "description": "项目 ID。可在控制台的 [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) 页面中复制。", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["branch"], + "properties": { + "branch": { + "type": "string", + "description": "要创建预览部署的分支名称。", + "minLength": 1 + } + } + } + } + } + }, + "responses": { + "202": { + "description": "预览部署已成功加入队列", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "statusId": { + "type": "string", + "description": "已触发的预览部署的状态 ID。使用此 ID 配合[获取部署状态](/zh/api/update/status)端点来轮询进度。" + }, + "previewUrl": { + "type": "string", + "description": "预览部署可访问的 URL。" + } + } + } + } + } + }, + "400": { + "description": "请求体无效", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "branch is required" + } + } + } + } + } + }, + "403": { + "description": "您当前的方案不支持预览部署", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Preview deployments are not available on your current plan." + } + } + } + } + } + } + } + } } }, "components": {