---
title: "A new chat with the repository assistant"
description: "One session (kind chat) per conversation, per person. It answers from\nPando's read tools with the caller's access and no sandbox; asked for\na change, it starts its own branch `assistant/<n>` and works as a task\ndoes. A chat is its person's alone: not in GET .../agents, and 404 to\nanyone else. Follow-ups, the transcript, the socket and Stop are the\nagents routes'.\n"
---

> 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 › agents

`POST /v1/monorepos/{owner}/{monorepo}/assistant`

One session (kind chat) per conversation, per person. It answers from
Pando's read tools with the caller's access and no sandbox; asked for
a change, it starts its own branch `assistant/<n>` and works as a task
does. A chat is its person's alone: not in GET .../agents, and 404 to
anyone else. Follow-ups, the transcript, the socket and Stop are the
agents routes'.

## Authentication

Requires one of the following:

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

## Path parameters

- `newChat.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}$`
- `newChat.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}$`

## Request body

_Required._

- `newChat.prompt` (string, required)
  - maxLength 65536
- `newChat.repo` (string, optional)
- `newChat.model` (string, optional)

## Example request

```json
{
  "prompt": "string",
  "repo": "string",
  "model": "string"
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://app.gitpando.com/v1/monorepos/string/string/assistant \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "string",
  "repo": "string",
  "model": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://app.gitpando.com/v1/monorepos/string/string/assistant';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({prompt: 'string', repo: 'string', model: 'string'})
};

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/assistant"

payload = {
    "prompt": "string",
    "repo": "string",
    "model": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

Started

#### Example

```json
{
  "number": 0,
  "kind": "task",
  "status": "working",
  "reason": "string",
  "repo": "string",
  "branch": "string",
  "program": "string",
  "model": "string",
  "issue": 0,
  "launched_by": "string",
  "machine": "string",
  "workspace": "mount",
  "awaiting_checks": true,
  "first_message": "string",
  "branch_facts": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
```

- `newChat.response.201.number` (integer, required)
- `newChat.response.201.kind` (string, required)
  - one of `"task"`, `"issue"`, `"review"`, `"chat"`
- `newChat.response.201.status` (string, required)
  - one of `"working"`, `"waiting"`, `"failed"`, `"stopped"`
- `newChat.response.201.reason` (string | null, required)
- `newChat.response.201.repo` (string, required)
- `newChat.response.201.branch` (string | null, required) — Named by a person or from its issue; null for an assistant's chat until the person names one.
- `newChat.response.201.program` (string, required) — pi
- `newChat.response.201.model` (string, required)
- `newChat.response.201.issue` (integer | null, required)
- `newChat.response.201.launched_by` (string, required)
- `newChat.response.201.machine` (string, required) — The session's credential, cloud-<n>.
- `newChat.response.201.workspace` (string | null, required)
  - one of `"mount"`, `"clone"`, `null`
- `newChat.response.201.awaiting_checks` (boolean, required) — Its merge waits for required checks still running; Pando tells it when they are green.
- `newChat.response.201.first_message` (string | null, required) — An assistant's chat: its first message, cut at 200 characters; null for other kinds.
- `newChat.response.201.created_at` (string, required)
  - format `date-time`
- `newChat.response.201.updated_at` (string, required)
  - format `date-time`
- `newChat.response.201.branch_facts` (object | null, optional) — In a list only. Its branch now (state, ahead, merged_at, checks); null while the branch is not made yet.


Source: https://docs.gitpando.com/api/agents/newChat/index.md
