Skip to content

Activities

Activities represent events that occur during a session. Use the Activities API to monitor progress, retrieve messages, and access artifacts like code changes.

GET /v1alpha/sessions/{sessionId}/activities

Lists all activities for a session.

parent required string path

The parent session. Format: sessions/{session}

Pattern: ^sessions/[^/]+$

pageSize integer query

Number of activities to return (1-100). Defaults to 50.

pageToken string query

Page token from a previous ListActivities response.

Terminal window
curl -H "x-goog-api-key: $JULES_API_KEY" \
"https://jules.googleapis.com/v1alpha/1234567/activities?pageSize=20"
{
"activities": [
{
"name": "1234567/activities/act1",
"id": "act1",
"originator": "system",
"description": "Session started",
"createTime": "2024-01-15T10:30:00Z"
},
{
"name": "1234567/activities/act2",
"id": "act2",
"originator": "agent",
"description": "Plan generated",
"planGenerated": {
"plan": {
"id": "plan1",
"steps": [
{
"id": "step1",
"index": 0,
"title": "Analyze existing code",
"description": "Review the authentication module structure"
},
{
"id": "step2",
"index": 1,
"title": "Write unit tests",
"description": "Create comprehensive test coverage"
}
],
"createTime": "2024-01-15T10:31:00Z"
}
},
"createTime": "2024-01-15T10:31:00Z"
}
],
"nextPageToken": "eyJvZmZzZXQiOjIwfQ=="
}
GET /v1alpha/sessions/{sessionId}/activities/{activityId}

Retrieves a single activity by ID.

name required string path

The resource name of the activity. Format: sessions/{session}/activities/{activity}

Pattern: ^sessions/[^/]+/activities/[^/]+$

Terminal window
curl -H "x-goog-api-key: $JULES_API_KEY" \
https://jules.googleapis.com/v1alpha/1234567/activities/act2

Returns the full Activity object:

{
"name": "1234567/activities/act2",
"id": "act2",
"originator": "agent",
"description": "Code changes ready",
"createTime": "2024-01-15T11:00:00Z",
"artifacts": [
{
"changeSet": {
"source": "sources/github-myorg-myrepo",
"gitPatch": {
"baseCommitId": "a1b2c3d4",
"unidiffPatch": "diff --git a/tests/auth.test.js...",
"suggestedCommitMessage": "Add unit tests for authentication module"
}
}
}
]
}

Activities have different types based on what occurred. Each activity will have exactly one of these event fields populated:

Indicates Jules has created a plan for the task:

{
"planGenerated": {
"plan": {
"id": "plan1",
"steps": [
{ "id": "step1", "index": 0, "title": "Step title", "description": "Details" }
],
"createTime": "2024-01-15T10:31:00Z"
}
}
}

Indicates a plan was approved (by user or auto-approved):

{
"planApproved": {
"planId": "plan1"
}
}

A message from the user:

{
"userMessaged": {
"userMessage": "Please also add integration tests"
}
}

A message from Jules:

{
"agentMessaged": {
"agentMessage": "I've completed the unit tests. Would you like me to add integration tests as well?"
}
}

A status update during execution:

{
"progressUpdated": {
"title": "Writing tests",
"description": "Creating test cases for login functionality"
}
}

The session finished successfully:

{
"sessionCompleted": {}
}

The session encountered an error:

{
"sessionFailed": {
"reason": "Unable to install dependencies"
}
}

Activities may include artifacts—outputs produced during execution:

{
"artifacts": [
{
"changeSet": {
"source": "sources/github-myorg-myrepo",
"gitPatch": {
"baseCommitId": "a1b2c3d4e5f6",
"unidiffPatch": "diff --git a/src/auth.js b/src/auth.js\n...",
"suggestedCommitMessage": "Add authentication tests"
}
}
}
]
}
{
"artifacts": [
{
"bashOutput": {
"command": "npm test",
"output": "All tests passed (42 passing)",
"exitCode": 0
}
}
]
}
{
"artifacts": [
{
"media": {
"mimeType": "image/png",
"data": "base64-encoded-data..."
}
}
]
}