> ## Documentation Index
> Fetch the complete documentation index at: https://developer.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.

## Example Request

```bash theme={null}
curl --request GET \
  --url 'https://platform.chatsyncs.com/api/v1/user/get/direct-login-url/only-new-users?apiToken=API-KEY&email=user@example.com&package_id=1&expired_date=2026-05-05'
```

<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.


    **Authentication.** Send your key as the `apiToken` parameter, or as
    `Authorization: Bearer <key>` — both work on every endpoint **except Custom
    Fields List**, which only accepts the `apiToken` parameter (a Bearer header
    alone is answered with *The api token field is required.*). A wrong key
    returns HTTP 401 `{"status":"0","message":"Unauthenticated."}`; no key at
    all redirects to the login page.


    **Methods.** Every endpoint accepts both GET and POST with the same
    parameters, except Upload Media, which is POST-only. Use POST for anything
    that changes data.


    **Errors.** Failures usually come back as HTTP 200 with `"status":"0"` and
    the reason in `message`, so always check `status`. `status` is the string
    `"1"` or `"0"` on most endpoints and a boolean on a few.


    **Lists.** Endpoints that return rows put them in `message` as a list; there
    is no `data` field (Custom Fields List is the exception and uses `data`).
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
        '401':
          description: >-
            `apiToken` is wrong. (With no token at all the API redirects to the
            login page with HTTP 302 instead of returning JSON.)
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message:
                    type: string
              examples:
                unauthenticated:
                  summary: Wrong apiToken
                  value:
                    status: '0'
                    message: Unauthenticated.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.