Zum Inhalt springen
Leadtime
Deutsch
Esc
↑↓navigieren↵öffnen⌘Jvorschau

Partially update IMAP email account

Partially updates an existing IMAP email account. Only the fields you provide will be updated; all other fields remain unchanged.

Important Restrictions:

  • Only IMAP/SMTP accounts can be updated via API
  • Attempting to update OAuth accounts (Google, Office365) will result in a 403 Forbidden error
  • OAuth accounts must be updated through the web application for security reasons

Update Process:

  • Provide only the fields you want to update
  • Fields not provided will retain their current values
  • You can update individual settings (e.g., just the SMTP password) without changing other fields
  • Email address can be changed (must remain unique within workspace)

Common Use Cases:

  • Update password after expiration
  • Change server hostname or port
  • Update display name
  • Modify individual IMAP or SMTP settings

Validation:

  • Only provided fields are validated
  • Email must be unique if changed
  • Port values must be between 1-65535 if provided

Response:

  • Returns the updated account with all details (excluding passwords)
PATCH/administration/email-accounts/{id}
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstringrequired
Query parameters
fieldsToReturnstring

Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.

responseShapestring

Advanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.

Allowed:compactfull
Header parameters
LT-Response-Shapestring

Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.

Allowed:full
Request body
requiredapplication/json
displayNamestring

Optional 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.

emailstring

Email address for the account

imapsHoststring

IMAP server hostname

imapsPasswordstring

IMAP password

imapsPortnumber

IMAP server port (typically 993 for SSL)

imapsUserstring

IMAP username

smtpHoststring

SMTP server hostname

smtpPasswordstring

SMTP password

smtpPortnumber

SMTP server port (typically 587 for TLS or 465 for SSL)

smtpUserstring

SMTP username

Responses
200

Email account updated successfully

capabilitiesobjectrequired

Account capabilities indicating what operations can be performed via API. Includes restrictions for OAuth accounts.

Show properties
canDeletebooleanrequired

Whether the account can be deleted via API. This is true for all account types, including OAuth accounts.

canEditbooleanrequired

Whether 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.

reasonstring

Optional 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>required

ISO 8601 timestamp indicating when the account was created

displayNameobject

Optional 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>required

ISO 8601 timestamp indicating when the account was last modified

emailstringrequired

Email address associated with this account. Used for sending and receiving emails.

idstring<uuid>required

Unique identifier (UUID) of the email account

lastErrorobject

Most recent error message, if the account has encountered any issues. This helps diagnose connection or authentication problems.

statusobjectrequired

Current operational status of the account. Indicates whether the account is working correctly or has encountered issues.

Show properties
object
typestringrequired

Type of email account. Determines how the account is authenticated and what operations are available via API.

Allowed:imapgoogleoffice365
400

Invalid input data

401

Unauthorized - Invalid or missing authentication token

403

OAuth accounts cannot be updated via API

404

Email account not found

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PATCH "https://leadtime.app/api/public/administration/email-accounts/string" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "displayName": "Support Team",
  "email": "support@example.com",
  "imapsHost": "imap.example.com",
  "imapsPassword": "secure-password",
  "imapsPort": 993,
  "imapsUser": "support@example.com",
  "smtpHost": "smtp.example.com",
  "smtpPassword": "secure-password",
  "smtpPort": 587,
  "smtpUser": "support@example.com"
}'
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"
}