REST Resource: sessions

Resource: Session

A session is a contiguous amount of work within the same context.

JSON representation
{
  "name": string,
  "id": string,
  "prompt": string,
  "sourceContext": {
    object (SourceContext)
  },
  "title": string,
  "requirePlanApproval": boolean,
  "createTime": string,
  "updateTime": string,
  "state": enum (State),
  "url": string,
  "outputs": [
    {
      object (SessionOutput)
    }
  ]
}
Fields
name

string

Output only. Identifier. The full resource name (e.g., "sessions/{session}").

id

string

Output only. The id of the session. This is the same as the "{session}" part of the resource name (e.g., "sessions/{session}").

prompt

string

Required. The prompt to start the session with.

sourceContext

object (SourceContext)

Required. The source to use in this session, with additional context.

title

string

Optional. If not provided, the system will generate one.

requirePlanApproval

boolean

Optional. Input only. If true, plans the agent generates will require explicit plan approval before the agent starts working. If not set, plans will be auto-approved.

createTime

string (Timestamp format)

Output only. The time the session was created.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. The time the session was last updated.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

state

enum (State)

Output only. The state of the session.

url

string

Output only. The URL of the session to view the session in the Jules web app.

outputs[]

object (SessionOutput)

Output only. The outputs of the session, if any.

SourceContext

Context for how to use a source in a session.

JSON representation
{
  "source": string,

  // Union field context can be only one of the following:
  "githubRepoContext": {
    object (GitHubRepoContext)
  }
  // End of list of possible types for union field context.
}
Fields
source

string

Required. The name of the source this context is for. To get the list of sources, use the ListSources API. Format: sources/{source}

Union field context. The context for how to use the source in a session. context can be only one of the following:
githubRepoContext

object (GitHubRepoContext)

Context to use a GitHubRepo in a session.

GitHubRepoContext

Context to use a GitHubRepo in a session.

JSON representation
{
  "startingBranch": string
}
Fields
startingBranch

string

Required. The name of the branch to start the session from.

State

State of a session.

Enums
STATE_UNSPECIFIED The state is unspecified.
QUEUED The session is queued.
PLANNING The agent is planning.
AWAITING_PLAN_APPROVAL The agent is waiting for plan approval.
AWAITING_USER_FEEDBACK The agent is waiting for user feedback.
IN_PROGRESS The session is in progress.
PAUSED The session is paused.
FAILED The session has failed.
COMPLETED The session has completed.

SessionOutput

An output of a session.

JSON representation
{

  // Union field output can be only one of the following:
  "pullRequest": {
    object (PullRequest)
  }
  // End of list of possible types for union field output.
}
Fields
Union field output. An output of the session. output can be only one of the following:
pullRequest

object (PullRequest)

A pull request created by the session, if applicable.

PullRequest

A pull request.

JSON representation
{
  "url": string,
  "title": string,
  "description": string
}
Fields
url

string

The URL of the pull request.

title

string

The title of the pull request.

description

string

The description of the pull request.

Methods

approvePlan

Approves a plan in a session.

create

Creates a new session.

get

Gets a single session.

list

Lists all sessions.

sendMessage

Sends a message from the user to a session.