Skip to content

Create a Connected Account

POST
/api/v1/system/integrations/accounts
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.

Media typeapplication/json

User input for a provider account; credential values are stored only in the shared account row (#407, DESIGN §49).

object
app_password
required
string
caldav_endpoint
string | null
calendar_enabled

Initial Calendar state; missing means on after successful discovery (#407, DESIGN §49).

boolean | null
carddav_endpoint
string | null
email
required
string
imap_host

Accept host overrides only for Other (#407, DESIGN §49).

string | null
mail_enabled

Initial Mail state; missing means on for older clients (#407, DESIGN §49).

boolean | null
provider
required

Providers supported by the shared account setup flow (#407, DESIGN §49).

string
Allowed values: icloud fastmail gmail yahoo other
smtp_host
string | null
username
required
string
Media typeapplication/json

Public account metadata that never includes its saved credential (#407, DESIGN §49).

object
calendar_enabled
required
boolean
calendar_supported
required
boolean
created_ms
required
integer format: int64
email
required
string
id
required
string
mail_enabled
required
boolean
provider
required

Providers supported by the shared account setup flow (#407, DESIGN §49).

string
Allowed values: icloud fastmail gmail yahoo other
Example
{
"provider": "icloud"
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}