List connected mailboxes
GET
/{provider}/accounts
const url = 'https://api.clearance.rest/emails/gmail/accounts';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”provider
required
string
Mail provider.
Responses
Section titled “Responses”Connected mailboxes.
Media typeapplication/json
object
success
required
boolean
accounts
required
Array<object>
object
email
required
string format: email
provider
required
string
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ı"}