Skip to main content
POST
/
agent
/
{projectId}
/
job
/
{id}
/
message
Send message to agent job
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>"
}
'
{
  "id": "<string>",
  "status": "active",
  "source": {
    "repository": "<string>",
    "ref": "<string>"
  },
  "model": "<string>",
  "prLink": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z"
}
This endpoint sends an additional message to an existing agent job session. Use it to continue a conversation with the agent, provide clarifications, or request additional changes.

When to use

  • Request additional documentation changes after the initial job
  • Provide clarification or corrections to the agent
  • Ask follow-up questions about the changes made
  • Request modifications to a draft pull request

Usage notes

  • The agent processes the message in the background
  • Poll the Get agent job endpoint to see the updated status
  • The session must be active to receive messages
  • Sending a message to a completed or failed job returns an error

Example

async function sendFollowUp(projectId, jobId, message, apiKey) {
  const response = await fetch(
    `https://api.mintlify.com/v2/agent/${projectId}/job/${jobId}/message`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ prompt: message })
    }
  );
  
  return response.json();
}

// Usage
const result = await sendFollowUp(
  'my-project-id',
  'job-123',
  'Please also update the API reference to include the new parameter',
  'mint_xxx'
);

Authorizations

Authorization
string
header
required

The Authorization header expects a Bearer token. Use an admin API key (prefixed with mint_). This is a server-side secret key. Generate one on the API keys page in your dashboard.

Path Parameters

projectId
string
required

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

id
string
required

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

Body

application/json
prompt
string
required

The message content to send to the agent.

Response

Message sent successfully. The agent processes it in the background.

id
string

Unique identifier for the agent job.

status
enum<string>

Current status of the agent job.

Available options:
active,
completed,
archived,
failed
source
object

Information about the source repository.

model
string

The AI model used for this job.

URL of the pull request created by the agent. Null until the PR is created.

createdAt
string<date-time>

Timestamp when the job was created.

archivedAt
string<date-time> | null

Timestamp when the job was archived. Null if still active.