Create and manage Google Jules AI coding sessions via the Jules REST API. Start tasks, monitor progress, approve plans, send messages, list sources/repos, and retrieve session activities/artifacts.
Interact with the Google Jules AI coding agent via its REST API. Jules can autonomously execute coding tasks on your GitHub repositories — writing code, fixing bugs, adding tests, and creating pull requests.
Base URL: https://jules.googleapis.com/v1alpha
Auth: Pass your API key via the x-goog-api-key header. Get one at jules.google.com/settings.
Discover which GitHub repos are connected to your Jules account:
CODEBLOCK0
With pagination:
CODEBLOCK1
Filter specific sources:
CODEBLOCK2
Get details and branches for a specific repo:
CODEBLOCK3
Example: sources/github-myorg-myrepo — replace with your actual source ID from List Sources.
Create a new Jules session to execute a coding task on a repo:
CODEBLOCK4
| Parameter | Required | Description |
|---|---|---|
| INLINECODE3 | Yes | The task description for Jules to execute |
| INLINECODE4 |
sourceContext.source | Yes | Source resource name (e.g. sources/github-owner-repo) |
| sourceContext.githubRepoContext.startingBranch | Yes | Branch to start from (e.g. main, develop) |
| requirePlanApproval | No | If true, plans need explicit approval before execution |
| automationMode | No | Set to AUTO_CREATE_PR to auto-create PRs when done |
CODEBLOCK5
List all your Jules sessions:
CODEBLOCK6
Paginate with pageToken:
CODEBLOCK7
Retrieve a single session by ID (includes outputs like PRs if completed):
CODEBLOCK8
| State | Meaning |
|---|---|
| INLINECODE15 | Waiting to be processed |
| INLINECODE16 |
AWAITING_PLAN_APPROVAL | Plan ready, waiting for user approval |
| AWAITING_USER_FEEDBACK | Jules needs additional input |
| IN_PROGRESS | Jules is actively working |
| PAUSED | Session is paused |
| COMPLETED | Task completed successfully |
| FAILED | Task failed to complete |
When a session is in AWAITING_PLAN_APPROVAL state, approve the plan:
CODEBLOCK9
Send feedback, answer questions, or give additional instructions to an active session:
CODEBLOCK10
Use this when session state is AWAITING_USER_FEEDBACK or to provide additional guidance during IN_PROGRESS.
Get all events/progress for a session:
CODEBLOCK11
Get activities after a specific timestamp (for polling):
CODEBLOCK12
Activities will contain exactly one of these event fields:
| Event | Description |
|---|---|
| INLINECODE26 | Jules created a plan (contains plan.steps[]) |
| INLINECODE28 |
userMessaged | User sent a message |agentMessaged | Jules sent a message |progressUpdated | Status update during execution |sessionCompleted | Session finished successfully |sessionFailed | Session encountered an error (contains reason) |
Activities may include artifacts:
gitPatch (unified diff, base commit, suggested commit message)command, output, INLINECODE38mimeType and base64 INLINECODE40CODEBLOCK13
CODEBLOCK14
requirePlanApproval was set, approve the plan when state is INLINECODE42AWAITING_USER_FEEDBACK, send a message with your responseCOMPLETED, get the session to find the output PR URL| Code | Meaning |
|---|---|
| 200 | Success |
| 400 |
Error responses return:
CODEBLOCK15
JULES_API_KEY environment variablepageSize (1-100) and pageToken for pagination该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 jules-api-1776420061 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 jules-api-1776420061 技能
skillhub install jules-api-1776420061
文件大小: 5.49 KB | 发布时间: 2026-4-17 20:06