Create a Connected Account
const url = 'https://example.com/api/v1/system/integrations/accounts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"app_password":"example","caldav_endpoint":"example","calendar_enabled":true,"carddav_endpoint":"example","email":"example","imap_host":"example","mail_enabled":true,"provider":"icloud","smtp_host":"example","username":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/system/integrations/accounts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "app_password": "example", "caldav_endpoint": "example", "calendar_enabled": true, "carddav_endpoint": "example", "email": "example", "imap_host": "example", "mail_enabled": true, "provider": "icloud", "smtp_host": "example", "username": "example" }'Create a shared provider sign-in and select Mail and Calendar services. The server checks the sign-in before it saves the account. A signed-in User with data scope is required. The request can return 400 for invalid input, 409 if the account already exists, 424 if the provider rejects the sign-in, or 429 if provider checks are busy. It can return 401 if the session is missing or 403 if the User lacks data scope. Route: /api/v1/system/integrations/accounts. Inputs: . Do not automatically replay this operation after an uncertain result.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”User input for a provider account; credential values are stored only in the shared account row (#407, DESIGN §49).
object
Initial Calendar state; missing means on after successful discovery (#407, DESIGN §49).
Accept host overrides only for Other (#407, DESIGN §49).
Initial Mail state; missing means on for older clients (#407, DESIGN §49).
Providers supported by the shared account setup flow (#407, DESIGN §49).
Responses
Section titled “Responses”Public account metadata that never includes its saved credential (#407, DESIGN §49).
object
Providers supported by the shared account setup flow (#407, DESIGN §49).
Example
{ "provider": "icloud"}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}