---
title: "Create agent job (v1)"
method: POST
path: "/v1/agent/{projectId}/job"
deprecated: true
---

# Create agent job (v1)

`POST /v1/agent/{projectId}/job`

> **Deprecated.**

Deprecated: use [v2 create agent job](/api/agent/v2/create-agent-job) instead. Creates a new agent job that can generate and edit documentation based on provided messages and branch information.

Authenticate with an admin API key.

## Path parameters

- `projectId` string, required

## Request body

- object
  - `branch` string — The name of the Git branch that the agent should work on. If omitted, the agent generates a branch name based on the message content.
  - `messages` object[], required — A list of messages to provide to the agent. A default system prompt is always prepended automatically, so you typically only need to include user messages.
    - `role` 'system' | 'user' | 'assistant', required — The role of the message sender. Use `user` for task instructions. Use `system` to add supplementary instructions that are appended after the default system prompt (does not replace it). Use `assistant` to provide example assistant responses for few-shot prompting.
    - `content` string, required — The content of the message.
  - `asDraft` boolean — Control whether the pull request is created in draft or non-draft mode. When true, creates a draft pull request. When false (default), creates a regular pull request ready for review.
  - `model` 'sonnet' | 'opus' — The AI model to use for the agent job. Use `sonnet` for faster, cost-effective processing. Use `opus` for more capable, but slower processing.

## Response `200`

Agent job created successfully. Returns a streaming response with Server-Sent Events.

---

[API](https://skmtc.dev/mcp-b/apis/mintlify-admin-api.md) · [All operations](https://skmtc.dev/mcp-b/apis/mintlify-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mcp-b/mintlify-admin-api/revisions/6165028f8792/schema)
