# Get Team Run (/reference-api/schema/teams/get-team-run)

## Team storage and identity [#team-storage-and-identity]

Use the database-backed [example Team server](/reference-api/schema/teams/create-team-run#example-team-server). Keep the Team run's returned `run_id` and `session_id`; a nested member run is not interchangeable with the Team run. Stored run, checkpoint and session operations require the configured database.

JWT user isolation is opt-in; non-admin service-account PAT callers always self-scope. Scoped callers need their own matching Team session and run, while configured resource authorization also applies. Run and checkpoint lookups return **404** for inaccessible or mismatched records. For factories, retain any `factory_input` needed by endpoints that reconstruct the Team.

## Poll the Team run [#poll-the-team-run]

```bash
RUN_ID="returned-run-id"
SESSION_ID="returned-session-id"
curl --fail-with-body --get "http://127.0.0.1:7777/teams/reference-team/runs/$RUN_ID" \
  -H "Authorization: Bearer $OS_SECURITY_KEY" \
  --data-urlencode "session_id=$SESSION_ID"
```

`session_id` is required. The response is the raw Team run output, including its status and available content; its `created_at` is an epoch timestamp. During durable acceptance a limited queue-ticket view can precede the stored output. Read the returned status before treating output as completed. Remote Team polling is unsupported (**400**).

## `GET /teams/{team_id}/runs/{run_id}`

**Summary:** Get Team Run

**Description:** Retrieve the status and output of a team run. Use this to poll for background run completion.

Requires the `session_id` that was returned when the run was created.

### Authentication

- Option 1: `HTTPBearer` — HTTP bearer

### Parameters
- `run_id` (path; string; required)
- `team_id` (path; string; required)
- `session_id` (query; string; required) — Session ID for the run

### Request body

None.

### Responses

#### `200`

Run output retrieved successfully

**`application/json`**

Type `unspecified`.

#### Other responses

- `400` — Bad Request `application/json`: Schema `BadRequestResponse` (object).
- `401` — Unauthorized `application/json`: Schema `UnauthenticatedResponse` (object).
- `404` — Team or run not found `application/json`: Schema `NotFoundResponse` (object).
- `422` — Validation Error `application/json`: Schema `ValidationErrorResponse` (object).
- `500` — Internal Server Error `application/json`: Schema `InternalServerErrorResponse` (object).