# App runs

3 calls. Every request needs the `Authorization` header: see [the overview](https://docs.maitento.com/reference.md).

## `appRuns.get`

```http
GET /apps/processes/by-id/{id}
```

The run with this id. Throws `NotFoundError` when there is none.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=GET%20%2Fapps%2Fprocesses%2Fby-id%2F%7Bid%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Response:** [`AppProcess`](https://docs.maitento.com/reference/types/app-process.md) (200)

```bash title="curl"
curl -X GET "https://api.maitento.com/apps/processes/by-id/<id>" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const run = await mt.appRuns.get("6ecd8c99-4036-403d-bf84-cf8400f67836");
```
```python title="Python"
mt.app_runs.get("b7e6d5c4-3a2b-4c1d-8e9f-0a1b2c3d4e5f")
```

## `appRuns.updateInputs`

```http
PUT /apps/processes/by-id/{id}/inputs
```

Changes the values of a running app's EXISTING inputs (it sees the change); 400 for an unknown input.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=PUT%20%2Fapps%2Fprocesses%2Fby-id%2F%7Bid%7D%2Finputs).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Request body:** [`AppStartRequest`](https://docs.maitento.com/reference/types/app-start-request.md)

| Field | Type | Required | Description |
|---|---|---|---|
| `inputs` | [`NameValuePair`](https://docs.maitento.com/reference/types/name-value-pair.md)`[]` | yes | A value for every input the app declares (the parameters of its `main`), by name. Every declared input is required; a name the app doesn't declare is ignored. |
| `credentials` | [`InteractionProcessCredentialRequest`](https://docs.maitento.com/reference/types/interaction-process-credential-request.md)`[] \| null` |  | Model keys for this run, in the order they are tried. Every interaction the app starts uses them before your tenant's model keys. Null or empty: only your tenant's keys are used. |
| `allowMaitentoFallback` | `boolean \| null` |  | Whether an interaction this app starts may use Maitento's own key for a provider once no key of yours for it is left. Null means no. |
| `credentialStack` | `string \| null` |  | The credential stack the run uses, by id or name, and every interaction and code pipeline it starts. Its credentials serve every model call, in the stack's order, and Maitento's own keys are never used. Leave it out to use the app's own stack, then the namespace's default, then your tenant's. Can't be combined with `credentials`. |
| `aiModelOverrides` | [`AiModelOverrideRequestInput`](https://docs.maitento.com/reference/types/ai-model-override-request.md#in-a-request)`[] \| null` |  | Model overrides for named agents, applied to every interaction this app starts. Null or empty: agents use the models their definitions name. |
| `webDownloadPartitionId` | `uuid \| null` |  | The temporary knowledge base (partition) that pages fetched by the web tools of every interaction and code pipeline this app starts are kept in, passed on to the apps it starts. Ignored unless it is one of your temporary knowledge bases. Null: each run uses its namespace's default, then the tenant's. |
| `webAccessOverrides` | [`WebAccessOverrideInput`](https://docs.maitento.com/reference/types/web-access-override.md#in-a-request)`[] \| null` |  | Web tool overrides (on or off, for all agents or one by name) applied to every interaction this app starts. |

**Response:** [`AppProcess`](https://docs.maitento.com/reference/types/app-process.md) (200)

```bash title="curl"
curl -X PUT "https://api.maitento.com/apps/processes/by-id/<id>/inputs" \
  -H "Authorization: $MAITENTO_AUTH" \
  -H "Content-Type: application/json" \
  -d '{"inputs":[]}'
```
```ts title="TypeScript"
const run = await mt.appRuns.updateInputs("6ecd8c99-4036-403d-bf84-cf8400f67836", { inputs: { approved: true } });
```
```python title="Python"
mt.app_runs.update_inputs("b7e6d5c4-3a2b-4c1d-8e9f-0a1b2c3d4e5f", {"approved": "true"})
```

## `appRuns.listActive`

```http
GET /namespaces/{namespaceName}/apps/processes
```

The app runs of the namespace that have not finished.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=GET%20%2Fnamespaces%2F%7BnamespaceName%7D%2Fapps%2Fprocesses).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `namespaceName` | `string` | yes |  |

**Response:** [`AppProcessWithDetails`](https://docs.maitento.com/reference/types/app-process-with-details.md)`[]` (200)

```bash title="curl"
curl -X GET "https://api.maitento.com/namespaces/<namespaceName>/apps/processes" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const active = await mt.appRuns.listActive({ namespace: "support" });
```
```python title="Python"
mt.app_runs.list_active(namespace="demo")
```
