POST /agents/repos/{owner}/{repo}/tasks
[!NOTE] This endpoint is in public preview and is subject to change.
Starts a new Copilot cloud agent task for a repository.
This endpoint is only available to users with a Copilot Business or Copilot Enterprise subscription.
Fine-grained access tokens for "Start a task"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- Fine-grained personal access tokens
The fine-grained token must have the following permission set:
- "Agent tasks" repository permissions (read and write)
GitHub App installation access tokens are not supported for this endpoint.
Servers
- https://api.github.com
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
repo |
String | Yes |
The name of the repository. The name is not case sensitive. |
owner |
String | Yes |
The account owner of the repository. The name is not case sensitive. |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
String | Yes |
The user's prompt for the agent |
base_ref |
String | No |
Base ref for new branch/PR |
create_pull_request |
Boolean | No |
Whether to create a PR. Default value: false |
head_ref |
String | No |
Head ref for existing branch/PR. If provided with |
model |
String | No |
The model to use for this task. The allowed models may change over time and depend on the user's GitHub Copilot plan and organization policies. Currently supported values: |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.