# Read one run

Returns one run: its result, the problem document that explains a failure, or the approval it is parked on.

## GET `/v1/connectors/runs/{runId}`

### Authorization

`Authorization` Bearer token · header required

`Authorization: Bearer <token>` with an API key (`sfa_` prefix), an OAuth access token, a session token, or a Space machine credential (`sfm_` prefix).

or

`Authorization` OAuth2 access token · header required

OAuth 2.0 with Spacefast scopes. People use the authorization code flow; machines use client credentials.

Scopes: `connectors:read`

### Path parameters

`runId` string required

- min length 1

### Query parameters

`team` string
- min length 1 · max length 255

### Responses

#### 200 Response for status 200

`$schema` string <uri>

Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.

`data` object required

One execution. A tool call and a code program are the same resource.

##### Show properties

- object
  - `id` string required
    - Run id (`cxr_`).
  - `input` object required
    - What the run was asked to do, without echoing arguments that may carry customer data.
    - ##### Show properties
      - `kind` string required
        - `tool` is one call; `code` is a program that may make many. Same endpoint, same id space, same resume.
      - Allowed: `tool`, `code`
      - `address` string | any required
        - Tool address for a `tool` run; null for a `code` program.
      - ##### Show properties
        - Any of:
          - string
      - `digest` string required
        - Content digest of the submitted input, so a retry can be recognized without replaying it.
  - `usage` object required
    - What this run has spent. Budgets are enforced against these numbers.
    - ##### Show properties
      - `toolCalls` integer required
        - Tool calls made so far.
        - min -9007199254740991 · max 9007199254740991
      - `egressBytes` integer required
        - Bytes read from third-party APIs so far.
        - min -9007199254740991 · max 9007199254740991
      - `durationMs` integer required
        - Wall-clock time spent executing so far.
        - min -9007199254740991 · max 9007199254740991
  - `createdAt` string <date-time> required
    - matches ^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$
  - `status` string required
    - Still executing. Poll the run, or submit the next one with a longer `waitMs`.

## Try it

### Server

Base URL https://api.spacefast.com

### Authorization

Bearer token

### Parameters

`runId` path * `team` query

### Send

#### Request

```bash
curl -X GET "https://api.spacefast.com/v1/connectors/runs/string" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Response

#### 200 default

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "input": {
      "kind": "tool",
      "address": "string",
      "digest": "string"
    },
    "usage": {
      "toolCalls": -9007199254740991,
      "egressBytes": -9007199254740991,
      "durationMs": -9007199254740991
    },
    "createdAt": "2019-08-24T14:15:22Z",
    "status": "running"
  }
}
```

```json
{
  "$schema": "http://example.com",
  "type": "string",
  "title": "string",
  "status": -9007199254740991,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": [
    "string"
  ],
  "next": [
    "string"
  ],
  "requestId": "string"
}
```
