> ## Documentation Index
> Fetch the complete documentation index at: https://docs.motioness.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign in

Sign in with email + password. Returns a session cookie.

` POST /api/user/signin `

Sign in

## Servers

- ` https://motioness.com ` — Production

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` sessionCookie `: ` apiKey `

  - Credential: ` better-auth.session_token ` in ` cookie `

  - Session cookie set by /api/user/signin, /api/user/signup, or the OAuth callback. Required for all authenticated endpoints.

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` email `, ` password `

  - ` email `: type ` string `; format ` email `

    - maxLength: ` 255 `

  - ` password `: type ` string `

    - minLength: ` 1 `

    - maxLength: ` 128 `

## Responses

### ` 200 ` — Signed in

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` user `

  - ` user `: type ` object `

    - Required fields: ` id `, ` email `, ` name `

    - ` id `: type ` string `

    - ` email `: type ` string `

    - ` name `: type ` string `

### ` 401 ` — Invalid credentials

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` string `

## Request examples

### cURL

```curl
curl -X POST 'https://motioness.com/api/user/signin' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "user@example.com",
  "password": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://motioness.com/api/user/signin', {
  method: 'POST',
  headers: {
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "email": "user@example.com",
    "password": "string"
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.post('https://motioness.com/api/user/signin', json={
  "email": "user@example.com",
  "password": "string"
})
print(response.json())
```