Skip to main content
Mintlify
current

Search documentation

Type to search this documentation.

On this pageOverview

Send follow-up message

Sends a follow-up message to an existing agent job. The message is processed asynchronously — poll the get job endpoint to track progress.

Authenticate with an admin API key.

Send a follow-up instruction to an existing agent job. The agent processes the message asynchronously. Poll the get agent job endpoint to track progress.

  • 100 uses per Mintlify project per hour
Bash
curl -X POST https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message \
  -H "Authorization: Bearer mint_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Also add error handling examples to the quickstart guide"}'

Related topics

POST /v2/agent/{projectId}/job/{id}/message

cURL
curl --request POST \
  --url https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "<string>"
}'
Python
import requests

url = "https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message"

payload = {
  "prompt": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
JavaScript
const options = {method: "POST", headers: {"Authorization": "Bearer <token>", "Content-Type": "application/json"}, body: JSON.stringify({
  "prompt": "<string>"
})};

fetch("https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message", options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"prompt\":\"<string>\"}",
  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;
}
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message"

	payload := strings.NewReader("{\"prompt\":\"<string>\"}")

	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))

}
Java
HttpResponse<String> response = Unirest.post("https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\"prompt\":\"<string>\"}")
  .asString();
Ruby
require 'uri'
require 'net/http'

url = URI("https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message")

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 = "{\"prompt\":\"<string>\"}"

response = http.request(request)
puts response.read_body
200
{
  "id": "<string>",
  "status": "active",
  "source": {
    "repository": "<string>",
    "ref": "<string>"
  },
  "model": "<string>",
  "prLink": "https://github.com/org/repo/pull/123",
  "createdAt": "<string>",
  "archivedAt": "<string>"
}
400
{
  "error": "<string>"
}
404
{
  "error": "<string>"
}
429
{
  "error": "<string>"
}
Authorizationstringrequired

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.

projectIdstringrequired

Your project ID. Can be copied from the API keys page in your dashboard.

idstringrequired

The unique identifier of the agent job to send a message to.

Typestring
promptstringrequired

The follow-up instruction for the agent.

Required string length: 1+

Typestring

200 — Message sent successfully

id?string

Unique identifier for the agent job.

Typestring
status?enum<string>

Current status of the job. active — the agent is currently processing the prompt. completed — the agent finished successfully and a PR may have been created (check prLink). archived — the job has been archived. failed — the agent encountered an unrecoverable error. Poll until status is completed, archived, or failed.

Available options: active, completed, archived, failed

Typeenum<string>
source?object

Source repository information.

Typeobject
Show child attributes
repository?string

Full URL of the GitHub repository.

Typestring
ref?string | null

Git branch the agent is working on.

Typestring | null
model?string

The AI model used for this job.

Typestring
prLink?string | null

GitHub pull request URL created by the agent. null while the job is still active or if no files were changed. Populated once the agent successfully creates a PR.

Example: https://github.com/org/repo/pull/123

Typestring | null
createdAt?string

Timestamp when the job was created.

Typestring
archivedAt?string | null

Timestamp when the job was archived.

Typestring | null
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu