create_task
Start a Copilot cloud-agent task on a repository. Provide a natural-language prompt to automate research, edits, and pull request creation.
Instructions
Start a new Copilot cloud-agent task on a repository.
POST /agents/repos/{owner}/{repo}/tasks
Args: owner: Repo owner (user or org login). repo: Repo name. prompt: Natural-language instruction for the agent. base_ref: Branch the agent should base work on (defaults to repo default). head_ref: Branch the agent should push work to (optional). model: Optional model override. Known values: claude-sonnet-4.6, claude-opus-4.6, gpt-5.2-codex, gpt-5.3-codex, gpt-5.4, claude-sonnet-4.5, claude-opus-4.5. Omit for auto-selection. create_pull_request: If true, the agent opens a PR when done.
Returns:
Task object including id, state, html_url, artifacts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | ||
| model | No | ||
| owner | Yes | ||
| prompt | Yes | ||
| base_ref | No | ||
| head_ref | No | ||
| create_pull_request | No |