How to Trigger a GitHub Copilot Coding Agent Task from the Agent Tasks REST API
POST a prompt to /agents/repos/{owner}/{repo}/tasks and Copilot's cloud agent spins up, writes code, and opens a PR. Here is the exact request, the X-GitHub-Api-Version: 2026-03-10 header, the user-to-server token gotcha that breaks GitHub App installs, a polling loop over the eight task states, and a fan-out script that dispatches the same migration across many repos.