curl --request POST \
--url https://api.mintlify.com/v2/agent/{projectId}/job \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>"
}
'{
"id": "<string>",
"status": "active",
"source": {
"repository": "<string>",
"ref": "<string>"
},
"model": "<string>",
"prLink": "https://github.com/org/repo/pull/123",
"createdAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
}Create an agent job that runs in the background and automatically creates a pull request with documentation changes.
curl --request POST \
--url https://api.mintlify.com/v2/agent/{projectId}/job \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>"
}
'{
"id": "<string>",
"status": "active",
"source": {
"repository": "<string>",
"ref": "<string>"
},
"model": "<string>",
"prLink": "https://github.com/org/repo/pull/123",
"createdAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
}prLink field is populated in the job response.
curl -X POST https://api.mintlify.com/v2/agent/{projectId}/job \
-H "Authorization: Bearer mint_xxxxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Add a quickstart guide for the Python SDK"}'
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.
The instruction for the agent to execute.
1Agent job created successfully
Unique identifier for the agent job.
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). failed — the agent encountered an unrecoverable error. Poll until status is completed or failed.
active, completed, failed Source repository information.
Show child attributes
The AI model used for this job.
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.
"https://github.com/org/repo/pull/123"
Timestamp when the job was created.
Timestamp when the job was archived.
Was this page helpful?