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

# Sign In

> Authenticate a CrowdChange user and receive an auth token for user-specific API calls, including the two-factor authentication challenge flow.

## Body

<ParamField body="email" type="string" required>
  User's email.
</ParamField>

<ParamField body="password" type="string" required>
  User's password.
</ParamField>

<ParamField body="method" type="string">
  Method of 2FA. Required if the first login attempt asks to use 2FA. Allowed values: `sms`, `email`, `authApplication`
</ParamField>

<ParamField body="mfa_code" type="string">
  2FA code sent to user. Required if the first login attempt asks to use 2FA.
</ParamField>

## Response

<ResponseField name="token" type="string">
  Auth token to User-specific API. Presented if log in process is successful. Expired after 30 days if not used.
</ResponseField>

<ResponseField name="user_id" type="integer">
  User ID. Presented if log in process is successful.
</ResponseField>

<ResponseField name="email" type="string">
  Disguised user email. Presented if user needs to use 2FA and has email 2FA method.
</ResponseField>

<ResponseField name="phone" type="string">
  Disguised user Phone. Presented if user needs to use 2FA and has sms 2FA method.
</ResponseField>

<ResponseField name="method" type="string">
  Default 2FA method. Presented if user needs to use 2FA.
</ResponseField>

<ResponseField name="active_methods" type="any[]">
  Available 2FA methods to user. Presented if user needs to use 2FA.
</ResponseField>

**Other responses**

| Status | Description  |
| ------ | ------------ |
| `401`  | Unauthorized |
| `403`  | Forbidden    |

<ResponseExample>
  ```json theme={null}
  {
    "token": "1|WQaSlvm1Gl8Pscq0e98K5MQPhiV8Q07CT9t8vR0N",
    "user_id": 10,
    "email": "a***n@crowdchange.co",
    "phone": "Campaign",
    "method": "Description",
    "active_methods": [
      "email",
      "sms",
      "authApplication"
    ]
  }
  ```
</ResponseExample>
