List email accounts
Retrieves all email accounts configured for the workspace. Email accounts enable sending and receiving emails through the platform, including integration with helpdesk functionality.
Account Types:
- IMAP: Traditional email accounts with IMAP/SMTP configuration. Can be fully managed via API (create, update, delete).
- Google: Gmail/Google Workspace accounts via OAuth2. Can only be viewed and deleted via API for security reasons.
- Office365: Microsoft 365 accounts via OAuth2. Can only be viewed and deleted via API for security reasons.
Response Details:
- Returns all accounts with their current status (active, token_expired, smtp_error, imap_error, disconnected)
- Sensitive fields (passwords, tokens) are excluded from responses
- Each account includes capabilities indicating what operations are allowed via API
- Supports optional filtering by account type using the
typequery parameter
GET
/administration/email-accountsAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:reador
AuthorizationBearer token (JWT) · headerrequiredQuery parameters
typestringOptional filter to return only accounts of a specific type. Omit this parameter to retrieve all account types.
Allowed:
imapgoogleoffice365Responses
200Email accounts retrieved successfully
Array of
EmailAccountResponseDtocapabilitiesobjectrequiredAccount capabilities indicating what operations can be performed via API. Includes restrictions for OAuth accounts.
Show propertiesHide properties
canDeletebooleanrequiredWhether the account can be deleted via API. This is `true` for all account types, including OAuth accounts.
canEditbooleanrequiredWhether the account can be edited via API. This is `true` for IMAP accounts and `false` for OAuth accounts (Google, Office365) which must be managed through the web application for security reasons.
reasonstringOptional reason explaining why certain operations are restricted. This field is only present for OAuth accounts to explain why they cannot be created or updated via API.
createdAtstring<date-time>requiredISO 8601 timestamp indicating when the account was created
displayNameobjectOptional display name for the email account. This name will be shown in the email account list and may be used as the sender name when sending emails.
editedAtstring<date-time>requiredISO 8601 timestamp indicating when the account was last modified
emailstringrequiredEmail address associated with this account. Used for sending and receiving emails.
idstring<uuid>requiredUnique identifier (UUID) of the email account
lastErrorobjectMost recent error message, if the account has encountered any issues. This helps diagnose connection or authentication problems.
statusobjectrequiredCurrent operational status of the account. Indicates whether the account is working correctly or has encountered issues.
Show propertiesHide properties
objecttypestringrequiredType of email account. Determines how the account is authenticated and what operations are available via API.
Allowed:
imapgoogleoffice365401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X GET "https://leadtime.app/api/public/administration/email-accounts" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const response = await fetch("https://leadtime.app/api/public/administration/email-accounts", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.get(
"https://leadtime.app/api/public/administration/email-accounts",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
)Response
[
{
"capabilities": {
"canDelete": true,
"canEdit": true,
"reason": "OAuth accounts can only be managed through the web application"
},
"createdAt": "2024-01-15T10:30:00Z",
"displayName": "Support Team",
"editedAt": "2024-01-20T14:45:00Z",
"email": "support@example.com",
"id": "123e4567-e89b-12d3-a456-426614174000",
"lastError": "Failed to connect to SMTP server",
"status": "active",
"type": "imap"
}
]Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions