---
# System prepended metadata

title: API Documentation
tags: [Documentation, API]

---

# API Documentation
###### tags: `Documentation` `API`

## USER REGISTRATION
User signs up using his email as username and password. After signing up user must confirm his email.

### POST /user
Creates an unconfirmed user


**Request Body**
| Key | Type | Description |
| -------- | -------- | -------- |
| username | string | Required. Username should be an email |
| password | string | Required. Password must be at least 8 characters, a number, a special character, uppercase and lowercase letters. |

**Request Example**
```json=
{
    "username": "padilla@mailinator.com",
    "password": "Padilla1!"
}
```

**Success Response Examples**
- Status Code: `201`
- Content: 
    ```json=
    {
        "cognito_id": "sample-cognito-id"
    }
    ```

**Error Response Examples**
- Missing required fields
    - Status Code: `400`
    - Content:
        ```json=
        "errors": [
            {
                "code": "missing_required_field",
                "message": "Field is required",
                "param": "username"
            }
        ]
        ```
- User already exists
    - Status Code: `400`
    - Content:
        ```json=
        "errors": [
            {
                "code": "user_already_exists",
                "message": "User already exists",
                "param": "username"
            }
        ]
        ```
- Username is not valid
    - Status Code: `400`
    - Content:
        ```json=
        "errors": [
            {
                "code": "invalid_username",
                "message": "Username must be a valid email",
                "param": "username"
            }
        ]
        ```
- Password is not valid
    - Status Code: `400`
    - Content:
        ```json=
        "errors": [
            {
                "code": "invalid_password",
                "message": "Password must be at least 8 characters long, and has at least 1 of each of the following: number, special character, uppercase letter, lowercase letter",
                "param": "password"
            }
        ]
        ```