Create agent job

Changed on

Deprecated: use a custom automation with a webhook trigger instead. Creates a new agent job that runs in the background. The job processes the prompt asynchronously. Poll the get job endpoint to track progress. If the agent edits files successfully, a pull request is automatically created.

Authenticate with an admin API key.

post/v2/agent/{projectId}/job

Request

  • Base URL
    https://api.mintlify.com
  • Auth
    HTTP bearer

Path parameters

projectIdstring required

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

Request body

promptstring required

The instruction for the agent to execute.

Response

Agent job created successfully

idstring

Unique identifier for the agent job.

status'active' | 'completed' | 'archived' | 'failed'

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.

modelstring

The AI model used for this job.

prLinkstring uri nullable

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.

createdAtstring date-time

Timestamp when the job was created.

archivedAtstring date-time nullable

Timestamp when the job was archived.

Example response

{
  "prLink": "https://github.com/org/repo/pull/123"
}

Changes