Skip to content

List connected mailboxes

GET
/{provider}/accounts
curl --request GET \
--url https://api.clearance.rest/emails/gmail/accounts \
--header 'X-API-Key: <X-API-Key>'

Lists the mailboxes your project has connected for this provider. Token fields are never returned.

provider
required
string
Allowed values: gmail outlook

Mail provider.

Connected mailboxes.

Media typeapplication/json
object
success
required
boolean
accounts
required
Array<object>
object
email
required
string format: email
provider
required
string
Allowed values: gmail outlook
project_key
required

The project this mailbox belongs to.

string
sync_token
required

Provider sync cursor (Gmail historyId).

string | null
subscription_expires_at
required

When the provider-side watch or subscription expires, in milliseconds since the Unix epoch. It is renewed automatically.

integer | null
last_error
required

The most recent sync or renewal error, if any.

string | null
created_at
required
integer
updated_at
required
integer
Example
{
"success": true,
"accounts": [
{
"email": "user@gmail.com",
"provider": "gmail",
"project_key": "my-project",
"sync_token": "123456",
"subscription_expires_at": 1783999999000,
"last_error": null,
"created_at": 1783459025000,
"updated_at": 1783459025000
}
]
}

The X-API-Key header is missing or invalid.

Media typeapplication/json

Error envelope returned with a non-2xx status.

object
success
required
boolean
error
required

Human-readable error message.

string
Example
{
"success": false,
"error": "geçersiz API anahtarı"
}