---
title: "Report a worktree (creates it, or replaces the one with this id)"
description: "Each call also refreshes `last_seen_at`."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.gitpando.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Pando API › worktrees

`PUT /v1/monorepos/{owner}/{monorepo}/worktrees/{worktree_id}`

Each call also refreshes `last_seen_at`.

## Authentication

Requires one of the following:

- `credential`, http, header `Authorization`
- `session`, apiKey, in cookie

## Path parameters

- `putWorktree.path.owner` (string, required) — The monorepo's owner, a namespace (a person's login or an organization). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$`
- `putWorktree.path.monorepo` (string, required) — The monorepo's name within its owner (or an old name). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9._]|-(?!-)){0,38}$`
- `putWorktree.path.worktree_id` (string, required) — Made by the client, `wt_` and 16 hex characters.
  - pattern `^[A-Za-z0-9_-]{1,64}$`

## Request body

_Required._

- `putWorktree.repo` (string, required) — The repo path (`projects/web`, or `.`).
- `putWorktree.branch` (string, required)
- `putWorktree.path` (string, required) — The worktree path from the root.
- `putWorktree.machine` (string, required)
- `putWorktree.kind` (string, required)
  - one of `"fuse"`, `"sparse"`, `"fskit"`
- `putWorktree.agent` (string | null, optional) — The agent working in it, if any (PANDO_AGENT).

## Example request

```json
{
  "repo": "string",
  "branch": "string",
  "path": "string",
  "machine": "string",
  "agent": "string",
  "kind": "fuse"
}
```

## Code samples

### cURL

```curl
curl --request PUT \
  --url https://app.gitpando.com/v1/monorepos/string/string/worktrees/string \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "repo": "string",
  "branch": "string",
  "path": "string",
  "machine": "string",
  "agent": "string",
  "kind": "fuse"
}
'
```

### TypeScript

```typescript
const url = 'https://app.gitpando.com/v1/monorepos/string/string/worktrees/string';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    repo: 'string',
    branch: 'string',
    path: 'string',
    machine: 'string',
    agent: 'string',
    kind: 'fuse'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.gitpando.com/v1/monorepos/string/string/worktrees/string"

payload = {
    "repo": "string",
    "branch": "string",
    "path": "string",
    "machine": "string",
    "agent": "string",
    "kind": "fuse"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The worktree as stored.

#### Example

```json
{
  "id": "string",
  "repo": "string",
  "branch": "string",
  "path": "string",
  "machine": "string",
  "agent": "string",
  "kind": "fuse",
  "reported_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "last_seen_at": "2019-08-24T14:15:22Z"
}
```

- `putWorktree.response.200.id` (string, required)
- `putWorktree.response.200.repo` (string, required)
- `putWorktree.response.200.branch` (string, required)
- `putWorktree.response.200.path` (string, required)
- `putWorktree.response.200.machine` (string, required)
- `putWorktree.response.200.kind` (string, required)
  - one of `"fuse"`, `"sparse"`, `"fskit"`
- `putWorktree.response.200.reported_by` (string, required) — The user whose credential reported it.
- `putWorktree.response.200.created_at` (string, required)
  - format `date-time`
- `putWorktree.response.200.last_seen_at` (string, required)
  - format `date-time`
- `putWorktree.response.200.agent` (string | null, optional)

### 403

An error

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `putWorktree.response.403.error` (object, required)
  - `putWorktree.response.403.error.code` (string, required)
  - `putWorktree.response.403.error.message` (string, required)
  - `putWorktree.response.403.error.paths` (array<string>, optional)
  - `putWorktree.response.403.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `putWorktree.response.403.error.checks.sha` (string | null, required)
    - `putWorktree.response.403.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `putWorktree.response.403.error.checks.required` (array | null, required) — Null while unknown.
    - `putWorktree.response.403.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `putWorktree.response.403.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `putWorktree.response.403.error.checks.statuses.sha` (string, required)
      - `putWorktree.response.403.error.checks.statuses.context` (string, required)
      - `putWorktree.response.403.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `putWorktree.response.403.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `putWorktree.response.403.error.checks.statuses.target_url` (string | null, optional)
      - `putWorktree.response.403.error.checks.statuses.description` (string | null, optional)
      - `putWorktree.response.403.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `putWorktree.response.403.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `putWorktree.response.403.error.checks.missing` (array<string>, optional)


Source: https://docs.gitpando.com/api/worktrees/putWorktree/index.md
