Admin
Trigger Autopilot webhook
Starts an Autopilot run that follows the prompt in the request body. Useful for asking Autopilot to update your docs from CI/CD pipelines, release scripts, or internal tools.
Authenticate with an organization API key that has write access.
POST
/
v2
/
autopilot
/
{projectId}
/
webhook
Trigger Autopilot webhook
curl --request POST \
--url https://api.mintlify.com/v2/autopilot/{projectId}/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "We released v2.4 of the CLI. Add the new --watch flag to the CLI reference."
}
'import requests
url = "https://api.mintlify.com/v2/autopilot/{projectId}/webhook"
payload = { "prompt": "We released v2.4 of the CLI. Add the new --watch flag to the CLI reference." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.'
})
};
fetch('https://api.mintlify.com/v2/autopilot/{projectId}/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mintlify.com/v2/autopilot/{projectId}/webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mintlify.com/v2/autopilot/{projectId}/webhook"
payload := strings.NewReader("{\n \"prompt\": \"We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mintlify.com/v2/autopilot/{projectId}/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v2/autopilot/{projectId}/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"runId": "<string>"
}{
"success": true,
"error": "<string>"
}{
"success": true,
"error": "<string>"
}{
"success": true,
"error": "<string>"
}{
"success": true,
"error": "<string>"
}Use this endpoint to start an Autopilot run from your own tools. Each request queues a run that follows the
prompt in the request body, using the same context, skills, and review settings as Autopilot’s other runs.
Autopilot must be enabled for the project.
Use cases
Autopilot already watches your connected repositories. Use the webhook for changes that happen outside them:- Feature launches: Update the docs when a feature flag rolls out to everyone or a beta becomes generally available.
- Support tools: Send a docs request when your support team tags a ticket as a docs gap.
- Internal tooling: Send docs requests from internal dashboards or scheduled jobs you already run.
Get the webhook URL and auth header
Open the Autopilot page in your dashboard. The Webhook section shows the full webhook URL and a Copy auth header action for theAuthorization: Bearer <api-key> header template.
Replace <api-key> with an unexpired organization API key with write access. Create or manage keys on the API keys page.
Example
Ask Autopilot to update the docs when a beta feature becomes generally available:curl -X POST "https://api.mintlify.com/v2/autopilot/$PROJECT_ID/webhook" \
-H "Authorization: Bearer $MINTLIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Scheduled exports are now generally available to all plans. Remove the beta callout from the scheduled exports pages and add the feature to the changelog."}'
What happens after a request
Autopilot works on the prompt like any other run. When it opens or updates a pull request, it assigns reviewers and notifies your team the same way it does for code changes. Each run appears as its own thread on the Autopilot page. If Autopilot is paused, the run waits until you resume Autopilot.Rate limits and credits
This endpoint shares a rate limit with Trigger update, Trigger automation, and Trigger automation webhook: up to 10 requests per 10 seconds per organization. A run costs 250 credits when it opens or updates a pull request. See Autopilot credits.Authorizations
The Authorization header expects a Bearer token. Use an admin API key. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Path Parameters
Your project ID. Copy it from the API keys page in your dashboard.
Body
application/json
⌘I
Trigger Autopilot webhook
curl --request POST \
--url https://api.mintlify.com/v2/autopilot/{projectId}/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "We released v2.4 of the CLI. Add the new --watch flag to the CLI reference."
}
'import requests
url = "https://api.mintlify.com/v2/autopilot/{projectId}/webhook"
payload = { "prompt": "We released v2.4 of the CLI. Add the new --watch flag to the CLI reference." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.'
})
};
fetch('https://api.mintlify.com/v2/autopilot/{projectId}/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mintlify.com/v2/autopilot/{projectId}/webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mintlify.com/v2/autopilot/{projectId}/webhook"
payload := strings.NewReader("{\n \"prompt\": \"We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mintlify.com/v2/autopilot/{projectId}/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v2/autopilot/{projectId}/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"We released v2.4 of the CLI. Add the new --watch flag to the CLI reference.\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"runId": "<string>"
}{
"success": true,
"error": "<string>"
}{
"success": true,
"error": "<string>"
}{
"success": true,
"error": "<string>"
}{
"success": true,
"error": "<string>"
}