---
title: "Upload an artifact, or the next version of one with the same name"
description: "Multipart, with Content-Length (411 without it): one `file` field\n(a .md, .markdown, .html, .htm, .png, .jpg, .jpeg, .gif, .webp or\n.svg file; its name is the artifact's) and an `image` field for each\nimage a document uses, the file's name its path from the document\n(`img/hero.png`). Refused: 413 too_large (over 10 MiB in all, or a\ndocument over 1.5 MiB), 400 too_many_files (over 20), 409\ntoo_many_artifacts (100 on the branch), 400 bad_request (a name,\npath or kind Pando does not take). Each file's SHA-256 is computed\nand checked by R2.\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 › artifacts

`POST /v1/monorepos/{owner}/{monorepo}/repos/{repo}/branches/{branch}/artifacts`

Multipart, with Content-Length (411 without it): one `file` field
(a .md, .markdown, .html, .htm, .png, .jpg, .jpeg, .gif, .webp or
.svg file; its name is the artifact's) and an `image` field for each
image a document uses, the file's name its path from the document
(`img/hero.png`). Refused: 413 too_large (over 10 MiB in all, or a
document over 1.5 MiB), 400 too_many_files (over 20), 409
too_many_artifacts (100 on the branch), 400 bad_request (a name,
path or kind Pando does not take). Each file's SHA-256 is computed
and checked by R2.

## Authentication

Requires one of the following:

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

## Path parameters

- `addArtifact.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}$`
- `addArtifact.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}$`
- `addArtifact.path.repo` (string, required) — The repo's `name` (`projects-web`).
- `addArtifact.path.branch` (string, required) — The branch's name; a '/' in it raw or as %2F.

## Request body

_Required._

- `addArtifact.file` (string, required)
  - format `binary`
- `addArtifact.image` (array<string>, optional)
  - format `binary`

## Example request

```text
{
  "file": "string",
  "image": [
    "string"
  ]
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://app.gitpando.com/v1/monorepos/string/string/repos/string/branches/string/artifacts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data'
```

### TypeScript

```typescript
const url = 'https://app.gitpando.com/v1/monorepos/string/string/repos/string/branches/string/artifacts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'multipart/form-data', Authorization: 'Bearer <token>'}
};

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/repos/string/branches/string/artifacts"

headers = {
    "Content-Type": "multipart/form-data",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

A new artifact (200 when it is the next version of one)

#### Example

```json
{
  "id": "string",
  "repo": "string",
  "branch": "string",
  "name": "string",
  "kind": "markdown",
  "title": "string",
  "latest": {
    "n": 0,
    "size": 0,
    "sha256": "string",
    "files": [
      {
        "path": "string",
        "size": 0,
        "sha256": "string",
        "type": "string"
      }
    ],
    "uploaded_by": "string",
    "machine": "string",
    "via": "web",
    "created_at": "2019-08-24T14:15:22Z"
  },
  "versions": 0,
  "comments": {
    "open": 0,
    "resolved": 0
  },
  "created_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
```

- `addArtifact.response.201.id` (string, required)
- `addArtifact.response.201.repo` (string, required)
- `addArtifact.response.201.branch` (string, required)
- `addArtifact.response.201.name` (string, required)
- `addArtifact.response.201.kind` (string, required)
  - one of `"markdown"`, `"html"`, `"image"`
- `addArtifact.response.201.title` (string | null, required) — The first heading or <title>, at most 200 characters.
- `addArtifact.response.201.latest` (object, required)
  - `addArtifact.response.201.latest.n` (integer, required)
  - `addArtifact.response.201.latest.size` (integer, required) — All its files
  - `addArtifact.response.201.latest.sha256` (string, required) — The main file's.
  - `addArtifact.response.201.latest.files` (array<object>, required) — The main file first, then its images by path.
    - `addArtifact.response.201.latest.files.path` (string, required)
    - `addArtifact.response.201.latest.files.size` (integer, required)
    - `addArtifact.response.201.latest.files.sha256` (string, required)
    - `addArtifact.response.201.latest.files.type` (string, required)
  - `addArtifact.response.201.latest.uploaded_by` (string, required)
  - `addArtifact.response.201.latest.machine` (string | null, required) — The credential's machine; web from the browser.
  - `addArtifact.response.201.latest.via` (string, required)
    - one of `"web"`, `"cli"`
  - `addArtifact.response.201.latest.created_at` (string, required)
    - format `date-time`
- `addArtifact.response.201.versions` (integer, required)
- `addArtifact.response.201.comments` (object, required)
  - `addArtifact.response.201.comments.open` (integer, required)
  - `addArtifact.response.201.comments.resolved` (integer, required)
- `addArtifact.response.201.created_by` (string, required)
- `addArtifact.response.201.created_at` (string, required)
  - format `date-time`
- `addArtifact.response.201.updated_at` (string, required)
  - format `date-time`


Source: https://docs.gitpando.com/api/artifacts/addArtifact/index.md
