> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.movieknight.site/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.movieknight.site/_mcp/server.

# Signup

POST {{baseUrl}}/api/auth/signup
Content-Type: application/json

**What:** Create an account, seed the 3 default collections (Favorites, Already Watched, Watchlist), and return a JWT plus the safe user.

**Auth:** None.

**Body (JSON):**

| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| name | string | yes | Display name. | `Movie Fan` |
| email | string | yes | Must match a basic email pattern; stored lowercased. | `moviefan@example.com` |
| username | string | yes | Unique; trimmed, case-sensitive. | `moviefan` |
| password | string | yes | Minimum 6 characters. | `secret123` |
| dateOfBirth | string (date) | yes | Any value parseable by `Date` (ISO recommended). | `1999-05-20` |

**Returns:** `data = { token, user }`. `user` never includes `passwordHash`.

Reference: https://apidocs.movieknight.site/movie-knight-api/auth/signup

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/auth/signup:
    post:
      operationId: signup
      summary: Signup
      description: >-
        **What:** Create an account, seed the 3 default collections (Favorites,
        Already Watched, Watchlist), and return a JWT plus the safe user.


        **Auth:** None.


        **Body (JSON):**


        | Field | Type | Required | Description | Example |

        |---|---|---|---|---|

        | name | string | yes | Display name. | `Movie Fan` |

        | email | string | yes | Must match a basic email pattern; stored
        lowercased. | `moviefan@example.com` |

        | username | string | yes | Unique; trimmed, case-sensitive. |
        `moviefan` |

        | password | string | yes | Minimum 6 characters. | `secret123` |

        | dateOfBirth | string (date) | yes | Any value parseable by `Date` (ISO
        recommended). | `1999-05-20` |


        **Returns:** `data = { token, user }`. `user` never includes
        `passwordHash`.
      tags:
        - subpackage_auth
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Auth_Signup_Response_201'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostApiAuthSignupRequestBadRequestError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                password:
                  type: string
                username:
                  type: string
                dateOfBirth:
                  type: string
                  format: date
              required:
                - name
                - email
                - password
                - username
                - dateOfBirth
servers:
  - url: '{{baseUrl}}'
    description: '{{baseUrl}}'
components:
  schemas:
    ApiAuthSignupPostResponsesContentApplicationJsonSchemaDataUserAiUsage:
      type: object
      properties:
        used:
          type: integer
        limit:
          type: integer
        remaining:
          type: integer
      required:
        - used
        - limit
        - remaining
      title: ApiAuthSignupPostResponsesContentApplicationJsonSchemaDataUserAiUsage
    ApiAuthSignupPostResponsesContentApplicationJsonSchemaDataUser:
      type: object
      properties:
        id:
          type: string
        bio:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
        badges:
          type: array
          items:
            description: Any type
        aiUsage:
          $ref: >-
            #/components/schemas/ApiAuthSignupPostResponsesContentApplicationJsonSchemaDataUserAiUsage
        username:
          type: string
        avatarUrl:
          description: Any type
        createdAt:
          type: string
          format: date-time
        countryCode:
          description: Any type
        dateOfBirth:
          type: string
          format: date-time
      required:
        - id
        - bio
        - name
        - email
        - badges
        - aiUsage
        - username
        - createdAt
        - dateOfBirth
      title: ApiAuthSignupPostResponsesContentApplicationJsonSchemaDataUser
    ApiAuthSignupPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        user:
          $ref: >-
            #/components/schemas/ApiAuthSignupPostResponsesContentApplicationJsonSchemaDataUser
        token:
          type: string
      required:
        - user
        - token
      title: ApiAuthSignupPostResponsesContentApplicationJsonSchemaData
    Auth_Signup_Response_201:
      type: object
      properties:
        ok:
          type: boolean
        data:
          $ref: >-
            #/components/schemas/ApiAuthSignupPostResponsesContentApplicationJsonSchemaData
      required:
        - ok
        - data
      title: Auth_Signup_Response_201
    PostApiAuthSignupRequestBadRequestError:
      type: object
      properties:
        ok:
          type: boolean
        error:
          type: string
      required:
        - ok
        - error
      title: PostApiAuthSignupRequestBadRequestError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "name": "Movie Fan",
  "email": "moviefan@example.com",
  "password": "secret123",
  "username": "moviefan",
  "dateOfBirth": "1999-05-20"
}
```

**Response**

```json
{
  "ok": true,
  "data": {
    "user": {
      "id": "66a1f2c4e5b3a1234567890a",
      "bio": "",
      "name": "Movie Fan",
      "email": "moviefan@example.com",
      "badges": [],
      "aiUsage": {
        "used": 0,
        "limit": 5,
        "remaining": 5
      },
      "username": "moviefan",
      "createdAt": "2026-06-25T10:30:00.000Z",
      "dateOfBirth": "1999-05-20T00:00:00.000Z"
    },
    "token": "{{supabase_service_role_api_key_19n1}}"
  }
}
```

**SDK Code**

```python Auth_Signup_example
import requests

url = "https://{{baseurl}}/api/auth/signup"

payload = {
    "name": "Movie Fan",
    "email": "moviefan@example.com",
    "password": "secret123",
    "username": "moviefan",
    "dateOfBirth": "1999-05-20"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Auth_Signup_example
const url = 'https://{{baseurl}}/api/auth/signup';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Movie Fan","email":"moviefan@example.com","password":"secret123","username":"moviefan","dateOfBirth":"1999-05-20"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Auth_Signup_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{{baseurl}}/api/auth/signup"

	payload := strings.NewReader("{\n  \"name\": \"Movie Fan\",\n  \"email\": \"moviefan@example.com\",\n  \"password\": \"secret123\",\n  \"username\": \"moviefan\",\n  \"dateOfBirth\": \"1999-05-20\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Auth_Signup_example
require 'uri'
require 'net/http'

url = URI("https://{{baseurl}}/api/auth/signup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Movie Fan\",\n  \"email\": \"moviefan@example.com\",\n  \"password\": \"secret123\",\n  \"username\": \"moviefan\",\n  \"dateOfBirth\": \"1999-05-20\"\n}"

response = http.request(request)
puts response.read_body
```

```java Auth_Signup_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://{{baseurl}}/api/auth/signup")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Movie Fan\",\n  \"email\": \"moviefan@example.com\",\n  \"password\": \"secret123\",\n  \"username\": \"moviefan\",\n  \"dateOfBirth\": \"1999-05-20\"\n}")
  .asString();
```

```php Auth_Signup_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{{baseurl}}/api/auth/signup', [
  'body' => '{
  "name": "Movie Fan",
  "email": "moviefan@example.com",
  "password": "secret123",
  "username": "moviefan",
  "dateOfBirth": "1999-05-20"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Auth_Signup_example
using RestSharp;

var client = new RestClient("https://{{baseurl}}/api/auth/signup");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Movie Fan\",\n  \"email\": \"moviefan@example.com\",\n  \"password\": \"secret123\",\n  \"username\": \"moviefan\",\n  \"dateOfBirth\": \"1999-05-20\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Auth_Signup_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Movie Fan",
  "email": "moviefan@example.com",
  "password": "secret123",
  "username": "moviefan",
  "dateOfBirth": "1999-05-20"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://{{baseurl}}/api/auth/signup")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```