SMTP Queries

Query SMTP configuration for email delivery.

Available queries

Smtp - Returns a single SMTP configuration based on the id provided

query GetSmtp($id: ID) {
  Smtp(id: $id) {
    id
    email
    host
    port
    active
    created_at
    user_profile_id
  }
}
{
  "id": 100012
}

Smtps - Returns a list of SMTP configurations based on filters, ordering, and search

query Smtps(
  $where: QuerySmtpsWhereWhereConditions,
  $orderBy: [QuerySmtpsOrderByOrderByClause!],
  $search: String
) {
  Smtps(
    where: $where
    orderBy: $orderBy
    search: $search
  ) {
    id
    email
    host
    port
    active
    created_at
    user_profile_id
  }
}
{
  "where": {
    "AND": [
      { "column": "ACTIVE", "operator": "EQ", "value": true }
    ]
  },
  "orderBy": [
    { "column": "EMAIL", "order": "ASC" }
  ],
  "search": "smtp.example.com"
}

Available fields

FieldTypeDescription
idIntUnique identifier of the SMTP configuration.
user_profile_idIntIdentifier of the user profile owning the configuration.
emailStringSMTP account email address used for sending.
hostStringSMTP server hostname.
portIntSMTP server port.
activeBooleanIf true, the SMTP configuration is active.
created_atDateTimeCreation date of the configuration.

Filters

You can create filters based on following fields

id - Int
Example: { "column": "ID", "operator": "EQ", "value": 100012 }
email - String
Example: { "column": "EMAIL", "operator": "EQ", "value": "[email protected]" }
host - String
Example: { "column": "HOST", "operator": "EQ", "value": "smtp.example.com" }
port - Int
Example: { "column": "PORT", "operator": "EQ", "value": 587 }
user_profile_id - Int
Example: { "column": "USER_PROFILE_ID", "operator": "EQ", "value": 42 }
active - Boolean
Example: { "column": "ACTIVE", "operator": "EQ", "value": true }

Sorting

You can sort data based on following fields: email, host, port

query SortSmtps(
  $where: QuerySmtpsWhereWhereConditions
) {
  Smtps(
    where: $where
    orderBy: [{ column: EMAIL, order: ASC }]
  ) {
    id
    email
    host
    port
    active
  }
}

Example of data returned

{
  "data": {
    "Smtps": [
      {
        "id": 100001,
        "email": "[email protected]",
        "host": "smtp.example.com",
        "port": 587,
        "active": true,
        "created_at": "2025-01-01T00:00:00Z",
        "user_profile_id": 42
      },
      {
        "id": 100002,
        "email": "[email protected]",
        "host": "smtp.example.com",
        "port": 465,
        "active": false,
        "created_at": "2025-01-02T00:00:00Z",
        "user_profile_id": 43
      }
    ]
  }
}