---
title: "Create a monorepo; the caller becomes its owner"
---

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

`POST /v1/monorepos`

## Authentication

Requires one of the following:

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

## Request body

_Required._

- `createMonorepo.name` (string, required) — A monorepo name, unique within its owner: lower-case letters, digits, `.`, `_`, `-`; starts with a letter or digit; no `--`; at most 39 characters. Input in any case is lowered. Reserved, because /{owner}/{name} would be one of Pando's own pages: sessions (a person's recorded agent sessions). Creating or renaming to one answers 400 `reserved_name`.
  - pattern `^[a-z0-9](?:[a-z0-9._]|-(?!-)){0,38}$`
- `createMonorepo.owner` (string, optional) — The namespace: your own login (the default), or an organization you are in (any member may). Else 403 `not_your_namespace`. In an org, the creator also gets their own owner row, so they can rename or delete what they made.
  - pattern `^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$`
- `createMonorepo.kind` (string, optional) — `monorepo`: Pando also makes the meta layer's Artifacts repo (`<id>--meta`, empty); add code repos with createRepo. `repo`: a plain git repo; Pando makes its one repo (path `.`, name = the monorepo's name) and returns it in `repos`.
  - one of `"monorepo"`, `"repo"`; default `"monorepo"`

## Example request

```json
{
  "name": "string",
  "owner": "string",
  "kind": "monorepo"
}
```

## Code samples

### cURL

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

### TypeScript

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

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"

payload = {
    "name": "string",
    "owner": "string",
    "kind": "monorepo"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

Created

#### Example

```json
{
  "monorepo": {
    "id": "string",
    "owner": "string",
    "name": "string",
    "full_name": "string",
    "kind": "monorepo",
    "created_at": "2019-08-24T14:15:22Z",
    "role": "owner",
    "owner_type": "user"
  },
  "repos": [
    {
      "monorepo": "string",
      "name": "string",
      "path": "string",
      "description": "string",
      "default_branch": "string",
      "clone_url": "string",
      "required_checks": [
        "string"
      ],
      "checks_unknown": "string",
      "releases_public": true,
      "created_at": "2019-08-24T14:15:22Z",
      "created_by": "string"
    }
  ],
  "replaced_alias": {
    "full_name": "string",
    "pointed_to": "string"
  }
}
```

- `createMonorepo.response.201.monorepo` (object, required)
  - `createMonorepo.response.201.monorepo.id` (string, required) — Permanent: `m_` and 16 hex characters, or, for a monorepo made before namespaces, its old name.
  - `createMonorepo.response.201.monorepo.owner` (string, required) — A user's login, which is their namespace, or an organization's (one space for both): 1 to 39 lower-case letters, digits and single hyphens, no hyphen at either end (input in any case is lowered). Reserved, because a namespace is the first URL segment: v1, healthz, login, logout, settings, assets, fonts, new, api, app, static, orgs, users, docs, install. A login made at sign-in comes from the email's local part, skipping reserved and taken names (`base`, `base-2`, ... `base-999`, then a random tail).
    - pattern `^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$`
  - `createMonorepo.response.201.monorepo.name` (string, required) — A monorepo name, unique within its owner: lower-case letters, digits, `.`, `_`, `-`; starts with a letter or digit; no `--`; at most 39 characters. Input in any case is lowered. Reserved, because /{owner}/{name} would be one of Pando's own pages: sessions (a person's recorded agent sessions). Creating or renaming to one answers 400 `reserved_name`.
    - pattern `^[a-z0-9](?:[a-z0-9._]|-(?!-)){0,38}$`
  - `createMonorepo.response.201.monorepo.full_name` (string, required) — `owner/name`.
  - `createMonorepo.response.201.monorepo.kind` (string, required)
    - one of `"monorepo"`, `"repo"`
  - `createMonorepo.response.201.monorepo.created_at` (string, required)
    - format `date-time`
  - `createMonorepo.response.201.monorepo.role` (string, required) — The caller's: the higher of their own row and, in an org's monorepo, their org role.
    - one of `"owner"`, `"member"`
  - `createMonorepo.response.201.monorepo.owner_type` (string, required) — Whose namespace `owner` is: a person's or an organization's.
    - one of `"user"`, `"org"`
- `createMonorepo.response.201.repos` (array<object>, required) — The plain repo for kind `repo`; empty for kind `monorepo`.
  - `createMonorepo.response.201.repos.monorepo` (string, required) — The monorepo's `owner/name`.
  - `createMonorepo.response.201.repos.name` (string, required) — The repo's id in URLs (its path with `/` turned into `-`).
  - `createMonorepo.response.201.repos.path` (string, required) — `projects/web`, or `.` for a plain repo.
  - `createMonorepo.response.201.repos.default_branch` (string, required) — Always `main` for now.
  - `createMonorepo.response.201.repos.clone_url` (string, required) — The git door URL: `https://<host>/<owner>/<monorepo>/<name>.git`, or `https://<host>/<owner>/<name>.git` for a plain repo.
  - `createMonorepo.response.201.repos.created_at` (string, required)
    - format `date-time`
  - `createMonorepo.response.201.repos.description` (string | null, optional)
  - `createMonorepo.response.201.repos.required_checks` (array | null, optional) — Read from `.pando/pando.toml` on main when the repo is fetched one at a time (getRepo); left out of lists. Null while unknown.
  - `createMonorepo.response.201.repos.checks_unknown` (string | null, optional) — With required_checks, why they are unknown (pando.toml unreadable or broken); else null.
  - `createMonorepo.response.201.repos.releases_public` (boolean, optional) — The switch "Anyone can download releases" (getRepo only). On, the project's release files download without signing in; never its code.
  - `createMonorepo.response.201.repos.created_by` (string, optional)
- `createMonorepo.response.201.replaced_alias` (object | null, required) — An old `owner/name` (from a rename or transfer) that led to another monorepo and now leads to this one. Null when nothing was taken over. Never silent.
  - `createMonorepo.response.201.replaced_alias.full_name` (string, required) — The old name, now this monorepo's.
  - `createMonorepo.response.201.replaced_alias.pointed_to` (string | null, required) — The `owner/name` it led to before.

### 401

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"
        }
      ]
    }
  }
}
```

- `createMonorepo.response.401.error` (object, required)
  - `createMonorepo.response.401.error.code` (string, required)
  - `createMonorepo.response.401.error.message` (string, required)
  - `createMonorepo.response.401.error.paths` (array<string>, optional)
  - `createMonorepo.response.401.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `createMonorepo.response.401.error.checks.sha` (string | null, required)
    - `createMonorepo.response.401.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"`
    - `createMonorepo.response.401.error.checks.required` (array | null, required) — Null while unknown.
    - `createMonorepo.response.401.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.
    - `createMonorepo.response.401.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `createMonorepo.response.401.error.checks.statuses.sha` (string, required)
      - `createMonorepo.response.401.error.checks.statuses.context` (string, required)
      - `createMonorepo.response.401.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `createMonorepo.response.401.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `createMonorepo.response.401.error.checks.statuses.target_url` (string | null, optional)
      - `createMonorepo.response.401.error.checks.statuses.description` (string | null, optional)
      - `createMonorepo.response.401.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.
      - `createMonorepo.response.401.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.
    - `createMonorepo.response.401.error.checks.missing` (array<string>, 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"
        }
      ]
    }
  }
}
```

- `createMonorepo.response.403.error` (object, required)
  - `createMonorepo.response.403.error.code` (string, required)
  - `createMonorepo.response.403.error.message` (string, required)
  - `createMonorepo.response.403.error.paths` (array<string>, optional)
  - `createMonorepo.response.403.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `createMonorepo.response.403.error.checks.sha` (string | null, required)
    - `createMonorepo.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"`
    - `createMonorepo.response.403.error.checks.required` (array | null, required) — Null while unknown.
    - `createMonorepo.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.
    - `createMonorepo.response.403.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `createMonorepo.response.403.error.checks.statuses.sha` (string, required)
      - `createMonorepo.response.403.error.checks.statuses.context` (string, required)
      - `createMonorepo.response.403.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `createMonorepo.response.403.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `createMonorepo.response.403.error.checks.statuses.target_url` (string | null, optional)
      - `createMonorepo.response.403.error.checks.statuses.description` (string | null, optional)
      - `createMonorepo.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.
      - `createMonorepo.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.
    - `createMonorepo.response.403.error.checks.missing` (array<string>, optional)

### 409

`monorepo_exists`: the owner has a monorepo with that name.

#### 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"
        }
      ]
    }
  }
}
```

- `createMonorepo.response.409.error` (object, required)
  - `createMonorepo.response.409.error.code` (string, required)
  - `createMonorepo.response.409.error.message` (string, required)
  - `createMonorepo.response.409.error.paths` (array<string>, optional)
  - `createMonorepo.response.409.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `createMonorepo.response.409.error.checks.sha` (string | null, required)
    - `createMonorepo.response.409.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"`
    - `createMonorepo.response.409.error.checks.required` (array | null, required) — Null while unknown.
    - `createMonorepo.response.409.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.
    - `createMonorepo.response.409.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `createMonorepo.response.409.error.checks.statuses.sha` (string, required)
      - `createMonorepo.response.409.error.checks.statuses.context` (string, required)
      - `createMonorepo.response.409.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `createMonorepo.response.409.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `createMonorepo.response.409.error.checks.statuses.target_url` (string | null, optional)
      - `createMonorepo.response.409.error.checks.statuses.description` (string | null, optional)
      - `createMonorepo.response.409.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.
      - `createMonorepo.response.409.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.
    - `createMonorepo.response.409.error.checks.missing` (array<string>, optional)


Source: https://docs.gitpando.com/api/monorepos/createMonorepo/index.md
