{"openapi":"3.1.0","info":{"version":"1.0.0","title":""},"components":{"schemas":{}},"paths":{"/v2/auth/checkpoint":{"post":{"operationId":"solveCheckpoint","summary":"Solve a Checkpoint","tags":["Custom Auth"],"description":"Solve the current checkpoint for the given authentication intent.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["code","intent_id"],"properties":{"code":{"description":"The code to solve the checkpoint. Check the AuthenticationCheckpoint response you have already obtained to see what type of code is expected.","type":"string"},"intent_id":{"description":"The ID of the intent for which a checkpoint must be solved.","type":"string","pattern":"^acc_(.*)$"}}}}},"required":true},"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Solve checkpoint","language":"node","install":"npm install unipile","code":"import { UnipileCustomAuth } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileCustomAuth = new UnipileCustomAuth({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileCustomAuth.solveCheckpoint(\n  {\n    body: {\n      code: '123456',\n      intent_id: 'intent_id',\n    },\n  }\n);"},{"name":"Solve checkpoint","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    custom_auth_api = unipile.CustomAuthApi(api_client)\n\nresponse = custom_auth_api.solve_checkpoint(\n    {\n    'code': '123456',\n    'intent_id': 'intent_id',\n  }\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"title":"Checkpoint","description":"The authentication requires a checkpoint to be solved.","type":"object","required":["object","checkpoint","intent_id"],"properties":{"object":{"type":"string","enum":["AuthenticationCheckpoint"]},"checkpoint":{"description":"The details of the checkpoint that user needs to solve.","anyOf":[{"title":"One-Time Password","description":"A one-time password was sent to the user's phone or email address. The user needs to enter the code in the next checkpoint.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["OTP"]}}},{"title":"In App Validation","description":"A notification was sent to the user's phone. The user needs to validate the notification by clicking on the link in the notification.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["IN_APP_VALIDATION"]}}},{"title":"Phone Register","description":"The user needs to register their phone number so an OTP can be sent.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["PHONE_REGISTER"]}}},{"title":"Two Factor Authentication","description":"The user needs to enter the code generated by the Authenticator App used to setup 2FA or received by SMS.","type":"object","required":["type","platform"],"properties":{"type":{"type":"string","enum":["2FA"]},"platform":{"description":"The platform of the 2FA.\n          - `SMS` means the code was sent in a SMS.\n          - `APP` means the user must enter the code generated by the Authenticator App used to setup 2FA.\n          - `WHATSAPP` means the code was sent via WhatsApp.","type":"string","enum":["SMS","APP","WHATSAPP"]}}},{"title":"Captcha","description":"The user needs to solve a captcha checkpoint.","type":"object","required":["type","public_key","data"],"properties":{"type":{"type":"string","enum":["CAPTCHA"]},"public_key":{"description":"The public key of the CAPTCHA. This is used to verify the CAPTCHA.","anyOf":[{"type":"string"},{"type":"null"}]},"data":{"description":"The data of the CAPTCHA. This is used to verify the CAPTCHA.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"title":"OTP or In App Validation","description":"The user can either enter a one-time password sent to their phone/email or validate a notification sent to their phone.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["OTP_OR_IN_APP_VALIDATION"]}}},{"title":"Contract Selection","description":"The user must pick a contract from a list to activate the correct features and complete authentication.","type":"object","required":["type","contracts"],"properties":{"type":{"type":"string","enum":["CONTRACT_SELECTION"]},"contracts":{"description":"A list of contracts to choose from.","type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"The ID of the contract.","type":"string"},"name":{"description":"The name of the contract.","type":"string"}}}}}}]},"intent_id":{"description":"The ID of the auth intent. This should be used in Solve Checkpoint.","type":"string","pattern":"^acc_(.*)$"}}},{"title":"QR Code","description":"The authentication was started for a QR Code.","type":"object","required":["object","qrcode","intent_id"],"properties":{"object":{"type":"string","enum":["AuthenticationQrCode"]},"qrcode":{"description":"The QR Code to scan.","type":"string"},"intent_id":{"description":"The ID of the auth intent. This should be used to listen for the QR Code scan with Solve Checkpoint.","type":"string","pattern":"^acc_(.*)$"}}},{"title":"Oauth URL","description":"For Oauth providers (Outlook, Google)","type":"object","required":["object","url"],"properties":{"object":{"type":"string","enum":["OauthUrl"]},"url":{"description":"The URL to redirect to start the oauth flow of the provider.","type":"string"}}},{"title":"Account","type":"object","required":["object","user_id","created_at","id","application_id","status","provider","metadata"],"properties":{"object":{"type":"string","enum":["Account"]},"user_id":{"description":"The ID of the user that owns the account for the provider.","type":"string"},"name":{"description":"The name of the account. This is usually the display name or public identifier (phone number, email address, etc.) of the user that owns the account.","type":"string"},"created_at":{"description":"The date and time the account was linked with Unipile.","type":"string"},"id":{"description":"ID of the account.","type":"string","pattern":"^acc_(.*)$"},"application_id":{"description":"ID of the parent application.","type":"string","pattern":"^app_(.*)$"},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `error` is Service Interuption.\n    - `disconnected` is Require Authentication..\n    - `paused` is Paused.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","paused"]},"provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"oauth_scope":{"description":"If the provider is OAuth, this is the scope of comma-separated permissions granted to the account.","type":"string"},"metadata":{"type":"object","properties":{"auto_proxy_country":{"description":"The chosen country for the automatic proxy selection.","type":"string"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"products_connection_status":{"description":"The status of the connection to a product, if the account is connected to multiple products.","type":"object","additionalProperties":{"type":"string","enum":["running","disconnected","errored"]}},"custom_data":{"description":"Custom data of the account. This is where you can store custom data using \"Update an account\" method.","type":"object","additionalProperties":{"type":"string"}}}},"initial_sync":{"description":"Sync details if the account has initial sync enabled.","type":"object","required":["status"],"properties":{"status":{"description":"The state of an account’s initial provider sync.\n  - `pending`sync hasn’t started yet.\n  - `running` sync is currently in progress.\n  - `failed` sync could not be completed due to an error.\n  - `completed` sync finished successfully.\n  .","type":"string","enum":["pending","running","failed","completed"]},"started_at":{"description":"The date and time the initial sync started.","type":"string"}}},"proxy":{"description":"The proxy used for the account.","type":"object","required":["country","auto_proxy"],"properties":{"country":{"description":"The country of the proxy. If null, the proxy has no defined country.","anyOf":[{"type":"string"},{"type":"null"}]},"auto_proxy":{"description":"Whether the proxy was set automatically by Unipile.","type":"boolean"},"host":{"description":"The host of the custom proxy.","type":"string"},"port":{"description":"The port of the custom proxy.","type":"number"},"username":{"description":"The username used to authenticate to the custom proxy.","type":"string"},"protocol":{"description":"The protocol of the custom proxy.","type":"string"}}}}}]}}}}}}},"/v2/auth/checkpoint/request":{"post":{"operationId":"requestCheckpoint","summary":"Request Checkpoint","tags":["Custom Auth"],"description":"Request a checkpoint for the given authentication intent. This can be used to request a different type of checkpoint if the first one was not successful.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["intent_id"],"properties":{"intent_id":{"description":"The ID of the intent for which a checkpoint must be requested.","type":"string","pattern":"^acc_(.*)$"}}}}},"required":true},"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Request checkpoint","language":"node","install":"npm install unipile","code":"import { UnipileCustomAuth } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileCustomAuth = new UnipileCustomAuth({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileCustomAuth.requestCheckpoint(\n  {\n    body: {\n      intent_id: 'intent_id',\n    },\n  }\n);"},{"name":"Request checkpoint","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    custom_auth_api = unipile.CustomAuthApi(api_client)\n\nresponse = custom_auth_api.request_checkpoint(\n    {\n    'intent_id': 'intent_id',\n  }\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"title":"Checkpoint","description":"The authentication requires a checkpoint to be solved.","type":"object","required":["object","checkpoint","intent_id"],"properties":{"object":{"type":"string","enum":["AuthenticationCheckpoint"]},"checkpoint":{"description":"The details of the checkpoint that user needs to solve.","anyOf":[{"title":"One-Time Password","description":"A one-time password was sent to the user's phone or email address. The user needs to enter the code in the next checkpoint.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["OTP"]}}},{"title":"In App Validation","description":"A notification was sent to the user's phone. The user needs to validate the notification by clicking on the link in the notification.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["IN_APP_VALIDATION"]}}},{"title":"Phone Register","description":"The user needs to register their phone number so an OTP can be sent.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["PHONE_REGISTER"]}}},{"title":"Two Factor Authentication","description":"The user needs to enter the code generated by the Authenticator App used to setup 2FA or received by SMS.","type":"object","required":["type","platform"],"properties":{"type":{"type":"string","enum":["2FA"]},"platform":{"description":"The platform of the 2FA.\n          - `SMS` means the code was sent in a SMS.\n          - `APP` means the user must enter the code generated by the Authenticator App used to setup 2FA.\n          - `WHATSAPP` means the code was sent via WhatsApp.","type":"string","enum":["SMS","APP","WHATSAPP"]}}},{"title":"Captcha","description":"The user needs to solve a captcha checkpoint.","type":"object","required":["type","public_key","data"],"properties":{"type":{"type":"string","enum":["CAPTCHA"]},"public_key":{"description":"The public key of the CAPTCHA. This is used to verify the CAPTCHA.","anyOf":[{"type":"string"},{"type":"null"}]},"data":{"description":"The data of the CAPTCHA. This is used to verify the CAPTCHA.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"title":"OTP or In App Validation","description":"The user can either enter a one-time password sent to their phone/email or validate a notification sent to their phone.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["OTP_OR_IN_APP_VALIDATION"]}}},{"title":"Contract Selection","description":"The user must pick a contract from a list to activate the correct features and complete authentication.","type":"object","required":["type","contracts"],"properties":{"type":{"type":"string","enum":["CONTRACT_SELECTION"]},"contracts":{"description":"A list of contracts to choose from.","type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"The ID of the contract.","type":"string"},"name":{"description":"The name of the contract.","type":"string"}}}}}}]},"intent_id":{"description":"The ID of the auth intent. This should be used in Solve Checkpoint.","type":"string","pattern":"^acc_(.*)$"}}},{"title":"QR Code","description":"The authentication was started for a QR Code.","type":"object","required":["object","qrcode","intent_id"],"properties":{"object":{"type":"string","enum":["AuthenticationQrCode"]},"qrcode":{"description":"The QR Code to scan.","type":"string"},"intent_id":{"description":"The ID of the auth intent. This should be used to listen for the QR Code scan with Solve Checkpoint.","type":"string","pattern":"^acc_(.*)$"}}}]}}}}}}},"/v2/auth/intent":{"post":{"operationId":"startAuthIntent","summary":"Start Auth Intent","tags":["Custom Auth"],"description":"Start an auth intent for a provider. This might require handling of checkpoints and oauth flows depending on the provider. Use <a href=\"https://developer.unipile.com/v2.0/reference/post_v2-auth-link\">Create Auth Link</a> to let Unipile handle everything for you.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"anyOf":[{"title":"IMAP","description":"Start the authentication intent with IMAP provider.","type":"object","required":["provider","credentials"],"properties":{"provider":{"description":"The provider to authenticate with.","type":"string","enum":["imap"]},"credentials":{"anyOf":[{"title":"Basic Authentication","description":"Basic authentication, our servers will try to guess the correct IMAP/SMTP connection parameters for your IMAP provider. If this fails, an error will be returned and you should use the full authentication method.","type":"object","required":["user","password"],"properties":{"user":{"description":"Username","type":"string"},"password":{"description":"Password","type":"string"}}},{"title":"Full Authentication","description":"Full authentication, you can manually specify the IMAP/SMTP connection parameters. This is useful if the basic authentication method fails.","type":"object","required":["imap","smtp"],"properties":{"imap":{"title":"IMAP connections parameters","type":"object","allOf":[{"title":"Basic Authentication","description":"Basic authentication, our servers will try to guess the correct IMAP/SMTP connection parameters for your IMAP provider. If this fails, an error will be returned and you should use the full authentication method.","type":"object","required":["user","password"],"properties":{"user":{"description":"Username","type":"string"},"password":{"description":"Password","type":"string"}}},{"type":"object","required":["host","port"],"properties":{"host":{"description":"Server url/ip","type":"string"},"encryption":{"default":"default","description":"The encryption method to use for the connection.\n              - `tls` will use the TLS encryption method.\n              - `ssl` will use the SSL encryption method.\n              - `starttls` will use the STARTTLS encryption method.\n              - `default` will use the default encryption method for the server.","type":"string","enum":["tls","ssl","starttls","default"]},"port":{"description":"Server port","type":"number"}}}]},"smtp":{"title":"SMTP connections parameters","type":"object","allOf":[{"title":"Basic Authentication","description":"Basic authentication, our servers will try to guess the correct IMAP/SMTP connection parameters for your IMAP provider. If this fails, an error will be returned and you should use the full authentication method.","type":"object","required":["user","password"],"properties":{"user":{"description":"Username","type":"string"},"password":{"description":"Password","type":"string"}}},{"type":"object","required":["host","port"],"properties":{"host":{"description":"Server url/ip","type":"string"},"encryption":{"default":"default","description":"The encryption method to use for the connection.\n              - `tls` will use the TLS encryption method.\n              - `ssl` will use the SSL encryption method.\n              - `starttls` will use the STARTTLS encryption method.\n              - `default` will use the default encryption method for the server.","type":"string","enum":["tls","ssl","starttls","default"]},"port":{"description":"Server port","type":"number"}}}]}}}]},"config":{"additionalProperties":true,"description":"IMAP specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"initial_sync_enable":{"default":false,"description":"Whether the initial sync should be enabled. The initial sync is required to perform advanced search. Read more in the Synced Accounts guide.","type":"boolean"}}}}},{"title":"WhatsApp","description":"Start the authentication intent with WhatsApp provider.","type":"object","required":["provider","credentials"],"properties":{"provider":{"description":"The provider to authenticate with.","type":"string","enum":["whatsapp"]},"credentials":{"description":"The user credentials required by the provider to authenticate with.","type":"object","required":["qrcode"],"properties":{"qrcode":{"description":"This must be set to `true`","type":"boolean"}}},"config":{"additionalProperties":true,"description":"WhatsApp specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}}}}}},{"title":"LinkedIn","description":"Start the authentication intent with LinkedIn provider.","type":"object","required":["provider","credentials"],"properties":{"provider":{"description":"The provider to authenticate with.","type":"string","enum":["linkedin"]},"user_timezone":{"description":"The time zone of the current user can be used on a few specific features (e.g. scheduled actions). Setting it at authentication avoids having to do it on a case-by-case basis later on.","type":"string"},"credentials":{"description":"The user credentials required by the provider to authenticate with.","anyOf":[{"title":"Basic Authentication","description":"Use email and password to authenticate with LinkedIn.","type":"object","required":["username","password"],"properties":{"username":{"description":"Email or phone of the LinkedIn account.","type":"string"},"password":{"description":"Password of the LinkedIn account.","type":"string"},"user_agent":{"description":"A custom user agent if you need the session to be started from a specific browser. You can easily get it in the browser's console with this command : `console.log(navigator.userAgent)`","type":"string"}}},{"title":"Cookie Authentication","description":"Use the `li_at` and `li_a` cookies to authenticate with LinkedIn.","type":"object","required":["access_token","user_agent"],"properties":{"access_token":{"description":"The access token to authenticate with. This is the `li_at` cookie value.","type":"string"},"premium_access_token":{"description":"The access token to authenticate Recruiter or Sales Navigator with. This is the `li_a` cookie value.","type":"string"},"user_agent":{"description":"The exact user agent of the browser on which the session has been started. You can easily get it in the browser's console with this command : `console.log(navigator.userAgent)`","type":"string"}}}]},"config":{"additionalProperties":true,"description":"LinkedIn specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}},"products":{"default":["classic"],"description":"Specifies which LinkedIn products to activate. For the premium `recruiter` and `sales_navigator` products, only one can be activated per account. Also, if the account does not have an active subscription, the linking will fail.<br>When reconnecting an account, just omit this field to keep connecting the same products, or provide new values to expand or narrow the products scope. <a href=\"https://developer.unipile.com/v2.0/docs/linkedin-link-accounts\">Learn more about Linkedin products</a>\n      `classic` : LinkedIn Social network<br>\n      `recruiter` : Recruiter<br>\n      `sales_navigator` : Sales navigator<br>\n      `company` : Company Pages\n      ","anyOf":[{"title":"Including Recruiter","uniqueItems":true,"type":"array","items":{"type":"string","enum":["classic","recruiter","company"]}},{"title":"Including Sales Navigator","uniqueItems":true,"type":"array","items":{"type":"string","enum":["classic","sales_navigator","company"]}}]}}}}},{"title":"Mock","description":"Start the authentication intent with Mock provider.","type":"object","required":["provider","credentials"],"properties":{"provider":{"description":"The provider to authenticate with.","type":"string","enum":["mock"]},"credentials":{"description":"Test accounts do not have credentials, leave this as empty object.","type":"object","properties":{}}}},{"title":"Oauth (Outlook, Google)","description":"Start the authentication intent with Oauth provider.","type":"object","required":["provider","oauth_callback_redirect_uri"],"properties":{"provider":{"description":"The provider that use Oauth as authentication method.\n    - `google` is Google.\n    - `outlook` is Outlook.","type":"string","enum":["google","outlook"]},"oauth_callback_redirect_uri":{"description":"The URL to redirect to after the user has authenticated using the Provider's oAuth screen.","type":"string"},"login_hint":{"description":"Uses the hint to simplify the login flow either by prefilling the email / username / phone number field in the authentication form.","type":"string"},"config":{"additionalProperties":true,"description":"Oauth authentication configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"oauth_scope":{"minItems":1,"description":"Override of the list of authorizations to request from the Provider. Use this field to narrow the scope of API access. For example, if your application only uses the Calendar API, you may request authorization solely for the calendar, excluding email access for providers like Google. Make sure to give only authorizations accepted by your registered provider application. If left unspecified, all authorizations defined in the Provider OAuth settings section will be requested.","type":"array","items":{"minLength":1,"type":"string"}}}}}},{"title":"Telegram","description":"Start the authentication intent with Telegram provider.","type":"object","required":["provider","credentials"],"properties":{"provider":{"description":"The provider to authenticate with.","type":"string","enum":["telegram"]},"credentials":{"description":"The user credentials required by the provider to authenticate with.","type":"object","required":["qrcode"],"properties":{"qrcode":{"description":"This must be set to `true`","type":"boolean"},"twofa":{"description":"The 2FA code to authenticate with.","type":"string"}}},"config":{"additionalProperties":true,"description":"Telegram specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}}}}}},{"title":"Instagram","description":"Start the authentication intent with Instagram provider.","type":"object","required":["provider","credentials"],"properties":{"provider":{"description":"The provider to authenticate with.","type":"string","enum":["instagram"]},"credentials":{"description":"The user credentials required by the provider to authenticate with.","anyOf":[{"title":"Basic Authentication","description":"Use username and password to authenticate with Instagram.","type":"object","required":["username","password"],"properties":{"username":{"description":"The username of the Instagram account.","type":"string"},"password":{"description":"The password of the Instagram account.","type":"string"}}},{"title":"Cookie Authentication","description":"Use the `sessionid` cookie to authenticate with Instagram.","type":"object","required":["sessionid"],"properties":{"sessionid":{"description":"The sessionid cookie value.","type":"string"}}}]},"config":{"additionalProperties":true,"description":"Instagram specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}},"allow_methods":{"description":"The authentication methods to show in the hosted auth.\n          `credentials` : Credentials Authentication\n          `cookies` : Cookies Authentication\n        ","default":["credentials"],"type":"array","items":{"type":"string","enum":["credentials","cookies"]}}}}}}]},{"type":"object","properties":{"state":{"description":"State data sent in the `account.add` / `account.reconnect` webhook payload after the authentication process.","type":"string"},"account_id":{"description":"The ID of the Account to re-authenticate. Must be a disconnected account, and `provider` must match the provider of the account. If not specified, will link as new account.","type":"string","pattern":"^acc_(.*)$"}}}]}}}},"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Start auth intent","language":"node","install":"npm install unipile","code":"import { UnipileCustomAuth } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileCustomAuth = new UnipileCustomAuth({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileCustomAuth.startAuthIntent(\n  {\n    body: {\n      provider: 'imap',\n      credentials: {\n        user: 'value',\n        password: 'value',\n      },\n    },\n  }\n);"},{"name":"Start auth intent","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    custom_auth_api = unipile.CustomAuthApi(api_client)\n\nresponse = custom_auth_api.start_auth_intent(\n    {\n    'provider': 'imap',\n    'credentials': {\n      'user': 'value',\n      'password': 'value',\n    },\n  }\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"title":"Checkpoint","description":"The authentication requires a checkpoint to be solved.","type":"object","required":["object","checkpoint","intent_id"],"properties":{"object":{"type":"string","enum":["AuthenticationCheckpoint"]},"checkpoint":{"description":"The details of the checkpoint that user needs to solve.","anyOf":[{"title":"One-Time Password","description":"A one-time password was sent to the user's phone or email address. The user needs to enter the code in the next checkpoint.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["OTP"]}}},{"title":"In App Validation","description":"A notification was sent to the user's phone. The user needs to validate the notification by clicking on the link in the notification.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["IN_APP_VALIDATION"]}}},{"title":"Phone Register","description":"The user needs to register their phone number so an OTP can be sent.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["PHONE_REGISTER"]}}},{"title":"Two Factor Authentication","description":"The user needs to enter the code generated by the Authenticator App used to setup 2FA or received by SMS.","type":"object","required":["type","platform"],"properties":{"type":{"type":"string","enum":["2FA"]},"platform":{"description":"The platform of the 2FA.\n          - `SMS` means the code was sent in a SMS.\n          - `APP` means the user must enter the code generated by the Authenticator App used to setup 2FA.\n          - `WHATSAPP` means the code was sent via WhatsApp.","type":"string","enum":["SMS","APP","WHATSAPP"]}}},{"title":"Captcha","description":"The user needs to solve a captcha checkpoint.","type":"object","required":["type","public_key","data"],"properties":{"type":{"type":"string","enum":["CAPTCHA"]},"public_key":{"description":"The public key of the CAPTCHA. This is used to verify the CAPTCHA.","anyOf":[{"type":"string"},{"type":"null"}]},"data":{"description":"The data of the CAPTCHA. This is used to verify the CAPTCHA.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"title":"OTP or In App Validation","description":"The user can either enter a one-time password sent to their phone/email or validate a notification sent to their phone.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["OTP_OR_IN_APP_VALIDATION"]}}},{"title":"Contract Selection","description":"The user must pick a contract from a list to activate the correct features and complete authentication.","type":"object","required":["type","contracts"],"properties":{"type":{"type":"string","enum":["CONTRACT_SELECTION"]},"contracts":{"description":"A list of contracts to choose from.","type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"The ID of the contract.","type":"string"},"name":{"description":"The name of the contract.","type":"string"}}}}}}]},"intent_id":{"description":"The ID of the auth intent. This should be used in Solve Checkpoint.","type":"string","pattern":"^acc_(.*)$"}}},{"title":"QR Code","description":"The authentication was started for a QR Code.","type":"object","required":["object","qrcode","intent_id"],"properties":{"object":{"type":"string","enum":["AuthenticationQrCode"]},"qrcode":{"description":"The QR Code to scan.","type":"string"},"intent_id":{"description":"The ID of the auth intent. This should be used to listen for the QR Code scan with Solve Checkpoint.","type":"string","pattern":"^acc_(.*)$"}}},{"title":"Oauth URL","description":"For Oauth providers (Outlook, Google)","type":"object","required":["object","url"],"properties":{"object":{"type":"string","enum":["OauthUrl"]},"url":{"description":"The URL to redirect to start the oauth flow of the provider.","type":"string"}}},{"title":"Account","type":"object","required":["object","user_id","created_at","id","application_id","status","provider","metadata"],"properties":{"object":{"type":"string","enum":["Account"]},"user_id":{"description":"The ID of the user that owns the account for the provider.","type":"string"},"name":{"description":"The name of the account. This is usually the display name or public identifier (phone number, email address, etc.) of the user that owns the account.","type":"string"},"created_at":{"description":"The date and time the account was linked with Unipile.","type":"string"},"id":{"description":"ID of the account.","type":"string","pattern":"^acc_(.*)$"},"application_id":{"description":"ID of the parent application.","type":"string","pattern":"^app_(.*)$"},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `error` is Service Interuption.\n    - `disconnected` is Require Authentication..\n    - `paused` is Paused.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","paused"]},"provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"oauth_scope":{"description":"If the provider is OAuth, this is the scope of comma-separated permissions granted to the account.","type":"string"},"metadata":{"type":"object","properties":{"auto_proxy_country":{"description":"The chosen country for the automatic proxy selection.","type":"string"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"products_connection_status":{"description":"The status of the connection to a product, if the account is connected to multiple products.","type":"object","additionalProperties":{"type":"string","enum":["running","disconnected","errored"]}},"custom_data":{"description":"Custom data of the account. This is where you can store custom data using \"Update an account\" method.","type":"object","additionalProperties":{"type":"string"}}}},"initial_sync":{"description":"Sync details if the account has initial sync enabled.","type":"object","required":["status"],"properties":{"status":{"description":"The state of an account’s initial provider sync.\n  - `pending`sync hasn’t started yet.\n  - `running` sync is currently in progress.\n  - `failed` sync could not be completed due to an error.\n  - `completed` sync finished successfully.\n  .","type":"string","enum":["pending","running","failed","completed"]},"started_at":{"description":"The date and time the initial sync started.","type":"string"}}},"proxy":{"description":"The proxy used for the account.","type":"object","required":["country","auto_proxy"],"properties":{"country":{"description":"The country of the proxy. If null, the proxy has no defined country.","anyOf":[{"type":"string"},{"type":"null"}]},"auto_proxy":{"description":"Whether the proxy was set automatically by Unipile.","type":"boolean"},"host":{"description":"The host of the custom proxy.","type":"string"},"port":{"description":"The port of the custom proxy.","type":"number"},"username":{"description":"The username used to authenticate to the custom proxy.","type":"string"},"protocol":{"description":"The protocol of the custom proxy.","type":"string"}}}}}]}}}}}}},"/v2/auth/link":{"post":{"operationId":"createAuthLink","summary":"Create Auth Link","tags":["Hosted Auth"],"description":"Create a link to the hosted authentication wizard for the user to authenticate with the provider.","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"title":"Link new account","description":"Generate a link to authenticate and link a new account with Unipile.","type":"object","required":["expires_on","redirect_uri","providers"],"properties":{"expires_on":{"format":"date-time","description":"The expiration date of the link. Use ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ).","type":"string"},"domain":{"description":"Optional Hosted Auth hostname to use in the generated link instead of the default `auth.unipile.com`. The hostname must already be explicitly verified by Unipile for the parent Application.","type":"string"},"redirect_uri":{"format":"uri","description":"The URL to redirect to after the authentication process. If the authentication succeeded, `account_id` and `provider` will be present in query params, along the specified `state`. If the authentication has failed, `error_title` is present instead. This is useful for your app to be aware of the authentication result and to redirect the user to the correct page of your app.","type":"string"},"state":{"description":"State data sent as query parameter in the redirect_uri and in the `account.add` / `account.reconnect` webhook payload after the authentication process.","type":"string"},"config":{"description":"Specific provider configuration for the hosted auth session.","additionalProperties":false,"type":"object","properties":{"google":{"additionalProperties":true,"description":"Oauth authentication configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"oauth_scope":{"minItems":1,"description":"Override of the list of authorizations to request from the Provider. Use this field to narrow the scope of API access. For example, if your application only uses the Calendar API, you may request authorization solely for the calendar, excluding email access for providers like Google. Make sure to give only authorizations accepted by your registered provider application. If left unspecified, all authorizations defined in the Provider OAuth settings section will be requested.","type":"array","items":{"minLength":1,"type":"string"}}}},"outlook":{"additionalProperties":true,"description":"Oauth authentication configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"oauth_scope":{"minItems":1,"description":"Override of the list of authorizations to request from the Provider. Use this field to narrow the scope of API access. For example, if your application only uses the Calendar API, you may request authorization solely for the calendar, excluding email access for providers like Google. Make sure to give only authorizations accepted by your registered provider application. If left unspecified, all authorizations defined in the Provider OAuth settings section will be requested.","type":"array","items":{"minLength":1,"type":"string"}}}},"linkedin":{"additionalProperties":false,"description":"LinkedIn specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}},"products":{"default":["classic"],"description":"Specifies which LinkedIn products to activate. For the premium `recruiter` and `sales_navigator` products, only one can be activated per account. Also, if the account does not have an active subscription, the linking will fail.<br>When reconnecting an account, just omit this field to keep connecting the same products, or provide new values to expand or narrow the products scope. <a href=\"https://developer.unipile.com/v2.0/docs/linkedin-link-accounts\">Learn more about Linkedin products</a>\n      `classic` : LinkedIn Social network<br>\n      `recruiter` : Recruiter<br>\n      `sales_navigator` : Sales navigator<br>\n      `company` : Company Pages\n      ","anyOf":[{"title":"Including Recruiter","uniqueItems":true,"type":"array","items":{"type":"string","enum":["classic","recruiter","company"]}},{"title":"Including Sales Navigator","uniqueItems":true,"type":"array","items":{"type":"string","enum":["classic","sales_navigator","company"]}}]},"allow_methods":{"description":"The authentication methods to show in the hosted auth.\n            `credentials` : Credentials Authentication\n            `cookies` : Cookies Authentication\n          ","default":["credentials"],"type":"array","items":{"type":"string","enum":["credentials","cookies"]}}}},"whatsapp":{"additionalProperties":true,"description":"WhatsApp specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}}}},"instagram":{"additionalProperties":true,"description":"Instagram specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}},"allow_methods":{"description":"The authentication methods to show in the hosted auth.\n          `credentials` : Credentials Authentication\n          `cookies` : Cookies Authentication\n        ","default":["credentials"],"type":"array","items":{"type":"string","enum":["credentials","cookies"]}}}},"imap":{"additionalProperties":true,"description":"IMAP specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"initial_sync_enable":{"default":false,"description":"Whether the initial sync should be enabled. The initial sync is required to perform advanced search. Read more in the Synced Accounts guide.","type":"boolean"}}},"telegram":{"additionalProperties":true,"description":"Telegram specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}}}},"global":{"description":"Configuration applied to all providers","additionalProperties":false,"type":"object","properties":{"login_hint":{"description":"If your application knows which user is trying to authenticate, it can use this parameter to provide a hint to the Hosted Auth. It uses the hint to simplify the login flow either by prefilling the email / username / phone number field in the authentication forms.","type":"string"},"allow_user_proxy_override":{"default":false,"description":"If true, the Hosted Auth UI will show a field where the user can provide their own proxy settings. When filled, the user-defined proxy takes precedence over any custom_proxy defined in the configuration and over automatic proxy detection (if the provider supports it).","type":"boolean"},"allow_user_country_override":{"default":false,"description":"If true, the Hosted Auth UI will allow the user to manually select a country for automatic proxy configuration (when supported by the provider). This selection overrides the detected country and any auto_proxy_config value. Note: if a custom_proxy is explicitly configured for a provider, this option has no effect for that provider (no country selection will be shown).","type":"boolean"},"wait_initial_sync":{"default":false,"description":"When true, the hosted authentication will wait for the initial sync to complete before redirecting. Only supported for providers with initial sync capability (whatsapp and imap). The hosted UI will display a loading screen until the initial sync is completed.","type":"boolean"}}}}},"providers":{"description":"Required to link a new account with Unipile. The list of providers to show in the selection list.\n        - `*` to list all providers.\n        - `*:EMAILS` to list providers with Emails API support only.\n        - `*:MESSAGING` to list providers with Messaging API support only.\n        - `*:CALENDAR` to list providers with Calendar API support only.\n        - `*:SOCIAL` to list providers with Social API (Users, Posts, etc.) support only.\n        - a specific provider to list only that provider.\n        - give an array of specific providers.","anyOf":[{"default":"*","type":"string","enum":["*","*:MESSAGING","*:EMAILS","*:CALENDAR","*:SOCIAL","linkedin","mock","whatsapp","google","outlook","imap","telegram","instagram"]},{"type":"array","items":{"type":"string","enum":["linkedin","mock","whatsapp","google","outlook","imap","telegram","instagram"]}}]}}},{"title":"Re-authenticate existing account","description":"Generate a link to re-authenticate an existing account with Unipile.","type":"object","required":["expires_on","redirect_uri","account_id"],"properties":{"expires_on":{"format":"date-time","description":"The expiration date of the link. Use ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ).","type":"string"},"domain":{"description":"Optional Hosted Auth hostname to use in the generated link instead of the default `auth.unipile.com`. The hostname must already be explicitly verified by Unipile for the parent Application.","type":"string"},"redirect_uri":{"format":"uri","description":"The URL to redirect to after the authentication process. If the authentication succeeded, `account_id` and `provider` will be present in query params, along the specified `state`. If the authentication has failed, `error_title` is present instead. This is useful for your app to be aware of the authentication result and to redirect the user to the correct page of your app.","type":"string"},"state":{"description":"State data sent as query parameter in the redirect_uri and in the `account.add` / `account.reconnect` webhook payload after the authentication process.","type":"string"},"config":{"description":"Specific provider configuration for the hosted auth session.","additionalProperties":false,"type":"object","properties":{"google":{"additionalProperties":true,"description":"Oauth authentication configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"oauth_scope":{"minItems":1,"description":"Override of the list of authorizations to request from the Provider. Use this field to narrow the scope of API access. For example, if your application only uses the Calendar API, you may request authorization solely for the calendar, excluding email access for providers like Google. Make sure to give only authorizations accepted by your registered provider application. If left unspecified, all authorizations defined in the Provider OAuth settings section will be requested.","type":"array","items":{"minLength":1,"type":"string"}}}},"outlook":{"additionalProperties":true,"description":"Oauth authentication configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"oauth_scope":{"minItems":1,"description":"Override of the list of authorizations to request from the Provider. Use this field to narrow the scope of API access. For example, if your application only uses the Calendar API, you may request authorization solely for the calendar, excluding email access for providers like Google. Make sure to give only authorizations accepted by your registered provider application. If left unspecified, all authorizations defined in the Provider OAuth settings section will be requested.","type":"array","items":{"minLength":1,"type":"string"}}}},"linkedin":{"additionalProperties":false,"description":"LinkedIn specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}},"products":{"default":["classic"],"description":"Specifies which LinkedIn products to activate. For the premium `recruiter` and `sales_navigator` products, only one can be activated per account. Also, if the account does not have an active subscription, the linking will fail.<br>When reconnecting an account, just omit this field to keep connecting the same products, or provide new values to expand or narrow the products scope. <a href=\"https://developer.unipile.com/v2.0/docs/linkedin-link-accounts\">Learn more about Linkedin products</a>\n      `classic` : LinkedIn Social network<br>\n      `recruiter` : Recruiter<br>\n      `sales_navigator` : Sales navigator<br>\n      `company` : Company Pages\n      ","anyOf":[{"title":"Including Recruiter","uniqueItems":true,"type":"array","items":{"type":"string","enum":["classic","recruiter","company"]}},{"title":"Including Sales Navigator","uniqueItems":true,"type":"array","items":{"type":"string","enum":["classic","sales_navigator","company"]}}]},"allow_methods":{"description":"The authentication methods to show in the hosted auth.\n            `credentials` : Credentials Authentication\n            `cookies` : Cookies Authentication\n          ","default":["credentials"],"type":"array","items":{"type":"string","enum":["credentials","cookies"]}}}},"whatsapp":{"additionalProperties":true,"description":"WhatsApp specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}}}},"instagram":{"additionalProperties":true,"description":"Instagram specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"auto_proxy_config":{"description":"Configuration to infer the automatically allocated proxy's location. If not provided, Unipile will dynamically infer the proxy's location based on the public IP of the service, when a problem is detected with another proxy, and it would not be possible to automatically infer the proxy's location from the public IP.","title":"Automatic proxy configuration","type":"object","properties":{"country":{"description":"An ISO 3166-1 A-2 country code to be set as automatic proxy's location.","type":"string"},"ip":{"description":"An IPv4 address to infer proxy's location.","type":"string"}}},"allow_methods":{"description":"The authentication methods to show in the hosted auth.\n          `credentials` : Credentials Authentication\n          `cookies` : Cookies Authentication\n        ","default":["credentials"],"type":"array","items":{"type":"string","enum":["credentials","cookies"]}}}},"imap":{"additionalProperties":true,"description":"IMAP specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},"initial_sync_enable":{"default":false,"description":"Whether the initial sync should be enabled. The initial sync is required to perform advanced search. Read more in the Synced Accounts guide.","type":"boolean"}}},"telegram":{"additionalProperties":true,"description":"Telegram specific configuration.","type":"object","properties":{"custom_proxy":{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}}}},"global":{"description":"Configuration applied to all providers","additionalProperties":false,"type":"object","properties":{"login_hint":{"description":"If your application knows which user is trying to authenticate, it can use this parameter to provide a hint to the Hosted Auth. It uses the hint to simplify the login flow either by prefilling the email / username / phone number field in the authentication forms.","type":"string"},"allow_user_proxy_override":{"default":false,"description":"If true, the Hosted Auth UI will show a field where the user can provide their own proxy settings. When filled, the user-defined proxy takes precedence over any custom_proxy defined in the configuration and over automatic proxy detection (if the provider supports it).","type":"boolean"},"allow_user_country_override":{"default":false,"description":"If true, the Hosted Auth UI will allow the user to manually select a country for automatic proxy configuration (when supported by the provider). This selection overrides the detected country and any auto_proxy_config value. Note: if a custom_proxy is explicitly configured for a provider, this option has no effect for that provider (no country selection will be shown).","type":"boolean"},"wait_initial_sync":{"default":false,"description":"When true, the hosted authentication will wait for the initial sync to complete before redirecting. Only supported for providers with initial sync capability (whatsapp and imap). The hosted UI will display a loading screen until the initial sync is completed.","type":"boolean"}}}}},"account_id":{"description":"Required to re-authenticate an existing account. The ID of the Account to re-authenticate.","type":"string","pattern":"^acc_(.*)$"}}}]}}}},"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Create auth link","language":"node","install":"npm install unipile","code":"import { UnipileHostedAuth } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileHostedAuth = new UnipileHostedAuth({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileHostedAuth.createAuthLink(\n  {\n    body: {\n      expires_on: 'value',\n      redirect_uri: 'https://myapp.com/callback',\n      providers: '*',\n    },\n  }\n);"},{"name":"Create auth link","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    hosted_auth_api = unipile.HostedAuthApi(api_client)\n\nresponse = hosted_auth_api.create_auth_link(\n    {\n    'expires_on': 'value',\n    'redirect_uri': 'https://myapp.com/callback',\n    'providers': '*',\n  }\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","link"],"properties":{"object":{"type":"string","enum":["HostedAuthLink"]},"link":{"description":"Link to the Hosted Auth session. Redirect your users to this link so they can authenticate their account. If you use a white-label domain, only replace the hostname with a domain that has been explicitly verified by Unipile for the parent Application.","type":"string"}}}}}}}}},"/v2/accounts/{account_id}":{"get":{"operationId":"getAccount","summary":"Get an Account","tags":["Accounts"],"description":"Retrieve an Account.","parameters":[{"schema":{"type":"string","pattern":"^acc_(.*)$"},"in":"path","name":"account_id","required":true}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Get account","language":"node","install":"npm install unipile","code":"import { UnipileAccounts } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileAccounts = new UnipileAccounts({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileAccounts.getAccount(\n  {\n    path: {\n      account_id: ACCOUNT_ID,\n    },\n  }\n);"},{"name":"Get account","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    accounts_api = unipile.AccountsApi(api_client)\n\nresponse = accounts_api.get_account(\n    ACCOUNT_ID\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"title":"Account","type":"object","required":["object","user_id","created_at","id","application_id","status","provider","metadata"],"properties":{"object":{"type":"string","enum":["Account"]},"user_id":{"description":"The ID of the user that owns the account for the provider.","type":"string"},"name":{"description":"The name of the account. This is usually the display name or public identifier (phone number, email address, etc.) of the user that owns the account.","type":"string"},"created_at":{"description":"The date and time the account was linked with Unipile.","type":"string"},"id":{"description":"ID of the account.","type":"string","pattern":"^acc_(.*)$"},"application_id":{"description":"ID of the parent application.","type":"string","pattern":"^app_(.*)$"},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `error` is Service Interuption.\n    - `disconnected` is Require Authentication..\n    - `paused` is Paused.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","paused"]},"provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"oauth_scope":{"description":"If the provider is OAuth, this is the scope of comma-separated permissions granted to the account.","type":"string"},"metadata":{"type":"object","properties":{"auto_proxy_country":{"description":"The chosen country for the automatic proxy selection.","type":"string"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"products_connection_status":{"description":"The status of the connection to a product, if the account is connected to multiple products.","type":"object","additionalProperties":{"type":"string","enum":["running","disconnected","errored"]}},"custom_data":{"description":"Custom data of the account. This is where you can store custom data using \"Update an account\" method.","type":"object","additionalProperties":{"type":"string"}}}},"initial_sync":{"description":"Sync details if the account has initial sync enabled.","type":"object","required":["status"],"properties":{"status":{"description":"The state of an account’s initial provider sync.\n  - `pending`sync hasn’t started yet.\n  - `running` sync is currently in progress.\n  - `failed` sync could not be completed due to an error.\n  - `completed` sync finished successfully.\n  .","type":"string","enum":["pending","running","failed","completed"]},"started_at":{"description":"The date and time the initial sync started.","type":"string"}}},"proxy":{"description":"The proxy used for the account.","type":"object","required":["country","auto_proxy"],"properties":{"country":{"description":"The country of the proxy. If null, the proxy has no defined country.","anyOf":[{"type":"string"},{"type":"null"}]},"auto_proxy":{"description":"Whether the proxy was set automatically by Unipile.","type":"boolean"},"host":{"description":"The host of the custom proxy.","type":"string"},"port":{"description":"The port of the custom proxy.","type":"number"},"username":{"description":"The username used to authenticate to the custom proxy.","type":"string"},"protocol":{"description":"The protocol of the custom proxy.","type":"string"}}}}}}}}}},"delete":{"operationId":"removeAccount","summary":"Remove an Account","tags":["Accounts"],"description":"Remove an Account from Unipile by its ID. This action is irreversible and will remove all data associated with the Account.","parameters":[{"schema":{"type":"string","pattern":"^acc_(.*)$"},"in":"path","name":"account_id","required":true,"description":"The ID of the Account to remove."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Remove account","language":"node","install":"npm install unipile","code":"import { UnipileAccounts } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileAccounts = new UnipileAccounts({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileAccounts.removeAccount(\n  {\n    path: {\n      account_id: ACCOUNT_ID,\n    },\n  }\n);"},{"name":"Remove account","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    accounts_api = unipile.AccountsApi(api_client)\n\nresponse = accounts_api.remove_account(\n    ACCOUNT_ID\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}}}},"patch":{"operationId":"updateAccount","summary":"Update an Account","tags":["Accounts"],"description":"Update an Account by ID.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"metadata":{"description":"Custom key-value data for the account. Replaces the account `metadata.custom_data` field; other metadata fields are not modified. Any fields not provided will be removed.","type":"object","additionalProperties":{"type":"string"}},"proxy":{"description":"A new proxy configuration for the account. This will restart the account. Set to `null` to remove the proxy. Removing the proxy will revert the account to using Automatic Proxy Protection if required for the provider.","anyOf":[{"title":"Custom proxy","description":"A custom proxy to connect through to the account provider. For supported providers, if not given, Unipile will automatically manage the proxy. In this case, the given custom proxy will override the automatic proxy. Read more about it in the Proxy documentation.","type":"object","required":["host","port"],"properties":{"host":{"description":"The host of the proxy.","type":"string"},"port":{"description":"The port of the proxy.","type":"number"},"username":{"description":"The username to connect to the proxy.","type":"string"},"password":{"description":"The password to connect to the proxy.","type":"string"},"protocol":{"default":"https","description":"The protocol of the proxy. Defaults to `https`.\n        - `https` is HTTPS.\n        - `http` is HTTP.\n          - `socks5` is SOCKS5.\n          - `socks4` is SOCKS4.","type":"string","enum":["https","http","socks5","socks4"]}}},{"type":"null"}]}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^acc_(.*)$"},"in":"path","name":"account_id","required":true,"description":"The ID of the Account to update."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Update account","language":"node","install":"npm install unipile","code":"import { UnipileAccounts } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileAccounts = new UnipileAccounts({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileAccounts.updateAccount(\n  {\n    path: {\n      account_id: ACCOUNT_ID,\n    },\n    body: {\n      metadata: {\n        key: 'value',\n      },\n    },\n  }\n);"},{"name":"Update account","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    accounts_api = unipile.AccountsApi(api_client)\n\nresponse = accounts_api.update_account(\n    ACCOUNT_ID,\n    {\n    'metadata': {\n      'key': 'value',\n    },\n  }\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"title":"Account","type":"object","required":["object","user_id","created_at","id","application_id","status","provider","metadata"],"properties":{"object":{"type":"string","enum":["Account"]},"user_id":{"description":"The ID of the user that owns the account for the provider.","type":"string"},"name":{"description":"The name of the account. This is usually the display name or public identifier (phone number, email address, etc.) of the user that owns the account.","type":"string"},"created_at":{"description":"The date and time the account was linked with Unipile.","type":"string"},"id":{"description":"ID of the account.","type":"string","pattern":"^acc_(.*)$"},"application_id":{"description":"ID of the parent application.","type":"string","pattern":"^app_(.*)$"},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `error` is Service Interuption.\n    - `disconnected` is Require Authentication..\n    - `paused` is Paused.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","paused"]},"provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"oauth_scope":{"description":"If the provider is OAuth, this is the scope of comma-separated permissions granted to the account.","type":"string"},"metadata":{"type":"object","properties":{"auto_proxy_country":{"description":"The chosen country for the automatic proxy selection.","type":"string"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"products_connection_status":{"description":"The status of the connection to a product, if the account is connected to multiple products.","type":"object","additionalProperties":{"type":"string","enum":["running","disconnected","errored"]}},"custom_data":{"description":"Custom data of the account. This is where you can store custom data using \"Update an account\" method.","type":"object","additionalProperties":{"type":"string"}}}},"initial_sync":{"description":"Sync details if the account has initial sync enabled.","type":"object","required":["status"],"properties":{"status":{"description":"The state of an account’s initial provider sync.\n  - `pending`sync hasn’t started yet.\n  - `running` sync is currently in progress.\n  - `failed` sync could not be completed due to an error.\n  - `completed` sync finished successfully.\n  .","type":"string","enum":["pending","running","failed","completed"]},"started_at":{"description":"The date and time the initial sync started.","type":"string"}}},"proxy":{"description":"The proxy used for the account.","type":"object","required":["country","auto_proxy"],"properties":{"country":{"description":"The country of the proxy. If null, the proxy has no defined country.","anyOf":[{"type":"string"},{"type":"null"}]},"auto_proxy":{"description":"Whether the proxy was set automatically by Unipile.","type":"boolean"},"host":{"description":"The host of the custom proxy.","type":"string"},"port":{"description":"The port of the custom proxy.","type":"number"},"username":{"description":"The username used to authenticate to the custom proxy.","type":"string"},"protocol":{"description":"The protocol of the custom proxy.","type":"string"}}}}}}}}}}},"/v2/accounts/":{"get":{"operationId":"listAccounts","summary":"List all Accounts","tags":["Accounts"],"description":"Returns a list of all Accounts associated with the current Application. The accounts are returned sorted alphabeticaly on `name`.","parameters":[{"schema":{"type":"string","enum":["running","errored","disconnected","paused"]},"in":"query","name":"status","required":false,"description":"Filter to return only accounts of the given status."},{"schema":{"type":"string","enum":["linkedin","mock","whatsapp","google","outlook","imap","telegram","instagram"]},"in":"query","name":"provider","required":false,"description":"Filter to return only accounts of the given provider.\n        - `mock` is mock.\n        - `whatsapp` is WhatsApp.\n        - `linkedin` is LinkedIn.\n        - `instagram` is Instagram.\n        - `google` is Google.\n        - `outlook` is Outlook.\n        - `telegram` is Telegram.\n        - `imap` is IMAP."},{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Filter to return only accounts matching the given search term on `name` or `id`."},{"schema":{"type":"string"},"in":"query","name":"offset","required":false,"description":"An offset used for pagination."},{"schema":{"default":"20","type":"string"},"in":"query","name":"limit","required":false,"description":"The limit of items to be returned."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"List accounts","language":"node","install":"npm install unipile","code":"import { UnipileAccounts } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileAccounts = new UnipileAccounts({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileAccounts.listAccounts();"},{"name":"List accounts","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    accounts_api = unipile.AccountsApi(api_client)\n\nresponse = accounts_api.list_accounts()"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"type":"string","enum":["Accounts"]},"data":{"type":"array","items":{"title":"Account","type":"object","required":["object","user_id","created_at","id","application_id","status","provider","metadata"],"properties":{"object":{"type":"string","enum":["Account"]},"user_id":{"description":"The ID of the user that owns the account for the provider.","type":"string"},"name":{"description":"The name of the account. This is usually the display name or public identifier (phone number, email address, etc.) of the user that owns the account.","type":"string"},"created_at":{"description":"The date and time the account was linked with Unipile.","type":"string"},"id":{"description":"ID of the account.","type":"string","pattern":"^acc_(.*)$"},"application_id":{"description":"ID of the parent application.","type":"string","pattern":"^app_(.*)$"},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `error` is Service Interuption.\n    - `disconnected` is Require Authentication..\n    - `paused` is Paused.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","paused"]},"provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"oauth_scope":{"description":"If the provider is OAuth, this is the scope of comma-separated permissions granted to the account.","type":"string"},"metadata":{"type":"object","properties":{"auto_proxy_country":{"description":"The chosen country for the automatic proxy selection.","type":"string"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"products_connection_status":{"description":"The status of the connection to a product, if the account is connected to multiple products.","type":"object","additionalProperties":{"type":"string","enum":["running","disconnected","errored"]}},"custom_data":{"description":"Custom data of the account. This is where you can store custom data using \"Update an account\" method.","type":"object","additionalProperties":{"type":"string"}}}},"initial_sync":{"description":"Sync details if the account has initial sync enabled.","type":"object","required":["status"],"properties":{"status":{"description":"The state of an account’s initial provider sync.\n  - `pending`sync hasn’t started yet.\n  - `running` sync is currently in progress.\n  - `failed` sync could not be completed due to an error.\n  - `completed` sync finished successfully.\n  .","type":"string","enum":["pending","running","failed","completed"]},"started_at":{"description":"The date and time the initial sync started.","type":"string"}}},"proxy":{"description":"The proxy used for the account.","type":"object","required":["country","auto_proxy"],"properties":{"country":{"description":"The country of the proxy. If null, the proxy has no defined country.","anyOf":[{"type":"string"},{"type":"null"}]},"auto_proxy":{"description":"Whether the proxy was set automatically by Unipile.","type":"boolean"},"host":{"description":"The host of the custom proxy.","type":"string"},"port":{"description":"The port of the custom proxy.","type":"number"},"username":{"description":"The username used to authenticate to the custom proxy.","type":"string"},"protocol":{"description":"The protocol of the custom proxy.","type":"string"}}}}}},"has_more":{"description":"Whether there are more accounts to fetch.","type":"boolean"}}}}}}}}},"/v2/webhooks/conversations/":{"get":{"operationId":"listWebhookConversations","summary":"List all Webhook Conversations","tags":["Webhooks"],"description":"Returns a list of all Webhook Conversations associated with the current Application. The conversations are returned sorted by their creation date, with the most recent appearing first.","parameters":[{"schema":{"type":"string","pattern":"^we_(.*)$"},"in":"query","name":"endpoint_id","required":true,"description":"Filter to return only conversations for the given endpoint."},{"schema":{"type":"string","pattern":"^evt_(.*)$"},"in":"query","name":"event_id","required":false,"description":"Filter to return only conversations for the given event."},{"schema":{"type":"string"},"in":"query","name":"offset","required":false,"description":"An offset used for pagination."},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"A limit used for pagination."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"List webhook conversations","language":"node","install":"npm install unipile","code":"import { UnipileWebhooks } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileWebhooks = new UnipileWebhooks({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileWebhooks.listWebhookConversations(\n  {\n    query: {\n      endpoint_id: 'we_123456789',\n    },\n  }\n);"},{"name":"List webhook conversations","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    webhooks_api = unipile.WebhooksApi(api_client)\n\nresponse = webhooks_api.list_webhook_conversations(\n    'we_123456789'\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"type":"string","enum":["WebhookConversations"]},"data":{"type":"array","items":{"type":"object","required":["first_attempt","event_type","created_at","http_status","endpoint_url","response_body","object","id","endpoint_id","event_id"],"properties":{"first_attempt":{"type":"boolean"},"event_type":{"maxLength":255,"type":"string"},"created_at":{"type":"string"},"http_status":{"anyOf":[{"minimum":-2147483648,"maximum":2147483647,"type":"integer"},{"type":"null"}]},"endpoint_url":{"type":"string"},"response_body":{"anyOf":[{"type":"string"},{"type":"null"}]},"object":{"type":"string","enum":["WebhookConversation"]},"id":{"type":"string","pattern":"^wc_(.*)$"},"endpoint_id":{"type":"string","pattern":"^we_(.*)$"},"event_id":{"type":"string","pattern":"^evt_(.*)$"}}}},"has_more":{"type":"boolean"}}}}}}}}},"/v2/webhooks/endpoints/":{"post":{"operationId":"createWebhookEndpoint","summary":"Create a Webhook Endpoint","tags":["Webhooks"],"description":"Creates a new webhook endpoint.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["trigger_events","url"],"properties":{"trigger_events":{"description":"The events that will trigger the webhook endpoint.\n      Refer to [Events Types](https://developer.unipile.com/v2.0/reference/event-types-1) to see the list of available values.","type":"array","items":{"type":"string","enum":["account.status.disconnected","account.status.running","account.status.errored","account.status.paused","account.add","account.reconnect","account.remove","account.initial_sync.running","account.initial_sync.failed","account.initial_sync.completed","message.new","message.update","message.delete","message.receipt.read","message.receipt.delivery","message.reaction.new","chat.delete","chat.update","email.new","email.new.bounce","email.delete","email.draft.new","email.draft.delete","email.folder.create","email.folder.update","email.folder.delete","calendar.create","calendar.update","calendar.delete","calendar.event.new","calendar.event.update","calendar.event.delete","tracking.open","tracking.click","relation.request.accept","relation.new"]}},"account_ids":{"description":"Restrict the webhook to specific accounts. Leave empty or omit the field to listen to events from every account in the application.","type":"array","items":{"type":"string","pattern":"^acc_(.*)$"}},"url":{"description":"The HTTP or HTTPS URL to send the webhook payload to.","format":"uri","maxLength":255,"pattern":"^https?://","type":"string"},"description":{"description":"A description of the webhook endpoint.","maxLength":255,"type":"string"}}}}},"required":true},"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Create webhook endpoint","language":"node","install":"npm install unipile","code":"import { UnipileWebhooks } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileWebhooks = new UnipileWebhooks({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileWebhooks.createWebhookEndpoint(\n  {\n    body: {\n      trigger_events: ['account.add'],\n      url: 'https://myapp.com/callback',\n    },\n  }\n);"},{"name":"Create webhook endpoint","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    webhooks_api = unipile.WebhooksApi(api_client)\n\nresponse = webhooks_api.create_webhook_endpoint(\n    {\n    'trigger_events': ['account.add'],\n    'url': 'https://myapp.com/callback',\n  }\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","description","url","trigger_events","secret","object","id","application_id","account_ids","account_targets"],"properties":{"enabled":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"},"trigger_events":{"type":"array","items":{"type":"string","enum":["account.status.disconnected","account.status.running","account.status.errored","account.status.paused","account.add","account.reconnect","account.remove","account.initial_sync.running","account.initial_sync.failed","account.initial_sync.completed","message.new","message.update","message.delete","message.receipt.read","message.receipt.delivery","message.reaction.new","chat.delete","chat.update","email.new","email.new.bounce","email.delete","email.draft.new","email.draft.delete","email.folder.create","email.folder.update","email.folder.delete","calendar.create","calendar.update","calendar.delete","calendar.event.new","calendar.event.update","calendar.event.delete","tracking.open","tracking.click","relation.request.accept","relation.new"]}},"secret":{"maxLength":36,"type":"string"},"object":{"type":"string","enum":["WebhookEndpoint"]},"id":{"type":"string","pattern":"^we_(.*)$"},"application_id":{"type":"string","pattern":"^app_(.*)$"},"account_ids":{"type":"array","items":{"type":"string","pattern":"^acc_(.*)$"}},"account_targets":{"type":"array","items":{"type":"object","required":["account_name","account_provider","object","id","status"],"properties":{"account_name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"account_provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"object":{"type":"string","enum":["WebhookEndpointAccountTarget"]},"id":{"type":"string","pattern":"^acc_(.*)$"},"status":{"type":"string","enum":["active","deleted"]}}}}}}}}}}},"get":{"operationId":"listWebhookEndpoints","summary":"List all Webhook Endpoints","tags":["Webhooks"],"description":"Returns a list of all Webhook Endpoints associated with the current Application.","parameters":[{"schema":{"type":"string"},"in":"query","name":"offset","required":false,"description":"An offset used for pagination."},{"schema":{"default":"20","type":"string"},"in":"query","name":"limit","required":false,"description":"The limit of items to be returned."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"List webhook endpoints","language":"node","install":"npm install unipile","code":"import { UnipileWebhooks } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileWebhooks = new UnipileWebhooks({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileWebhooks.listWebhookEndpoints();"},{"name":"List webhook endpoints","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    webhooks_api = unipile.WebhooksApi(api_client)\n\nresponse = webhooks_api.list_webhook_endpoints()"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"type":"string","enum":["WebhookEndpoints"]},"data":{"type":"array","items":{"type":"object","required":["enabled","description","url","trigger_events","secret","object","id","application_id","account_ids","account_targets"],"properties":{"enabled":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"},"trigger_events":{"type":"array","items":{"type":"string","enum":["account.status.disconnected","account.status.running","account.status.errored","account.status.paused","account.add","account.reconnect","account.remove","account.initial_sync.running","account.initial_sync.failed","account.initial_sync.completed","message.new","message.update","message.delete","message.receipt.read","message.receipt.delivery","message.reaction.new","chat.delete","chat.update","email.new","email.new.bounce","email.delete","email.draft.new","email.draft.delete","email.folder.create","email.folder.update","email.folder.delete","calendar.create","calendar.update","calendar.delete","calendar.event.new","calendar.event.update","calendar.event.delete","tracking.open","tracking.click","relation.request.accept","relation.new"]}},"secret":{"maxLength":36,"type":"string"},"object":{"type":"string","enum":["WebhookEndpoint"]},"id":{"type":"string","pattern":"^we_(.*)$"},"application_id":{"type":"string","pattern":"^app_(.*)$"},"account_ids":{"type":"array","items":{"type":"string","pattern":"^acc_(.*)$"}},"account_targets":{"type":"array","items":{"type":"object","required":["account_name","account_provider","object","id","status"],"properties":{"account_name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"account_provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"object":{"type":"string","enum":["WebhookEndpointAccountTarget"]},"id":{"type":"string","pattern":"^acc_(.*)$"},"status":{"type":"string","enum":["active","deleted"]}}}}}}},"has_more":{"type":"boolean"}}}}}}}}},"/v2/webhooks/endpoints/{id}":{"patch":{"operationId":"updateWebhookEndpoint","summary":"Update a Webhook Endpoint","tags":["Webhooks"],"description":"Updates a webhook endpoint by ID.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"trigger_events":{"description":"The events that will trigger the webhook endpoint.\n          Refer to [Events Types](https://developer.unipile.com/v2.0/reference/event-types-1) to see the list of available values.","type":"array","items":{"type":"string","enum":["account.status.disconnected","account.status.running","account.status.errored","account.status.paused","account.add","account.reconnect","account.remove","account.initial_sync.running","account.initial_sync.failed","account.initial_sync.completed","message.new","message.update","message.delete","message.receipt.read","message.receipt.delivery","message.reaction.new","chat.delete","chat.update","email.new","email.new.bounce","email.delete","email.draft.new","email.draft.delete","email.folder.create","email.folder.update","email.folder.delete","calendar.create","calendar.update","calendar.delete","calendar.event.new","calendar.event.update","calendar.event.delete","tracking.open","tracking.click","relation.request.accept","relation.new"]}},"account_ids":{"description":"Restrict the webhook to specific accounts. Leave empty or omit the field to listen to events from every account in the application.","type":"array","items":{"type":"string","pattern":"^acc_(.*)$"}},"url":{"description":"The HTTP or HTTPS URL to send the webhook payload to.","format":"uri","maxLength":255,"pattern":"^https?://","type":"string"},"description":{"description":"A description of the webhook endpoint.","maxLength":255,"type":"string"},"enabled":{"description":"Whether the webhook endpoint is enabled.","type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^we_(.*)$"},"in":"path","name":"id","required":true,"description":"The ID of the Webhook Endpoint to update."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Update webhook endpoint","language":"node","install":"npm install unipile","code":"import { UnipileWebhooks } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileWebhooks = new UnipileWebhooks({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileWebhooks.updateWebhookEndpoint(\n  {\n    path: {\n      id: 'we_123456789',\n    },\n    body: {\n      trigger_events: ['account.add'],\n    },\n  }\n);"},{"name":"Update webhook endpoint","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    webhooks_api = unipile.WebhooksApi(api_client)\n\nresponse = webhooks_api.update_webhook_endpoint(\n    'we_123456789',\n    {\n    'trigger_events': ['account.add'],\n  }\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","description","url","trigger_events","secret","object","id","application_id","account_ids","account_targets"],"properties":{"enabled":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"},"trigger_events":{"type":"array","items":{"type":"string","enum":["account.status.disconnected","account.status.running","account.status.errored","account.status.paused","account.add","account.reconnect","account.remove","account.initial_sync.running","account.initial_sync.failed","account.initial_sync.completed","message.new","message.update","message.delete","message.receipt.read","message.receipt.delivery","message.reaction.new","chat.delete","chat.update","email.new","email.new.bounce","email.delete","email.draft.new","email.draft.delete","email.folder.create","email.folder.update","email.folder.delete","calendar.create","calendar.update","calendar.delete","calendar.event.new","calendar.event.update","calendar.event.delete","tracking.open","tracking.click","relation.request.accept","relation.new"]}},"secret":{"maxLength":36,"type":"string"},"object":{"type":"string","enum":["WebhookEndpoint"]},"id":{"type":"string","pattern":"^we_(.*)$"},"application_id":{"type":"string","pattern":"^app_(.*)$"},"account_ids":{"type":"array","items":{"type":"string","pattern":"^acc_(.*)$"}},"account_targets":{"type":"array","items":{"type":"object","required":["account_name","account_provider","object","id","status"],"properties":{"account_name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"account_provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"object":{"type":"string","enum":["WebhookEndpointAccountTarget"]},"id":{"type":"string","pattern":"^acc_(.*)$"},"status":{"type":"string","enum":["active","deleted"]}}}}}}}}}}},"delete":{"operationId":"deleteWebhookEndpoint","summary":"Delete a Webhook Endpoint","tags":["Webhooks"],"description":"Deletes a webhook endpoint by ID.","parameters":[{"schema":{"type":"string","pattern":"^we_(.*)$"},"in":"path","name":"id","required":true,"description":"The ID of the Webhook Endpoint to delete."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Delete webhook endpoint","language":"node","install":"npm install unipile","code":"import { UnipileWebhooks } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileWebhooks = new UnipileWebhooks({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileWebhooks.deleteWebhookEndpoint(\n  {\n    path: {\n      id: 'we_123456789',\n    },\n  }\n);"},{"name":"Delete webhook endpoint","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    webhooks_api = unipile.WebhooksApi(api_client)\n\nresponse = webhooks_api.delete_webhook_endpoint(\n    'we_123456789'\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}}}},"get":{"operationId":"getWebhookEndpoint","summary":"Get a Webhook Endpoint","tags":["Webhooks"],"description":"Retrieves a webhook endpoint by ID.","parameters":[{"schema":{"type":"string","pattern":"^we_(.*)$"},"in":"path","name":"id","required":true,"description":"The ID of the Webhook Endpoint to retrieve."}],"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Get webhook endpoint","language":"node","install":"npm install unipile","code":"import { UnipileWebhooks } from 'unipile';\n\nconst ACCOUNT_ID = 'acc_123456789';\n\nconst unipileWebhooks = new UnipileWebhooks({ key: 'YOUR_API_KEY' });\n\nconst { data } = await unipileWebhooks.getWebhookEndpoint(\n  {\n    path: {\n      id: 'we_123456789',\n    },\n  }\n);"},{"name":"Get webhook endpoint","language":"python","install":"pip install git+https://github.com/unipile/unipile-python.git","code":"import unipile\n\nACCOUNT_ID = \"acc_123456789\"\n\nconfiguration = unipile.Configuration()\nconfiguration.api_key[\"apiKey\"] = \"YOUR_API_KEY\"\n\nwith unipile.ApiClient(configuration) as api_client:\n    webhooks_api = unipile.WebhooksApi(api_client)\n\nresponse = webhooks_api.get_webhook_endpoint(\n    'we_123456789'\n)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["enabled","description","url","trigger_events","secret","object","id","application_id","account_ids","account_targets"],"properties":{"enabled":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"},"trigger_events":{"type":"array","items":{"type":"string","enum":["account.status.disconnected","account.status.running","account.status.errored","account.status.paused","account.add","account.reconnect","account.remove","account.initial_sync.running","account.initial_sync.failed","account.initial_sync.completed","message.new","message.update","message.delete","message.receipt.read","message.receipt.delivery","message.reaction.new","chat.delete","chat.update","email.new","email.new.bounce","email.delete","email.draft.new","email.draft.delete","email.folder.create","email.folder.update","email.folder.delete","calendar.create","calendar.update","calendar.delete","calendar.event.new","calendar.event.update","calendar.event.delete","tracking.open","tracking.click","relation.request.accept","relation.new"]}},"secret":{"maxLength":36,"type":"string"},"object":{"type":"string","enum":["WebhookEndpoint"]},"id":{"type":"string","pattern":"^we_(.*)$"},"application_id":{"type":"string","pattern":"^app_(.*)$"},"account_ids":{"type":"array","items":{"type":"string","pattern":"^acc_(.*)$"}},"account_targets":{"type":"array","items":{"type":"object","required":["account_name","account_provider","object","id","status"],"properties":{"account_name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"account_provider":{"description":"The provider's of the Account.\n    - `mock` is mock.\n    - `whatsapp` is WhatsApp.\n    - `linkedin` is LinkedIn.\n    - `instagram` is Instagram.\n    - `google` is Google.\n    - `outlook` is Outlook.\n    - `telegram` is Telegram.\n    - `imap` is IMAP.","type":"string","enum":["mock","whatsapp","linkedin","google","outlook","imap","telegram","instagram"]},"object":{"type":"string","enum":["WebhookEndpointAccountTarget"]},"id":{"type":"string","pattern":"^acc_(.*)$"},"status":{"type":"string","enum":["active","deleted"]}}}}}}}}}}}}},"tags":[{"name":"Accounts","description":"Accounts management"},{"name":"Webhooks","description":"Webhooks management"},{"name":"Hosted Auth","description":"Hosted account authentication"},{"name":"Custom Auth","description":"Custom account authentication"}]}