Integrations
Slack
APIs
Lookup by Email

Lookup User by Email

Find a user with an email address.

Required scopes:

  • users:read.email

For more information on the API for looking up a user by email, see users.lookupByEmail (opens in a new tab).

SDK Import:

from admyral.actions import lookup_slack_user_by_email

Arguments:

Argument NameDescriptionRequired
Email emailAn email address belonging to a user in the Slack workspace.Yes

Required Secrets

Secret PlaceholderDescription
SLACK_SECRETSlack secret. See Slack setup

SDK Example

user = lookup_slack_user_by_email(
	email="daniel@admyral.dev",
	secrets={
		"SLACK_SECRET": "my_stored_slack_secret"
	}
)

Example Output:

Typical successful output:

{
	"ok": true,
	"user": {
		"id": "W012A3CDE",
		"team_id": "T012AB3C4",
		"name": "spengler",
		"deleted": false,
		"color": "9f69e7",
		"real_name": "Egon Spengler",
		"tz": "America/Los_Angeles",
		"tz_label": "Pacific Daylight Time",
		"tz_offset": -25200,
		"profile": {
			"avatar_hash": "ge3b51ca72de",
			"status_text": "Print is dead",
			"status_emoji": ":books:",
			"real_name": "Egon Spengler",
			"display_name": "spengler",
			"real_name_normalized": "Egon Spengler",
			"display_name_normalized": "spengler",
			"email": "spengler@ghostbusters.example.com",
			"image_24": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
			"image_32": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
			"image_48": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
			"image_72": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
			"image_192": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
			"image_512": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
			"team": "T012AB3C4"
		},
		"is_admin": true,
		"is_owner": false,
		"is_primary_owner": false,
		"is_restricted": false,
		"is_ultra_restricted": false,
		"is_bot": false,
		"updated": 1502138686,
		"is_app_user": false,
		"has_2fa": false
	}
}

Typical error response:

{
	"ok": false,
	"error": "users_not_found"
}