---
title: "Connect an account (native authentication)"
method: POST
path: "/api/v1/accounts"
tags: ["Accounts"]
---

# Connect an account (native authentication)

`POST /api/v1/accounts`

Link to Uniple an account of the given type and provider.

## Request body

- union
  - object — Authenticate using your username and password
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` object — Set a sync limit either for chats, messages or both. Chats limit will apply to each inbox, whereas messages limit will apply to each chat. No value will not apply any limit (default behaviour). Providers partial support.
      - `chats` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
      - `messages` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
    - `provider` 'LINKEDIN', required
    - `proxy` object
      - `protocol` 'https' | 'http' | 'socks5'
      - `port` number, required
      - `host` string, required
      - `username` string — Optional username for proxy’s authentication.
      - `password` string — Optional password for proxy’s authentication.
    - `user_agent` string — If encountering disconnection issues, enter the exact user agent of the browser on which the account has been connected. You can easily retrieve it in the browser's console with this command : "console.log(navigator.userAgent)"
    - `recruiter_contract_id` string — The contract that should be used with Linkedin Recruiter.
    - `username` string, required — Should be either an email address or a phone number.
    - `password` string, required
  - object — Authenticate using cookies
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` object — Set a sync limit either for chats, messages or both. Chats limit will apply to each inbox, whereas messages limit will apply to each chat. No value will not apply any limit (default behaviour). Providers partial support.
      - `chats` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
      - `messages` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
    - `provider` 'LINKEDIN', required
    - `proxy` object
      - `protocol` 'https' | 'http' | 'socks5'
      - `port` number, required
      - `host` string, required
      - `username` string — Optional username for proxy’s authentication.
      - `password` string — Optional password for proxy’s authentication.
    - `user_agent` string — If encountering disconnection issues, enter the exact user agent of the browser on which the account has been connected. You can easily retrieve it in the browser's console with this command : "console.log(navigator.userAgent)"
    - `recruiter_contract_id` string — The contract that should be used with Linkedin Recruiter.
    - `access_token` string, required — Linkedin access token, which is to be found under the key "li_at".
    - `premium_token` string — Linkedin Recruiter/Sales Navigator authentication cookie, which is to be found under the key "li_a". It should be used if you need to be logged to an existing session. It not provided, a new session will be started.
  - object — Connect a Whatsapp account.By default, this use the QR code authentication.
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `provider` 'WHATSAPP', required
    - `proxy` object
      - `protocol` 'https' | 'http' | 'socks5'
      - `port` number, required
      - `host` string, required
      - `username` string — Optional username for proxy’s authentication.
      - `password` string — Optional password for proxy’s authentication.
    - `pairing_phone_number` string — The phone number to login with phone number. Format: E.164 digits only (country code + number), e.g. 33600000000. Non-digits are ignored. A code to be entered in the Whatsapp app will be returned as a checkpoint. If this field is left empty, a QR code to be scanned will be returned as a checkpoint.
  - object — Authenticate using your username and password
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` object — Set a sync limit either for chats, messages or both. Chats limit will apply to each inbox, whereas messages limit will apply to each chat. No value will not apply any limit (default behaviour). Providers partial support.
      - `chats` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
      - `messages` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
    - `provider` 'INSTAGRAM', required
    - `proxy` object
      - `protocol` 'https' | 'http' | 'socks5'
      - `port` number, required
      - `host` string, required
      - `username` string — Optional username for proxy’s authentication.
      - `password` string — Optional password for proxy’s authentication.
    - `user_agent` string — If encountering disconnection issues, enter the exact user agent of the browser on which the account has been connected. You can easily retrieve it in the browser's console with this command : "console.log(navigator.userAgent)"
    - `username` string, required — Your Instagram username.
    - `password` string, required — Your Instagram password.
  - object — Authenticate using cookies
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` object — Set a sync limit either for chats, messages or both. Chats limit will apply to each inbox, whereas messages limit will apply to each chat. No value will not apply any limit (default behaviour). Providers partial support.
      - `chats` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
      - `messages` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
    - `provider` 'INSTAGRAM', required
    - `proxy` object
      - `protocol` 'https' | 'http' | 'socks5'
      - `port` number, required
      - `host` string, required
      - `username` string — Optional username for proxy’s authentication.
      - `password` string — Optional password for proxy’s authentication.
    - `user_agent` string — If encountering disconnection issues, enter the exact user agent of the browser on which the account has been connected. You can easily retrieve it in the browser's console with this command : "console.log(navigator.userAgent)"
    - `sessionid` string, required — Instagram session ID, which is to be found under the key "sessionid".
  - object — Authenticate using your username and password
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` object — Set a sync limit either for chats, messages or both. Chats limit will apply to each inbox, whereas messages limit will apply to each chat. No value will not apply any limit (default behaviour). Providers partial support.
      - `chats` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
      - `messages` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
    - `provider` 'MESSENGER', required
    - `proxy` object
      - `protocol` 'https' | 'http' | 'socks5'
      - `port` number, required
      - `host` string, required
      - `username` string — Optional username for proxy’s authentication.
      - `password` string — Optional password for proxy’s authentication.
    - `user_agent` string — If encountering disconnection issues, enter the exact user agent of the browser on which the account has been connected. You can easily retrieve it in the browser's console with this command : "console.log(navigator.userAgent)"
    - `username` string, required
    - `password` string, required
  - object — Authenticate using an existing Messenger/Facebook session payload
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` object — Set a sync limit either for chats, messages or both. Chats limit will apply to each inbox, whereas messages limit will apply to each chat. No value will not apply any limit (default behaviour). Providers partial support.
      - `chats` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
      - `messages` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
    - `provider` 'MESSENGER', required
    - `proxy` object
      - `protocol` 'https' | 'http' | 'socks5'
      - `port` number, required
      - `host` string, required
      - `username` string — Optional username for proxy’s authentication.
      - `password` string — Optional password for proxy’s authentication.
    - `user_agent` string — If encountering disconnection issues, enter the exact user agent of the browser on which the account has been connected. You can easily retrieve it in the browser's console with this command : "console.log(navigator.userAgent)"
    - `cookies` object[], required — Messenger/Facebook cookies from an active session. Required cookies (mautrix-compatible): "xs", "c_user", "datr".
      - `name` string, required — Cookie name. For Messenger/Facebook session auth, include at least: "xs", "c_user", and "datr".
      - `value` string, required — Cookie value as captured from your browser session.
      - `domain` string
      - `path` string
      - `secure` boolean
      - `httpOnly` boolean
      - `expirationDate` number
      - `sameSite` 'unspecified' | 'no_restriction' | 'lax' | 'strict'
    - `headers` object — Optional browser headers from the same authenticated session (recommended: User-Agent, Accept-Language, Sec-CH-UA*).
    - `user_name` string
  - object
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` 'NO_HISTORY_SYNC'
    - `provider` 'MAIL', required
    - `imap_user` string, required
    - `smtp_user` string, required
    - `imap_password` string, required
    - `smtp_password` string, required
    - `imap_host` string, required
    - `imap_port` number, required
    - `smtp_host` string, required
    - `smtp_port` number, required
    - `imap_encryption` string, required
  - object
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` 'NO_HISTORY_SYNC'
    - `provider` 'GOOGLE_OAUTH', required
    - `refresh_token` string, required
    - `access_token` string, required
  - object — You just need to set the provider parameter to "TELEGRAM" to begin the authentication. In response, you will receive a string which needs to be converted to a QR code and scanned to complete the authentication. `password` is needed if 2FA is enabled on the account you try to authenticate.
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` object — Set a sync limit either for chats, messages or both. Chats limit will apply to each inbox, whereas messages limit will apply to each chat. No value will not apply any limit (default behaviour). Providers partial support.
      - `chats` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
      - `messages` union — Either a UTC Datetime to start sync from, or a quantity of data.
        - string — An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect.
        - number — The quantity of data that should be synced from data history. 0 will not sync history.
    - `provider` 'TELEGRAM', required
    - `password` string
  - object
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `sync_limit` 'NO_HISTORY_SYNC'
    - `provider` 'OUTLOOK', required
    - `refresh_token` string, required
    - `access_token` string, required
    - `username` string, required
    - `id` string, required
  - object
    - `country` string — An ISO 3166-1 A-2 country code to be set as proxy's location.
    - `ip` unknown
    - `disabled_features` string[] — An array of features that should be disabled for this account.
    - `provider` 'TWITTER', required
    - `username` string, required
    - `email` string, emailLike, required
    - `password` string, required

## Response `201`

Created. The authentication succeeded and the account is linked to Unipile.

- object
  - `object` 'AccountCreated', required
  - `account_id` string, required — A unique identifier.

## Other responses

- `400` — ## Bad Request ### Invalid parameters - Type: "errors/invalid_parameters" One or more request parameters are invalid or missing. ### Missing parameters - Type: "errors/missing_parameters" One or more request parameters are missing. ### Invalid parameters - Type: "errors/invalid_request" One or a combination of request parameters are invalid. ### Malformed request - Type: "errors/malformed_request" The given request has been rejected by the provider. ### Content too large - Type: "errors/content_too_large" The request payload or filter query is too large and has been rejected by the provider. ### Too many characters - Type: "errors/too_many_characters" The provided content exceeds the character limit. ### Unescaped characters - Type: "errors/unescaped_characters" The request path contains unescaped characters. ### Limit too high - Type: "errors/limit_too_high" Provider cannot accept such high pagination limit. See API reference for details. ### Invalid action - Type: "errors/invalid_action" This action is invalid. ### Invalid label - Type: "errors/invalid_label" This label is invalid.
- `401` — ## Unauthorized ### Invalid credentials The provided credentials are invalid.
- `403` — ## Forbidden ### Insufficient permissions Valid authentication but insufficient permissions to perform the request.
- `407` — ## Proxy Authentication Required ### Proxy authentication error The proxy in use is not working. Please try again.
- `408` — ## Request Timeout ### Request timed out Communication with the provider has timed out. Please retry.
- `409` — ## Conflict ### Operation canceled The current task was canceled by a subsequent one.
- `425` — ## Too Early ### Authentication in progress Cannot start a new intent while another is still in progress.
- `500` — ## Internal Server Error ### Unexpected error - Type: "errors/unexpected_error" Something went wrong. {{moreDetails}} ### Provider error - Type: "errors/provider_error" The provider is experiencing operational problems. Please try again later. ### Authentication intent error - Type: "errors/authentication_intent_error" The current authentication intent was killed after failure. Please start the process again from the beginning.
- `501` — ## Not Implemented ### Missing feature Requested feature is planned but has not been implemented yet.
- `502` — ## Bad Gateway ### Proxy error The proxy in use is not working. Please try again.
- `503` — ## Service Unavailable ### No client session - Type: "errors/no_client_session" No client session is currently running. ### No channel - Type: "errors/no_channel" No channel to client session. ### Handler missing - Type: "errors/no_handler" Handler missing for that request. ### Network down - Type: "errors/network_down" Network is down on server side. Please wait a moment and retry. ### Service unavailable - Type: "errors/service_unavailable" Please try again later.
- `504` — ## Gateway Timeout ### Request timed out - Type: "errors/request_timeout" Request Timeout. Please try again, and if the issue persists, contact support.

---

[API](https://skmtc.net/unipile/apis/unipile-api-reference.md) · [All operations](https://skmtc.net/unipile/apis/unipile-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unipile/unipile-api-reference/revisions/3483a34061f6/schema)
