# Get session repositories

Source: <https://everruns.com/docs/api/operations/get_session_repositories/>

[Docs](https://everruns.com/docs/)/[API reference](https://everruns.com/docs/api/)/[Sessions & workspaces](https://everruns.com/docs/api/groups/sessions-workspaces/)/Get session repositories

# Get session repositories

Preview

List the repositories checked out in the session’s sandbox and what the session changed in each. Reads a running sandbox only; it never starts or resumes one.

Public APIEverruns Cloud and self-hosted Platform

GET`/v1/sessions/{session_id}/repositories`

See [authentication](https://everruns.com/docs/sre/runbooks/authentication/) for credentials and permissions.

## Parameters

### Path Parameters

**session_id**

required

string

Session ID

## Responses

200Repositories and their changes

### 200

Repositories and their changes

Media typeapplication/json

What a session changed in the repositories checked out in its sandbox.

object

**repositories**

required

Array\<object>

One checkout under `/workspace`.

object

**access**

required

`read`, `write`, or `none` when the session’s settings do not list it.

string

**base_branch**

required

string

**branch**

required

string

**commits_ahead_of_base**

Absent when the base branch is not known locally.

integer | null format: int64

**commits_not_pushed**

Absent when the branch was never pushed.

integer | null format: int64

**diff**

Unified diff against the base branch, cut at a fixed size.

string

**diff_truncated**

boolean

**files**

Files that differ from the base branch, committed or not.

Array\<object>

object

**additions**

Absent for binary and new untracked files.

integer | null format: int64

**committed**

required

boolean

**deletions**

integer | null format: int64

**path**

required

string

**on_work_branch**

required

boolean

**path**

required

string

**repo**

`owner/name`, when the checkout’s remote is a GitHub repository.

string | null

**uncommitted_files**

required

integer format: int64

**sandbox_state**

required

`running` when the checkouts were read. Any other value (`paused`, `not_started`, `none`, …) means the sandbox was left alone and `repositories` is empty.

string

**work_branch**

The branch the agent works on in every writable repository.

string | null

### Example

```json
{
  "repositories": [
    {
      "access": "write",
      "base_branch": "main",
      "branch": "everruns/bdaf0ce2",
      "files": [
        {
          "path": "src/config.rs"
        }
      ],
      "path": "/workspace/app",
      "repo": "acme/app"
    }
  ],
  "sandbox_state": "running",
  "work_branch": "everruns/bdaf0ce2"
}
```

404Session not found

### 404

Session not found

FetchcURL

Request

```js
const url = 'https://app.everruns.com/api/v1/sessions/example/repositories';
const options = {method: 'GET'};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

Request

```sh
curl --request GET \
  --url https://app.everruns.com/api/v1/sessions/example/repositories
```

Additional language examples require JavaScript. The default request example is available above.

200404

200 · Repositories and their changes

```json
{
  "repositories": [
    {
      "access": "write",
      "base_branch": "main",
      "branch": "everruns/bdaf0ce2",
      "on_work_branch": true,
      "path": "/workspace/app",
      "repo": "acme/app",
      "uncommitted_files": 0
    }
  ],
  "sandbox_state": "running",
  "work_branch": "everruns/bdaf0ce2"
}
```

404 · Session not found

No response body example is declared for this status.

## Matching endpoints