{"openapi":"3.1.0","info":{"version":"1.0.0","title":""},"components":{"schemas":{}},"paths":{"/v2/":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/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"]},"channel":{"description":"The channel the one-time password was sent through, when known.","type":"string","enum":["EMAIL","SMS","WHATSAPP"]}}},{"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":"Pairing Code","description":"A pairing code must be entered in the provider app to complete authentication.","type":"object","required":["type","code"],"properties":{"type":{"type":"string","enum":["PAIRING_CODE"]},"code":{"description":"The pairing code to enter on the phone to link the device.","type":"string"}}},{"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"]},"channel":{"description":"The channel the one-time password was sent through, when known.","type":"string","enum":["EMAIL","SMS","WHATSAPP"]}}},{"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"}}}}}},{"title":"Consent Screen","description":"The user must select the products that will be activated on the account.","type":"object","required":["type","products"],"properties":{"type":{"type":"string","enum":["CONSENT_SCREEN"]},"products":{"description":"A list of products to choose from.","type":"array","items":{"type":"object","required":["id","display_name"],"properties":{"id":{"description":"The ID of the product.","type":"string"},"display_name":{"description":"The display name of the product.","type":"string"}}}}}},{"title":"Challenge Selection","description":"The user must pick which alternative verification method to use to receive their code.","type":"object","required":["type","challenges"],"properties":{"type":{"type":"string","enum":["CHALLENGE_SELECTION"]},"challenges":{"description":"A list of alternative verification methods to choose from.","type":"array","items":{"type":"object","required":["id","label"],"properties":{"id":{"description":"Identifier of the method (EMAIL, SMS, WHATSAPP or any agnostic ID). Send it back as the `challenge` field of Request Checkpoint to switch to this method.","type":"string"},"label":{"description":"Human-readable name of the method (e.g. \"WhatsApp\", \"Text message\", \"Email\").","type":"string"},"description":{"description":"Extra detail about the method, e.g. the masked destination the code will be sent to.","type":"string"}}}}}},{"title":"Loading","description":"The authentication is continuing in the background and requires no user input.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["LOADING"]}}}]},"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","is_locked","provider","metadata"],"properties":{"object":{"description":"The type of the returned 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_(.*)$"},"account_scope_id":{"description":"ID of the Scope assigned to the Account. Once assigned, the Scope cannot be removed or replaced.","anyOf":[{"type":"string","pattern":"^scope_(.*)$"},{"type":"null"}]},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `errored` is Service Interuption.\n    - `disconnected` requires authentication.\n    - `degraded` means at least one product is running while another is errored; inspect `metadata.products_connection_status`.\n    - `partial` means at least one product is running while another requires authentication; inspect `metadata.products_connection_status`.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","degraded","partial"]},"is_locked":{"description":"Whether API access to the account is locked.","type":"boolean"},"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":{"description":"Metadata associated with the Account.","type":"object","properties":{"auto_proxy_country":{"description":"The rotation country for automatic proxy selection.","type":"string"},"allow_country_fallback":{"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation within that country remains allowed.","type":"boolean"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"v1_instance_port":{"description":"The port of the v1 instance from which the account was migrated.","type":"number"},"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_(.*)$"},"challenge":{"description":"The alternative verification method to switch to. Must be one of the `id`s listed in the CHALLENGE_SELECTION checkpoint.","type":"string"}}}}},"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"]},"channel":{"description":"The channel the one-time password was sent through, when known.","type":"string","enum":["EMAIL","SMS","WHATSAPP"]}}},{"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":"Pairing Code","description":"A pairing code must be entered in the provider app to complete authentication.","type":"object","required":["type","code"],"properties":{"type":{"type":"string","enum":["PAIRING_CODE"]},"code":{"description":"The pairing code to enter on the phone to link the device.","type":"string"}}},{"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"]},"channel":{"description":"The channel the one-time password was sent through, when known.","type":"string","enum":["EMAIL","SMS","WHATSAPP"]}}},{"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"}}}}}},{"title":"Consent Screen","description":"The user must select the products that will be activated on the account.","type":"object","required":["type","products"],"properties":{"type":{"type":"string","enum":["CONSENT_SCREEN"]},"products":{"description":"A list of products to choose from.","type":"array","items":{"type":"object","required":["id","display_name"],"properties":{"id":{"description":"The ID of the product.","type":"string"},"display_name":{"description":"The display name of the product.","type":"string"}}}}}},{"title":"Challenge Selection","description":"The user must pick which alternative verification method to use to receive their code.","type":"object","required":["type","challenges"],"properties":{"type":{"type":"string","enum":["CHALLENGE_SELECTION"]},"challenges":{"description":"A list of alternative verification methods to choose from.","type":"array","items":{"type":"object","required":["id","label"],"properties":{"id":{"description":"Identifier of the method (EMAIL, SMS, WHATSAPP or any agnostic ID). Send it back as the `challenge` field of Request Checkpoint to switch to this method.","type":"string"},"label":{"description":"Human-readable name of the method (e.g. \"WhatsApp\", \"Text message\", \"Email\").","type":"string"},"description":{"description":"Extra detail about the method, e.g. the masked destination the code will be sent to.","type":"string"}}}}}},{"title":"Loading","description":"The authentication is continuing in the background and requires no user input.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["LOADING"]}}}]},"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/checkpoint/resend":{"post":{"operationId":"resendCheckpoint","summary":"Resend Checkpoint Notification or Code","tags":["Custom Auth"],"description":"Resend the notification or code for the current checkpoint of the given authentication intent. Use Request Checkpoint to request a different checkpoint.","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 resent.","type":"string","pattern":"^acc_(.*)$"}}}}},"required":true},"x-samples-languages":["node","python","curl"],"x-code-samples":[{"name":"Resend 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.resendCheckpoint(\n  {\n    body: {\n      intent_id: 'intent_id',\n    },\n  }\n);"},{"name":"Resend 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.resend_checkpoint(\n    {\n    'intent_id': 'intent_id',\n  }\n)"}],"responses":{"204":{"description":"Default Response"}}}},"/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/createauthlink\">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.","anyOf":[{"title":"QR Code","description":"Authenticate by scanning a QR code with the WhatsApp mobile app.","type":"object","required":["qrcode"],"properties":{"qrcode":{"description":"This must be set to `true`","type":"boolean"}}},{"title":"Pairing Code","description":"Authenticate by entering a pairing code on the WhatsApp mobile app.","type":"object","required":["phone_number"],"properties":{"phone_number":{"description":"Phone number to link, in international format with digits only (no `+`, spaces or separators), e.g. `33612345678`. A pairing code will be returned to enter on this phone.","type":"string"}}}]},"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"},"allow_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}}}}}},{"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"},"allow_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"products":{"default":["classic","company","recruiter","sales_navigator"],"minItems":1,"uniqueItems":true,"description":"Specifies which LinkedIn products are allowed to be activated (as long as the account actually has the relevant subscriptions). By default, all products are made available.<br>When reconnecting an account, just omit this field to keep allowing access to the same products, or provide new values to expand or narrow the scope. <a href=\"https://developer.unipile.com/v2.0/docs/linkedin-link-accounts\">Learn more about Linkedin products</a>\n      `classic` : Personnal Social network<br>\n      `recruiter` : Recruiter<br>\n      `sales_navigator` : Sales Navigator<br>\n      `company` : Company Pages\n      ","type":"array","items":{"type":"string","enum":["classic","company","recruiter","sales_navigator"]}},"allow_product_selection":{"default":false,"description":"When true, return a product selection checkpoint after authentication, even when only one LinkedIn product is available. When false, all available products are selected automatically, except Recruiter when Sales Navigator is also available.","type":"boolean"}}}}},{"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":"The final list of authorizations to request from the Provider. Use this field to expand or 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. For a new account, omitting this field requests the authorizations defined in the Provider OAuth settings. For a reconnect, omitting it preserves already granted authorizations and adds the authorizations currently defined in the Provider OAuth settings.","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_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"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":{"account_scope_id":{"description":"The Scope the account will be assigned to once authentication is complete.","type":"string","pattern":"^scope_(.*)$"},"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 or reconfigure. The account may be running, partially connected, or disconnected, and `provider` must match its provider. Reconnecting always refreshes the entire account and restarts all configured products. If not specified, a new account is linked.","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"]},"channel":{"description":"The channel the one-time password was sent through, when known.","type":"string","enum":["EMAIL","SMS","WHATSAPP"]}}},{"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":"Pairing Code","description":"A pairing code must be entered in the provider app to complete authentication.","type":"object","required":["type","code"],"properties":{"type":{"type":"string","enum":["PAIRING_CODE"]},"code":{"description":"The pairing code to enter on the phone to link the device.","type":"string"}}},{"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"]},"channel":{"description":"The channel the one-time password was sent through, when known.","type":"string","enum":["EMAIL","SMS","WHATSAPP"]}}},{"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"}}}}}},{"title":"Consent Screen","description":"The user must select the products that will be activated on the account.","type":"object","required":["type","products"],"properties":{"type":{"type":"string","enum":["CONSENT_SCREEN"]},"products":{"description":"A list of products to choose from.","type":"array","items":{"type":"object","required":["id","display_name"],"properties":{"id":{"description":"The ID of the product.","type":"string"},"display_name":{"description":"The display name of the product.","type":"string"}}}}}},{"title":"Challenge Selection","description":"The user must pick which alternative verification method to use to receive their code.","type":"object","required":["type","challenges"],"properties":{"type":{"type":"string","enum":["CHALLENGE_SELECTION"]},"challenges":{"description":"A list of alternative verification methods to choose from.","type":"array","items":{"type":"object","required":["id","label"],"properties":{"id":{"description":"Identifier of the method (EMAIL, SMS, WHATSAPP or any agnostic ID). Send it back as the `challenge` field of Request Checkpoint to switch to this method.","type":"string"},"label":{"description":"Human-readable name of the method (e.g. \"WhatsApp\", \"Text message\", \"Email\").","type":"string"},"description":{"description":"Extra detail about the method, e.g. the masked destination the code will be sent to.","type":"string"}}}}}},{"title":"Loading","description":"The authentication is continuing in the background and requires no user input.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["LOADING"]}}}]},"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","is_locked","provider","metadata"],"properties":{"object":{"description":"The type of the returned 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_(.*)$"},"account_scope_id":{"description":"ID of the Scope assigned to the Account. Once assigned, the Scope cannot be removed or replaced.","anyOf":[{"type":"string","pattern":"^scope_(.*)$"},{"type":"null"}]},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `errored` is Service Interuption.\n    - `disconnected` requires authentication.\n    - `degraded` means at least one product is running while another is errored; inspect `metadata.products_connection_status`.\n    - `partial` means at least one product is running while another requires authentication; inspect `metadata.products_connection_status`.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","degraded","partial"]},"is_locked":{"description":"Whether API access to the account is locked.","type":"boolean"},"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":{"description":"Metadata associated with the Account.","type":"object","properties":{"auto_proxy_country":{"description":"The rotation country for automatic proxy selection.","type":"string"},"allow_country_fallback":{"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation within that country remains allowed.","type":"boolean"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"v1_instance_port":{"description":"The port of the v1 instance from which the account was migrated.","type":"number"},"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":{"account_scope_id":{"description":"The Scope the account will be assigned to once authentication is complete.","type":"string","pattern":"^scope_(.*)$"},"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":"The final list of authorizations to request from the Provider. Use this field to expand or 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. For a new account, omitting this field requests the authorizations defined in the Provider OAuth settings. For a reconnect, omitting it preserves already granted authorizations and adds the authorizations currently defined in the Provider OAuth settings.","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":"The final list of authorizations to request from the Provider. Use this field to expand or 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. For a new account, omitting this field requests the authorizations defined in the Provider OAuth settings. For a reconnect, omitting it preserves already granted authorizations and adds the authorizations currently defined in the Provider OAuth settings.","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"},"allow_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"products":{"default":["classic","company","recruiter","sales_navigator"],"minItems":1,"uniqueItems":true,"description":"Specifies which LinkedIn products are allowed to be activated (as long as the account actually has the relevant subscriptions). By default, all products are made available.<br>When reconnecting an account, just omit this field to keep allowing access to the same products, or provide new values to expand or narrow the scope. <a href=\"https://developer.unipile.com/v2.0/docs/linkedin-link-accounts\">Learn more about Linkedin products</a>\n      `classic` : Personnal Social network<br>\n      `recruiter` : Recruiter<br>\n      `sales_navigator` : Sales Navigator<br>\n      `company` : Company Pages\n      ","type":"array","items":{"type":"string","enum":["classic","company","recruiter","sales_navigator"]}},"allow_product_selection":{"default":true,"description":"When true, show the product selection screen after authentication, even when only one LinkedIn product is available; this screen also displays the requested scopes. When false, products are selected automatically and scope consent is collected before authentication.","type":"boolean"},"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":false,"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"},"allow_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"allow_methods":{"description":"The authentication methods to show in the hosted auth.\n            `qr` : QR Code Authentication\n            `pairing` : Pairing Code Authentication\n          ","default":["qr","pairing"],"type":"array","items":{"type":"string","enum":["qr","pairing"]}}}},"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_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"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 or reconfigure an entire existing account with Unipile.","type":"object","required":["expires_on","redirect_uri","account_id"],"properties":{"account_scope_id":{"description":"The Scope the account will be assigned to once authentication is complete.","type":"string","pattern":"^scope_(.*)$"},"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":"The final list of authorizations to request from the Provider. Use this field to expand or 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. For a new account, omitting this field requests the authorizations defined in the Provider OAuth settings. For a reconnect, omitting it preserves already granted authorizations and adds the authorizations currently defined in the Provider OAuth settings.","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":"The final list of authorizations to request from the Provider. Use this field to expand or 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. For a new account, omitting this field requests the authorizations defined in the Provider OAuth settings. For a reconnect, omitting it preserves already granted authorizations and adds the authorizations currently defined in the Provider OAuth settings.","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"},"allow_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"products":{"default":["classic","company","recruiter","sales_navigator"],"minItems":1,"uniqueItems":true,"description":"Specifies which LinkedIn products are allowed to be activated (as long as the account actually has the relevant subscriptions). By default, all products are made available.<br>When reconnecting an account, just omit this field to keep allowing access to the same products, or provide new values to expand or narrow the scope. <a href=\"https://developer.unipile.com/v2.0/docs/linkedin-link-accounts\">Learn more about Linkedin products</a>\n      `classic` : Personnal Social network<br>\n      `recruiter` : Recruiter<br>\n      `sales_navigator` : Sales Navigator<br>\n      `company` : Company Pages\n      ","type":"array","items":{"type":"string","enum":["classic","company","recruiter","sales_navigator"]}},"allow_product_selection":{"default":true,"description":"When true, show the product selection screen after authentication, even when only one LinkedIn product is available; this screen also displays the requested scopes. When false, products are selected automatically and scope consent is collected before authentication.","type":"boolean"},"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":false,"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"},"allow_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"allow_methods":{"description":"The authentication methods to show in the hosted auth.\n            `qr` : QR Code Authentication\n            `pairing` : Pairing Code Authentication\n          ","default":["qr","pairing"],"type":"array","items":{"type":"string","enum":["qr","pairing"]}}}},"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_country_fallback":{"default":true,"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation to another proxy in that country remains allowed.","type":"boolean"}}},"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 or reconfigure an existing account. The entire account is refreshed and all configured products are restarted.","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","is_locked","provider","metadata"],"properties":{"object":{"description":"The type of the returned 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_(.*)$"},"account_scope_id":{"description":"ID of the Scope assigned to the Account. Once assigned, the Scope cannot be removed or replaced.","anyOf":[{"type":"string","pattern":"^scope_(.*)$"},{"type":"null"}]},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `errored` is Service Interuption.\n    - `disconnected` requires authentication.\n    - `degraded` means at least one product is running while another is errored; inspect `metadata.products_connection_status`.\n    - `partial` means at least one product is running while another requires authentication; inspect `metadata.products_connection_status`.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","degraded","partial"]},"is_locked":{"description":"Whether API access to the account is locked.","type":"boolean"},"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":{"description":"Metadata associated with the Account.","type":"object","properties":{"auto_proxy_country":{"description":"The rotation country for automatic proxy selection.","type":"string"},"allow_country_fallback":{"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation within that country remains allowed.","type":"boolean"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"v1_instance_port":{"description":"The port of the v1 instance from which the account was migrated.","type":"number"},"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":{"account_scope_id":{"description":"The Scope to permanently assign to an unscoped Account. This field requires a Service API Key, and the Scope cannot be removed or replaced after assignment.","type":"string","pattern":"^scope_(.*)$"},"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"}},"auto_proxy_country":{"description":"The rotation country to use for Automatic Proxy Protection.","type":"string"},"allow_country_fallback":{"description":"Whether Automatic Proxy Protection may use a proxy from another country when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country; if the selected proxy later fails without a replacement there, the account enters Service interruption.","type":"boolean"},"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      account_scope_id: 'account_scope_id',\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    'account_scope_id': 'account_scope_id',\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","is_locked","provider","metadata"],"properties":{"object":{"description":"The type of the returned 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_(.*)$"},"account_scope_id":{"description":"ID of the Scope assigned to the Account. Once assigned, the Scope cannot be removed or replaced.","anyOf":[{"type":"string","pattern":"^scope_(.*)$"},{"type":"null"}]},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `errored` is Service Interuption.\n    - `disconnected` requires authentication.\n    - `degraded` means at least one product is running while another is errored; inspect `metadata.products_connection_status`.\n    - `partial` means at least one product is running while another requires authentication; inspect `metadata.products_connection_status`.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","degraded","partial"]},"is_locked":{"description":"Whether API access to the account is locked.","type":"boolean"},"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":{"description":"Metadata associated with the Account.","type":"object","properties":{"auto_proxy_country":{"description":"The rotation country for automatic proxy selection.","type":"string"},"allow_country_fallback":{"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation within that country remains allowed.","type":"boolean"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"v1_instance_port":{"description":"The port of the v1 instance from which the account was migrated.","type":"number"},"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 the Accounts accessible to the API Key in the current Application. Use `account_scope_id` with a Scope ID to return Accounts assigned to that Scope, or `none` to return Accounts without a Scope. Accounts are sorted alphabetically by `name`.","parameters":[{"schema":{"anyOf":[{"type":"string","pattern":"^scope_(.*)$"},{"type":"string","enum":["none"]}]},"in":"query","name":"account_scope_id","required":false,"description":"Filter Accounts by Scope ID, or use `none` to return Accounts without a Scope."},{"schema":{"type":"string","enum":["running","errored","disconnected","degraded","partial"]},"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","is_locked","provider","metadata"],"properties":{"object":{"description":"The type of the returned 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_(.*)$"},"account_scope_id":{"description":"ID of the Scope assigned to the Account. Once assigned, the Scope cannot be removed or replaced.","anyOf":[{"type":"string","pattern":"^scope_(.*)$"},{"type":"null"}]},"status":{"description":"The current status of the account.\n    - `running` is Operational.\n    - `errored` is Service Interuption.\n    - `disconnected` requires authentication.\n    - `degraded` means at least one product is running while another is errored; inspect `metadata.products_connection_status`.\n    - `partial` means at least one product is running while another requires authentication; inspect `metadata.products_connection_status`.\n    Learn more about [Status & Lifecycle](https://developer.unipile.com/v2.0/docs/status-lifecycle).","type":"string","enum":["running","errored","disconnected","degraded","partial"]},"is_locked":{"description":"Whether API access to the account is locked.","type":"boolean"},"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":{"description":"Metadata associated with the Account.","type":"object","properties":{"auto_proxy_country":{"description":"The rotation country for automatic proxy selection.","type":"string"},"allow_country_fallback":{"description":"Whether a proxy from another country may be used when none is available in the rotation country, during authentication and throughout the account lifetime. Defaults to true. If false, authentication fails when no proxy is available in the rotation country. If the selected proxy later fails and no replacement is available there, the account enters Service interruption. Rotation within that country remains allowed.","type":"boolean"},"v1_account_id":{"description":"The ID of the account in the v1 if the account is migrated from v1.","type":"string"},"v1_instance_port":{"description":"The port of the v1 instance from which the account was migrated.","type":"number"},"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/api-keys/":{"post":{"operationId":"createApiKey","summary":"Create an API Key","tags":["API Keys"],"description":"Creates an API key that can access every account or only accounts assigned to one scope. Service API keys cannot be created through this endpoint.","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"additionalProperties":false,"title":"Global Account API Key","type":"object","required":["name","expires_at","access"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"An internal name used to identify the API Key.","type":"string"},"expires_at":{"description":"The date and time when the API Key expires, in ISO 8601 format.","type":"string"},"access":{"additionalProperties":false,"description":"The Account access boundary of the API Key.","type":"object","required":["type"],"properties":{"type":{"description":"Grants access to every Account in the Application without management permissions.","type":"string","enum":["global"]}}}}},{"additionalProperties":false,"title":"Scoped Account API Key","type":"object","required":["name","expires_at","access"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"An internal name used to identify the API Key.","type":"string"},"expires_at":{"description":"The date and time when the API Key expires, in ISO 8601 format.","type":"string"},"access":{"additionalProperties":false,"description":"The Account access boundary of the API Key.","type":"object","required":["type","scope_id"],"properties":{"type":{"description":"Restricts access to Accounts permanently assigned to one Scope.","type":"string","enum":["scope"]},"scope_id":{"minLength":32,"maxLength":32,"description":"The ID of the active Scope that the API Key can access.","type":"string","pattern":"^scope_(.*)$"}}}}}]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","id","api_key"],"properties":{"object":{"description":"The type of the created object.","type":"string","enum":["ApiKey"]},"id":{"description":"The unique public ID of the created API Key.","type":"string","pattern":"^pk_(.*)$"},"api_key":{"description":"The secret API Key token. It is returned only once and must be stored securely.","type":"string"}}}}}}}},"get":{"operationId":"listApiKeys","summary":"List API Keys","tags":["API Keys"],"description":"Lists account-wide and scoped API keys. Service API keys are never exposed by this endpoint.","parameters":[{"schema":{"anyOf":[{"type":"string","enum":["global"]},{"type":"string","enum":["scope"]}]},"in":"query","name":"access","required":false,"description":"Filter Account API Keys by global or Scope access."},{"schema":{"type":"string","pattern":"^scope_(.*)$"},"in":"query","name":"account_scope_id","required":false,"description":"Filter API Keys assigned to this Scope."},{"schema":{"type":"string"},"in":"query","name":"offset","required":false,"description":"The number of API Keys to skip for pagination."},{"schema":{"default":"20","type":"string"},"in":"query","name":"limit","required":false,"description":"The maximum number of API Keys to return."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"description":"The type of the returned collection.","type":"string","enum":["ApiKeys"]},"data":{"description":"The Account API Keys in the current page.","type":"array","items":{"type":"object","required":["object","id","application_id","prefix","issued_at","expires_at","name","role","account_scope_id"],"properties":{"object":{"description":"The type of the returned object.","type":"string","enum":["ApiKey"]},"id":{"description":"The unique public ID of the API Key.","type":"string","pattern":"^pk_(.*)$"},"application_id":{"description":"The ID of the Application that owns the API Key.","type":"string","pattern":"^app_(.*)$"},"prefix":{"description":"The non-secret prefix used to identify the API Key.","type":"string"},"issued_at":{"description":"The date and time when the API Key was created.","type":"string"},"expires_at":{"description":"The date and time when the API Key expires.","type":"string"},"name":{"description":"The internal name of the API Key.","type":"string"},"role":{"description":"The effective access role: `service` manages the Application, `account` accesses every Account, and `scoped` accesses one Scope.","anyOf":[{"type":"string","enum":["service"]},{"type":"string","enum":["account"]},{"type":"string","enum":["scoped"]}]},"account_scope_id":{"description":"The Scope accessible to the API Key, or `null` for service and global Account API Keys.","anyOf":[{"type":"string","pattern":"^scope_(.*)$"},{"type":"null"}]}}}},"has_more":{"description":"Whether more API Keys are available after the current page.","type":"boolean"}}}}}}}}},"/v2/api-keys/{api_key_id}":{"delete":{"operationId":"deleteApiKey","summary":"Delete an API Key","tags":["API Keys"],"description":"Deletes an account-wide or scoped API key. Service API keys cannot be deleted through this endpoint.","parameters":[{"schema":{"type":"string","pattern":"^pk_(.*)$"},"in":"path","name":"api_key_id","required":true,"description":"The ID of the Account API Key to delete."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object"],"properties":{"object":{"type":"string","enum":["ApiKeyDeleted"]}}}}}}}}},"/v2/scopes/":{"post":{"operationId":"createScope","summary":"Create a Scope","tags":["Scopes"],"description":"Creates a Scope in the authenticated Application. A Scope is an isolation boundary used to restrict Account API Keys to the Accounts assigned to it.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"An internal name used to identify the Scope.","type":"string"},"reference":{"minLength":1,"maxLength":255,"description":"Optional metadata used to map the Scope to an external resource. Must be unique in the Application.","type":"string"}}}}},"required":true},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","id","application_id","name","reference","status","created_at","accounts_count","api_keys_count"],"properties":{"object":{"description":"The type of the returned object.","type":"string","enum":["Scope"]},"id":{"description":"The unique public ID of the Scope.","type":"string","pattern":"^scope_(.*)$"},"application_id":{"description":"The ID of the Application that owns the Scope.","type":"string","pattern":"^app_(.*)$"},"name":{"description":"The internal name of the Scope.","type":"string"},"reference":{"description":"External metadata used to map the Scope to another resource, or `null` when none is defined.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again.","type":"string","enum":["active","disabled"]},"created_at":{"description":"The date and time when the Scope was created.","type":"string"},"accounts_count":{"description":"The number of Accounts permanently assigned to the Scope.","type":"number"},"api_keys_count":{"description":"The number of API Keys assigned to the Scope.","type":"number"}}}}}}}},"get":{"operationId":"listScopes","summary":"List Scopes","tags":["Scopes"],"description":"Returns the Scopes created in the authenticated Application, including their status and the number of Accounts and API Keys assigned to each Scope.","parameters":[{"schema":{"type":"string"},"in":"query","name":"offset","required":false,"description":"The number of Scopes to skip for pagination."},{"schema":{"default":"20","type":"string"},"in":"query","name":"limit","required":false,"description":"The maximum number of Scopes to return."},{"schema":{"type":"string","enum":["active","disabled"]},"in":"query","name":"status","required":false,"description":"The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again."},{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Filter scopes by name or reference."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"description":"The type of the returned collection.","type":"string","enum":["Scopes"]},"data":{"description":"The scopes in the current page.","type":"array","items":{"type":"object","required":["object","id","application_id","name","reference","status","created_at","accounts_count","api_keys_count"],"properties":{"object":{"description":"The type of the returned object.","type":"string","enum":["Scope"]},"id":{"description":"The unique public ID of the Scope.","type":"string","pattern":"^scope_(.*)$"},"application_id":{"description":"The ID of the Application that owns the Scope.","type":"string","pattern":"^app_(.*)$"},"name":{"description":"The internal name of the Scope.","type":"string"},"reference":{"description":"External metadata used to map the Scope to another resource, or `null` when none is defined.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again.","type":"string","enum":["active","disabled"]},"created_at":{"description":"The date and time when the Scope was created.","type":"string"},"accounts_count":{"description":"The number of Accounts permanently assigned to the Scope.","type":"number"},"api_keys_count":{"description":"The number of API Keys assigned to the Scope.","type":"number"}}}},"has_more":{"description":"Whether more scopes are available after the current page.","type":"boolean"}}}}}}}}},"/v2/scopes/{scope_id}":{"get":{"operationId":"getScope","summary":"Get a Scope","tags":["Scopes"],"description":"Returns a Scope from the authenticated Application, including its status and the number of Accounts and API Keys assigned to it.","parameters":[{"schema":{"type":"string","pattern":"^scope_(.*)$"},"in":"path","name":"scope_id","required":true,"description":"The ID of the Scope to retrieve."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","id","application_id","name","reference","status","created_at","accounts_count","api_keys_count"],"properties":{"object":{"description":"The type of the returned object.","type":"string","enum":["Scope"]},"id":{"description":"The unique public ID of the Scope.","type":"string","pattern":"^scope_(.*)$"},"application_id":{"description":"The ID of the Application that owns the Scope.","type":"string","pattern":"^app_(.*)$"},"name":{"description":"The internal name of the Scope.","type":"string"},"reference":{"description":"External metadata used to map the Scope to another resource, or `null` when none is defined.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again.","type":"string","enum":["active","disabled"]},"created_at":{"description":"The date and time when the Scope was created.","type":"string"},"accounts_count":{"description":"The number of Accounts permanently assigned to the Scope.","type":"number"},"api_keys_count":{"description":"The number of API Keys assigned to the Scope.","type":"number"}}}}}}}},"patch":{"operationId":"updateScope","summary":"Update a Scope","tags":["Scopes"],"description":"Updates the name, unique reference, or status of a Scope. Disabling a Scope blocks its Account API Keys and authentication flows until it is enabled again.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"name":{"minLength":1,"description":"The new internal name of the Scope.","type":"string"},"reference":{"description":"The new external reference of the Scope. Must be unique in the Application. Set to `null` to remove it.","anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"status":{"description":"The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again.","type":"string","enum":["active","disabled"]}}}}}},"parameters":[{"schema":{"type":"string","pattern":"^scope_(.*)$"},"in":"path","name":"scope_id","required":true,"description":"The ID of the Scope to update."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","id","application_id","name","reference","status","created_at","accounts_count","api_keys_count"],"properties":{"object":{"description":"The type of the returned object.","type":"string","enum":["Scope"]},"id":{"description":"The unique public ID of the Scope.","type":"string","pattern":"^scope_(.*)$"},"application_id":{"description":"The ID of the Application that owns the Scope.","type":"string","pattern":"^app_(.*)$"},"name":{"description":"The internal name of the Scope.","type":"string"},"reference":{"description":"External metadata used to map the Scope to another resource, or `null` when none is defined.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"description":"The status of the Scope. A disabled scope blocks its scoped API keys and authentication flows until it is enabled again.","type":"string","enum":["active","disabled"]},"created_at":{"description":"The date and time when the Scope was created.","type":"string"},"accounts_count":{"description":"The number of Accounts permanently assigned to the Scope.","type":"number"},"api_keys_count":{"description":"The number of API Keys assigned to the Scope.","type":"number"}}}}}}}},"delete":{"operationId":"deleteScope","summary":"Delete a Scope","tags":["Scopes"],"description":"Deletes a Scope from the authenticated Application. The Scope must not contain any Accounts or API Keys, including expired API Keys.","parameters":[{"schema":{"type":"string","pattern":"^scope_(.*)$"},"in":"path","name":"scope_id","required":true,"description":"The ID of the Scope to delete."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object"],"properties":{"object":{"description":"Indicates that the Scope was successfully deleted.","type":"string","enum":["ScopeDeleted"]}}}}}}}}},"/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","latency_ms","response_time_ms","object","id","endpoint_id","event_id"],"properties":{"first_attempt":{"description":"Whether this delivery was the first attempt to send the webhook. `false` indicates a retry.","type":"boolean"},"event_type":{"description":"The type of the event that was delivered.","type":"string","enum":["account.status.disconnected","account.status.running","account.status.errored","account.status.degraded","account.status.partial","account.locked","account.unlocked","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","message.reaction.delete","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.new","follower.new"]},"created_at":{"description":"The date and time at which the delivery attempt was made, in ISO 8601 format.","type":"string"},"http_status":{"description":"The HTTP status code returned by the endpoint.","anyOf":[{"type":"integer"},{"type":"null"}]},"endpoint_url":{"description":"The URL the webhook was delivered to.","type":"string"},"response_body":{"description":"The body of the HTTP response returned by the endpoint.","anyOf":[{"type":"string"},{"type":"null"}]},"latency_ms":{"description":"The time between the event occurrence and this delivery attempt, in milliseconds.","anyOf":[{"type":"integer"},{"type":"null"}]},"response_time_ms":{"description":"The response time of the webhook endpoint for this delivery attempt, in milliseconds.","anyOf":[{"type":"integer"},{"type":"null"}]},"object":{"description":"The type of the returned object.","type":"string","enum":["WebhookConversation"]},"id":{"description":"Unique identifier of the webhook conversation.","type":"string","pattern":"^wc_(.*)$"},"endpoint_id":{"description":"Unique identifier of the webhook endpoint the event was delivered to.","type":"string","pattern":"^we_(.*)$"},"event_id":{"description":"Unique identifier of the event that was delivered.","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.degraded","account.status.partial","account.locked","account.unlocked","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","message.reaction.delete","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.new","follower.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","minLength":1,"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.degraded","account.status.partial","account.locked","account.unlocked","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","message.reaction.delete","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.new","follower.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.degraded","account.status.partial","account.locked","account.unlocked","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","message.reaction.delete","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.new","follower.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.degraded","account.status.partial","account.locked","account.unlocked","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","message.reaction.delete","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.new","follower.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","minLength":1,"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.degraded","account.status.partial","account.locked","account.unlocked","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","message.reaction.delete","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.new","follower.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.degraded","account.status.partial","account.locked","account.unlocked","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","message.reaction.delete","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.new","follower.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"}]}