> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.nunu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Runs

> Archive or restore runs and/or replace their tags. All run IDs must belong to the project. Any project member or project/org API key with access to the project may update runs.

Archive or restore runs and replace their tags. Any project member or project or organization API key with access to the project can update runs; no additional run permission is required. Test-scoped tokens cannot update runs.

## Request body

**run\_ids** `string[]` *required*

One to 100 unique multiplayer run IDs from the project. If any ID is missing or belongs to another project, the request returns `404` and no runs are updated.

**archived** `boolean`

Set to `true` to archive the runs, or `false` to restore them. Omit to leave archive status unchanged.

**tags** `string[]`

Replace the tags on every selected run. Pass an empty array to clear them; omit to leave tags unchanged.

Supply `archived`, `tags`, or both. Unknown fields are rejected. Archiving does not stop or delete runs or remove their artifacts; archived runs remain accessible by ID and in test-plan results.

## Response

The response contains the updated `run_ids` and the supplied fields. For example, an archive-only request returns `run_ids` and `archived`; a tags-only request returns `run_ids` and `tags`.

```bash cURL theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
curl -X PATCH "https://nunu.ai/api/v1/project/your-project-id/runs" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"run_ids": ["lkkg6t5612m"], "archived": true}'
```

```typescript JavaScript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
const response = await fetch("https://nunu.ai/api/v1/project/your-project-id/runs", {
  method: "PATCH",
  headers: {
    "X-Api-Key": process.env.NUNU_API_TOKEN,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ run_ids: ["lkkg6t5612m"], archived: true }),
});
const data = await response.json();
```

```python Python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import os
import requests

response = requests.patch(
    "https://nunu.ai/api/v1/project/your-project-id/runs",
    headers={"X-Api-Key": os.environ["NUNU_API_TOKEN"]},
    json={"run_ids": ["lkkg6t5612m"], "archived": True},
)
data = response.json()
```

```json 200 theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "run_ids": ["lkkg6t5612m"],
  "archived": true
}
```

To find archived runs, use [`GET /runs` with `archived=true`](https://api-docs.nunu.ai/api-reference/runs/list-runs). To restore them, send the same request with `archived: false`.


## OpenAPI

````yaml PATCH /project/{projectId}/runs
openapi: 3.1.0
info:
  title: nunu.ai API
  description: >-
    The nunu.ai Public API allows you to programmatically interact with your
    projects, manage test runs, and upload builds.
  version: 1.0.0
servers:
  - url: https://nunu.ai/api/v1
security:
  - apiKeyAuth: []
paths:
  /project/{projectId}/runs:
    parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
        description: >-
          The project ID. You can copy it from the project settings page or the
          project URL in the dashboard.
    patch:
      tags:
        - Runs
      summary: Update Runs
      description: >-
        Archive or restore runs and/or replace their tags. All run IDs must
        belong to the project. Any project member or project/org API key with
        access to the project may update runs.
      operationId: updateRuns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - run_ids
              anyOf:
                - required:
                    - archived
                - required:
                    - tags
              properties:
                run_ids:
                  type: array
                  minItems: 1
                  maxItems: 100
                  uniqueItems: true
                  items:
                    type: string
                    minLength: 1
                  description: Unique multiplayer run IDs in the project.
                archived:
                  type: boolean
                  description: True archives the runs; false restores them.
                tags:
                  type: array
                  items:
                    type: string
                  description: Replaces each run's tags. An empty array clears all tags.
      responses:
        '200':
          description: Updated runs and supplied fields
          content:
            application/json:
              schema:
                type: object
                required:
                  - run_ids
                properties:
                  run_ids:
                    type: array
                    items:
                      type: string
                  archived:
                    type: boolean
                  tags:
                    type: array
                    items:
                      type: string
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: No access to the project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: One or more runs were not found in the project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed to update runs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        details:
          type: object
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.