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

# Login

## Step-by-Step Guide: Planpoint Login API

### 1. **Prepare Your Request Body**

You'll need to send a JSON payload with the following fields:

* `username`: Your email address (required, must be valid email format)
* `password`: Your password

### 2. **Set Up the HTTP Request**

Configure a POST request with:

* **Method**: POST
* **URL**: `https://app.planpoint.io/api/users/login`
* **Content-Type**: `application/json`

### 3. **Standard Login Flow**

For regular user login, send this request body:

json

`{
  "username": "your-email@example.com",
  "password": "your-password"
}`

Example using cURL:

bash

`curl --request POST \   --url https://app.planpoint.io/api/users/login \   --header 'Content-Type: application/json' \   --data '{
    "username": "your-email@example.com",
    "password": "your-password"
  }'`

### 4. **Handle the Response**

**Success Response (200):**

json

`{
  "message": "Login successful",
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}`

The response includes:

* `access_token`: JWT token for authenticating future API requests
* HTTP-only cookies are automatically set in your browser:
  * `planpoint`: Access token (expires in 1 day for regular users, 90 days for Zapier)
  * `planpointRefresh`: Refresh token (expires in 7 days, not set for Zapier users)

**Error Responses:**

* **400**: Invalid request body (username not an email, etc.)
* **401**: User not found, incorrect credentials, or unauthorized
* **403**: Not allowed (for impersonation attempts)
* **405**: Method not allowed (if not using POST)
* **500**: Server error

### 5. **Use the Access Token**

For subsequent API requests, use the `access_token` from the response in your Authorization header:

bash

`Authorization: Bearer YOUR_ACCESS_TOKEN`


## OpenAPI

````yaml POST /users/login
openapi: 3.0.3
info:
  title: Planpoint
  description: ''
  version: 1.0.0
servers:
  - url: https://app.planpoint.io/api
security:
  - AccessTokenAuth: []
tags:
  - name: user
    description: Everything about user
  - name: groups
    description: Everything about groups
  - name: projects
    description: Everything about projects
  - name: floors
    description: Everything about floors
  - name: units
    description: Everything about units
  - name: leads
    description: Everything about leads
externalDocs:
  description: Find out more about Planpoint
  url: http://planpoint.io
paths:
  /users/login:
    post:
      tags:
        - user
      summary: Logs user into the system
      operationId: loginUser
      parameters:
        - name: username
          in: query
          description: The user name for login
          required: true
          schema:
            type: string
        - name: password
          in: query
          description: The password for login
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  _id:
                    type: string
                    format: objectId
                    description: Unique identifier for the user
                  role:
                    type: string
                    format: objectId
                    description: Reference to the user's role
                  username:
                    type: string
                    description: Unique username of the user
                  name:
                    type: string
                    description: First name of the user
                  lastName:
                    type: string
                    description: Last name of the user
                  fullName:
                    type: string
                    description: Full name of the user
                  phone:
                    type: string
                    description: Phone number of the user
                  companyName:
                    type: string
                    description: Name of the user's company
                  projectNameURL:
                    type: string
                    description: URL for the user's project name
                  country:
                    type: string
                    description: Country of the user
                  address1:
                    type: string
                    description: Primary address of the user
                  address2:
                    type: string
                    description: Secondary address of the user
                  city:
                    type: string
                    description: City of the user
                  region:
                    type: string
                    description: Region or state of the user
                  zip:
                    type: string
                    description: ZIP code of the user
                  token:
                    type: string
                    description: Authentication token for the user
                  stripeAccountId:
                    type: string
                    description: Stripe account ID of the user
                  stripeOnboardingDone:
                    type: boolean
                    default: false
                    description: Indicates if Stripe onboarding is complete
                  stripeDetailsSubmitted:
                    type: boolean
                    default: false
                    description: Indicates if Stripe details have been submitted
                  experimentalFeatures:
                    type: boolean
                    default: false
                    description: Indicates if experimental features are enabled
                  resetToken:
                    type: string
                    description: Token for resetting the user's password
                  stripeCustomer:
                    type: object
                    description: Stripe customer information for the user
                  subscription:
                    type: object
                    description: Subscription details for the user
                  appliedTrial:
                    type: boolean
                    default: false
                    description: Indicates if the user has applied a trial
                  projects:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of projects associated with the user
                  groups:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of groups associated with the user
                  administrators:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of administrators associated with the user
                  editors:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of editors associated with the user
                  invites:
                    type: array
                    items:
                      type: object
                      properties:
                        firstName:
                          type: string
                          description: First name of the invitee
                        lastName:
                          type: string
                          description: Last name of the invitee
                        email:
                          type: string
                          format: email
                          description: Email address of the invitee
                        level:
                          type: string
                          description: Access level for the invitee
                    description: List of invites associated with the user
                  preferences:
                    type: object
                    properties:
                      hideBrandingIcon:
                        type: boolean
                        default: false
                        description: Indicates if the branding icon is hidden in the viewer
                      hideLoadingLogo:
                        type: boolean
                        default: false
                        description: Indicates if the loading logo is hidden in the viewer
                    description: User preferences
            application/xml:
              schema:
                type: object
                properties:
                  _id:
                    type: string
                    format: objectId
                    description: Unique identifier for the user
                  role:
                    type: string
                    format: objectId
                    description: Reference to the user's role
                  username:
                    type: string
                    description: Unique username of the user
                  name:
                    type: string
                    description: First name of the user
                  lastName:
                    type: string
                    description: Last name of the user
                  fullName:
                    type: string
                    description: Full name of the user
                  phone:
                    type: string
                    description: Phone number of the user
                  companyName:
                    type: string
                    description: Name of the user's company
                  projectNameURL:
                    type: string
                    description: URL for the user's project name
                  country:
                    type: string
                    description: Country of the user
                  address1:
                    type: string
                    description: Primary address of the user
                  address2:
                    type: string
                    description: Secondary address of the user
                  city:
                    type: string
                    description: City of the user
                  region:
                    type: string
                    description: Region or state of the user
                  zip:
                    type: string
                    description: ZIP code of the user
                  token:
                    type: string
                    description: Authentication token for the user
                  stripeAccountId:
                    type: string
                    description: Stripe account ID of the user
                  stripeOnboardingDone:
                    type: boolean
                    default: false
                    description: Indicates if Stripe onboarding is complete
                  stripeDetailsSubmitted:
                    type: boolean
                    default: false
                    description: Indicates if Stripe details have been submitted
                  experimentalFeatures:
                    type: boolean
                    default: false
                    description: Indicates if experimental features are enabled
                  resetToken:
                    type: string
                    description: Token for resetting the user's password
                  stripeCustomer:
                    type: object
                    description: Stripe customer information for the user
                  subscription:
                    type: object
                    description: Subscription details for the user
                  appliedTrial:
                    type: boolean
                    default: false
                    description: Indicates if the user has applied a trial
                  projects:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of projects associated with the user
                  groups:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of groups associated with the user
                  administrators:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of administrators associated with the user
                  editors:
                    type: array
                    items:
                      type: string
                      format: objectId
                    description: List of editors associated with the user
                  invites:
                    type: array
                    items:
                      type: object
                      properties:
                        firstName:
                          type: string
                          description: First name of the invitee
                        lastName:
                          type: string
                          description: Last name of the invitee
                        email:
                          type: string
                          format: email
                          description: Email address of the invitee
                        level:
                          type: string
                          description: Access level for the invitee
                    description: List of invites associated with the user
                  preferences:
                    type: object
                    properties:
                      hideBrandingIcon:
                        type: boolean
                        default: false
                        description: Indicates if the branding icon is hidden in the viewer
                      hideLoadingLogo:
                        type: boolean
                        default: false
                        description: Indicates if the loading logo is hidden in the viewer
                    description: User preferences
        '400':
          description: Invalid input
components:
  securitySchemes:
    AccessTokenAuth:
      type: apiKey
      in: header
      name: Authorization

````