---
search:
  tags:
    - Account
    - POST
seo:
  description: >-
    Creates an account and logs it in. A deployment that is invitation only
    needs the invite… Reference for the POST /_luna/auth/signup endpoint in the
    Luna API.
sidebar:
  label: Sign up
  badge: POST
title: Sign up
type: openapi-operation
---
Creates an account and logs it in. A deployment that is invitation only needs the `invite` code. No credential is needed.

`POST /_luna/auth/signup`

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

- `email` (string, required)
- `password` (string, required) — At least 10 characters.
- `name` (string)
- `invite` (string | null) — The code from an invitation link.

Request body example:

```json
{
  "email": "string",
  "password": "string",
  "name": "string",
  "invite": "string"
}
```

**Responses**

- `200` — The new account and its session.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "token": "string",
  "account": {
    "id": "string",
    "email": "string",
    "name": "string"
  }
}
```
