Context switching burns time. You fix a bug, bounce to Slack, open CI, then back to code review. The Jules API lets you wire Google’s coding agent into that flow so tedious work can be kicked off from Slack, scheduled in CI, and reviewed as clean pull requests. Below is a plain guide to how it works, simple curl calls to try, and a few patterns you can ship this week.
Table of Contents
Summary
- Jules API exposes sources, sessions, and activities.
- Typical flow: list a repo source → create a session with a prompt → approve plan → watch activities → review PR.
- Great fits: Slack-reported bugs, weekly dependency bumps, pre-merge test fixes.
- Alpha today; expect changes. Keep API keys safe.
- Private repos aren’t used for training. Public ones may be.
What the Jules API does
Short Answer: The Jules API programmatically starts and manages work by Google’s coding agent in your repos. You pass a prompt and a source (like a GitHub repo) to create a session. Jules plans and executes work in a clean environment and reports back as activities and pull requests.
Source, Session, Activity in plain English
- Source: where the code lives. Usually a GitHub repo you’ve connected.
- Session: a tracked block of work with a title and a prompt, like “write tests for parser.”
- Activity: the timeline inside that session. Plan created, message sent, progress updated, PR opened.
Where the API fits vs Jules Tools (CLI)
Use Jules Tools when you want an interactive terminal or to script local flows. Use the API when you need services talking to services: Slack bots, CI triggers, cron jobs, or internal dashboards.
Quickstart in 30 seconds (curl)
Keep your API key in a secret manager. Rotate often.
- Get an API key
Create one in the Jules web app settings. - List sources
curl 'https://jules.googleapis.com/v1alpha/sources' \
-H 'X-Goog-Api-Key: YOUR_API_KEY'
- Create a session
curl 'https://jules.googleapis.com/v1alpha/sessions' \
-X POST \
-H "Content-Type: application/json" \
-H 'X-Goog-Api-Key: YOUR_API_KEY' \
-d '{
"prompt": "Add unit tests for parseQueryString()",
"sourceContext": {
"source": "sources/github/yourorg/yourrepo",
"githubRepoContext": { "startingBranch": "main" }
},
"title": "Parser tests"
}'
- Approve plan (if required)
curl 'https://jules.googleapis.com/v1alpha/sessions/SESSION_ID:approvePlan' \
-X POST -H 'X-Goog-Api-Key: YOUR_API_KEY'
- List activities
curl 'https://jules.googleapis.com/v1alpha/sessions/SESSION_ID/activities?pageSize=30' \
-H 'X-Goog-Api-Key: YOUR_API_KEY'
When the PR lands, review diffs like you usually do.
Common workflows you can automate today
Slack bug triage → session → PR
When someone tags a bug in #incidents, your Slack bot can create a Jules session with the issue title and a link to logs. The bot posts status updates in the same thread and drops the PR link when ready.
CI/CD “quality gate” before merge
For flaky tests or style regressions, have CI kick off a session with a minimal prompt: “stabilize failing tests in path X.” Merge stays blocked until the PR passes.
Backlog sweeps and scheduled chores
Once a week, pull low-risk issues labeled good-first-task and dispatch them to Jules. It’s predictable work that humans often postpone.
Jules API vs Copilot-style tools
Short Answer: Copilot speeds up typing and in-IDE suggestions. The Jules API treats code work as jobs: it plans, edits, tests, and opens PRs autonomously. Use Copilot to write code faster. Use Jules API to move tasks through your pipeline with less hand-holding.
Agent vs autocomplete
Autocomplete shines for small, local edits. Agents help with repository-wide changes, tests, and upgrades. Many teams run both.
Integration surfaces and team fit
- Jules API: Slack, CI, schedulers, dashboards.
- Jules Tools: terminal/TUI, local scripting.
- Copilot: IDE.
Pick based on where your team spends time.
Data use, privacy, and limits
Short Answer: Private repos aren’t used for model training. Public repos may be. Jules runs in a sandboxed environment and reports back as PRs. Plans can require explicit approval. There are daily and concurrent task caps that scale with plan tier.
What to set up on day one:
- Plan approval for risky repos.
- Policy on who can create sessions.
- Repo selection to avoid high-blast-radius monorepos at first.
Pitfalls and guardrails
- Scope creep: Prompts like “speed up the app” go nowhere. Be concrete: “optimize image resize in
server/images.tsand add tests.” - Flaky environments: Capture env vars and setup scripts once, reuse everywhere.
- Noisy PRs: Ask for smaller PRs or set a policy: one topic per session.
- Access sprawl: Gate session creation to maintainers.
Mini case study: Slack→Jules for “version bump Fridays”
A fintech team labels dependency tickets bump-friday. A Slack workflow posts each ticket’s package name and repo. A bot creates Jules sessions at 6 p.m. Friday with prompts like “Bump Next.js to v15 and fix breaking changes,” using a staging branch. PRs arrive by Monday morning with test runs and changelogs. Humans still review. The net effect: the team stopped carrying month-old package debt.
Comparison Table
| Feature | Jules API | Jules Tools (CLI) | GitHub Copilot |
|---|---|---|---|
| Primary use | Automate repo work via services | Interactive terminal control | In-IDE code suggestions |
| Typical trigger | Slack, CI, schedulers | Terminal/TUI commands | Editor keystrokes |
| Output | PRs + activity logs | PRs + terminal feedback | Inline code |
| Setup | API key + connected repos | npm i -g @google/jules | IDE extension |
| Best for | Bug triage, test fixes, upgrades | Local scripting, dashboards | Speeding up typing and small edits |
Frequently Asked Questions (FAQs)
Is the Jules API stable?
It’s alpha. Endpoints and fields may change. Pin versions where possible and keep an eye on the docs.
Do I need the CLI?
No. The API is enough for automation. The CLI helps locally with discovery and ad-hoc tasks.
Does Jules train on my code?
Not on private repositories. For public ones, data may be used. See the references.
How many tasks can I run?
Plans define daily and concurrent caps. Start with the free tier to test fit, then scale.
What about security?
Use least-privilege repo access, rotate API keys, and require plan approval for sensitive code.
Checklist
- Create API key and store it as a secret.
- Connect only the repos you intend to automate.
- Write task-sized prompts with file paths.
- Enable plan approval on sensitive repos.
- Start with Slack triage or package bumps before heavier refactors.
- Review every PR like normal code.
Glossary
- Source: the repo or input context.
- Session: a tracked unit of work with a prompt and context.
- Activity: events inside a session, like plan steps and messages.
- Plan approval: toggle to require a human OK before work starts.
Featured Snippet Boxes
What is the Jules API?
The Jules API lets services trigger and manage work by Google’s coding agent in your repos. You pass a prompt and a repo source to create a session. Jules plans, edits, and tests in a sandbox, then opens a pull request for human review.
How do I get a Jules API key?
Open the Jules web app, go to Settings, and create an API key. Use the key in the X-Goog-Api-Key header for all requests. Rotate keys regularly and avoid hard-coding them into public code or CI logs.
Jules API vs Copilot what’s the difference?
Copilot speeds up coding inside your editor. Jules API treats work as jobs: it runs tasks against your repository, tests changes, and returns PRs. Many teams pair them—Copilot to write code, Jules to automate repetitive chores.
Does Jules train on private code?
Google states that private repositories are not used for training. Public repos may be used. Teams with sensitive code should connect only necessary repos and review access policies.

