POST
/
agent
/
job
/
{domain}
Create agent job
curl --request POST \
  --url https://api-dsc.mintlify.com/v1/agent/job/{domain} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "branch": "<string>",
  "messages": [
    {
      "role": "system",
      "content": "<string>"
    }
  ]
}'
"<string>"
This endpoint creates an agent job based on provided messages and branch information. The job executes asynchronously and returns a streaming response with the execution details and results. If a branch doesn’t exist, the agent creates one. If files are edited successfully, a draft pull request is automatically created at the end of the job.

Rate limits

The agent API has the following limits:
  • 10,000 uses per key per month
  • 10,000 requests per Mintlify organization per hour
  • 10,000 requests per IP per day

Suggested usage

For best results, use the useChat hook from ai-sdk to send requests and handle responses.

Authorizations

Authorization
string
header
required

The Authorization header expects a Bearer token. See the Assistant API Key documentation for details on how to get your API key.

Path Parameters

domain
string
required

The domain identifier from your domain.mintlify.app URL. Can be found in the top left of your dashboard.

Body

application/json
branch
string
required

The name of the Git branch that the agent should work on, will be automatically created if it doesn't exist

messages
object[]
required

A list of previous messages to provide to the agent.

Response

200 - text/plain

Agent job created successfully (streaming response). X-Session-Id Header is sent back in the response

Streaming response containing the agent job execution details and results.