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

# Get Direct Login URL (New Users Only)

> Create a new ChatSyncs user and return a one-time login URL via the API, returning an error instead of a URL if the user already exists. Use when a developer asks how to provision brand-new accounts only, without accidentally logging into an existing one.

Like [Get Direct Login URL](/developer-api/user/direct-login-url), but only for **new** users —
if the email already exists, it returns `{"status":"0","message":"User already existed"}`
instead of a login URL.

<Tip>
  **Where to find `package_id`:** open **Control Panel → User Permission** — it's the **Package
  ID** column. See [Finding Your IDs & API Token](/developer-api/finding-ids#package-id-package_id)
  for a screenshot.
</Tip>

## New Users Only vs. Get Direct Login URL

|                      | Get Direct Login URL (New Users Only)                                                 | Get Direct Login URL                                               |
| -------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Email is new         | Creates the account, returns a login link                                             | Creates the account, returns a login link                          |
| Email already exists | Fails — `"User already existed"`                                                      | Returns a login link — **no error**                                |
| Use it for           | **Sign-up forms only** — guarantees you never log into an existing account by mistake | Any normal "log in" button — works for new and returning customers |


## OpenAPI

````yaml GET /user/get/direct-login-url/only-new-users
openapi: 3.1.0
info:
  title: ChatSyncs Developer API
  version: 1.0.0
  description: >-
    REST API for sending WhatsApp messages and managing subscribers through
    ChatSyncs.
servers:
  - url: https://platform.chatsyncs.com/api/v1
security: []
paths:
  /user/get/direct-login-url/only-new-users:
    get:
      tags:
        - User API
      summary: Get Direct Login URL (New Users Only)
      operationId: directLoginUrlNewUsers
      parameters:
        - name: apiToken
          in: query
          required: true
          schema:
            type: string
            example: API-KEY
          description: >-
            Your ChatSyncs API key (not a WhatsApp/Meta access token). [Where to
            find it](/developer-api/finding-ids#api-token-apitoken).
        - name: email
          in: query
          required: true
          schema:
            type: string
            example: user@example.com
          description: The new user's email.
        - name: package_id
          in: query
          required: true
          schema:
            type: integer
            example: 1
          description: >-
            The package ID to assign. [Where to find
            it](/developer-api/finding-ids#package-id-package_id).
        - name: expired_date
          in: query
          required: true
          schema:
            type: string
            example: '2026-05-05'
          description: Package expiry date, e.g. 2026-05-05.
      responses:
        '200':
          description: >-
            On success, `message` is an **object** with `email`, `password`,
            `login_url`, and `direct_login_url` — not a plain string.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: '`"1"` = success, `"0"` = failure.'
                  message:
                    description: >-
                      On success: an object with `email`, `password`,
                      `login_url`, `direct_login_url`. On failure: a plain error
                      string.
              examples:
                success:
                  summary: Success
                  value:
                    status: '1'
                    message:
                      email: user@domain.com
                      password: xxxxxxxxxx
                      login_url: https://platform.chatsyncs.com/login
                      direct_login_url: https://platform.chatsyncs.com/direct-login/xxxxxxxxxx
                error:
                  summary: Error — user already exists
                  value:
                    status: '0'
                    message: User already existed

````