---
search:
  tags:
    - Deploys
    - POST
seo:
  description: >-
    Deploys a built app to a tenant as its next version. The request names the
    entry modules,… Reference for the POST /_luna/deploy endpoint in the Luna
    API.
sidebar:
  label: Deploy an app
  badge: POST
title: Deploy an app
type: openapi-operation
---
Deploys a built app to a tenant as its next version. The request names the entry modules, their manifests and the files. The `luna deploy` command builds an app and sends this request for you. Running lunas move to the new version as they next wake.

`POST /_luna/deploy`

**Request body** (`application/json`, required)

- `tenant` (string, required) — The tenant to deploy to, by its full name.
- `entries` (string[], required) — The entry modules, relative to the app's root. At most one for each language. One path as a string works too, and so does the name \`entry\`.
- `manifests` (object) — The manifest of each entry module, by its path, as the SDK's build reports it.
- `files` (object) — The files of a small app: each path, relative and separated by \`/\`, with its contents as UTF-8 text.
- `tree` (object) — The files of an app that were uploaded before this request, each path with its hash and size.

Request body example:

```json
{
  "tenant": "string",
  "entries": [
    "string"
  ],
  "manifests": {
    "property1": {},
    "property2": {}
  },
  "files": {
    "property1": "string",
    "property2": "string"
  },
  "tree": {
    "property1": {
      "sha256": "string",
      "size": 0
    },
    "property2": {
      "sha256": "string",
      "size": 0
    }
  }
}
```

**Responses**

- `200` — The app is deployed.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "tenant": "string",
  "version": 0,
  "lunas": [
    {
      "name": "string",
      "visibility": "string",
      "key": [
        "string"
      ],
      "handlers": [
        "string"
      ]
    }
  ],
  "publishableKey": "string",
  "apiToken": "string",
  "warnings": [
    "string"
  ],
  "url": "string"
}
```
