Get the email provider of the current user

Read the MX email provider for the user who owns the API token.

Before You Begin

🔗 Use the GraphQL Playground to execute the query in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Prerequisites

  1. User session: This query is for the signed-in user. A service-account token always returns PROVIDER_NOT_IDENTIFIED. Service-account addresses are on service-account.pipefy.com, and that domain has no MX record.
  2. Current user: This query takes no arguments. It reads the user who owns the token.
  3. Unconfirmed email: emailProviderData by itself is allowed on /graphql for a user whose email is not confirmed. An operation that also selects me is rejected. me is not on that allowlist.

Step 1: Query the email provider

Use emailProviderData to read the provider of the token's own user:

query {
  emailProviderData {
    providerName
  }
}

Key fields explained

  • providerName: The email domain's MX provider. google means Google Workspace or Gmail. Any other domain returns the MX second-level domain, for example outlook.

Step 2: Execute and interpret the response

For a signed-in user, a successful lookup returns the provider under data.emailProviderData. A service-account token does not reach this response:

{
  "data": {
    "emailProviderData": {
      "providerName": "google"
    }
  }
}

Key Notes

  • The field reads the token's own user. A service-account token always returns PROVIDER_NOT_IDENTIFIED.
  • providerName is the email domain's MX provider: google for Google Workspace or Gmail, otherwise the MX second-level domain (for example outlook).
  • When the provider cannot be identified, the API returns an error with code PROVIDER_NOT_IDENTIFIED. Match on the code. The message is localized.