usersLookupByEmail
Find a user with an email address.
Details
- Method:
GET - Path:
/users.lookupByEmail - Operation ID:
users_lookupByEmail
Parameters
{
"token": {
"description": "Authentication token. Requires scope: `users:read.email`",
"required": true,
"location": "query",
"type": "string"
},
"email": {
"description": "An email address belonging to a user in the workspace",
"required": true,
"location": "query",
"type": "string"
}
}Response Schema
{
"additionalProperties": true,
"description": "Schema for successful response from users.lookupByEmail method",
"properties": {
"ok": {
"enum": [
true
],
"title": "default success response",
"type": "boolean"
},
"user": {
"items": [
{
"additionalProperties": false,
"description": "user object for non enterprise type",
"properties": {
"color": {
"pattern": "^[a-fA-F0-9]{6}$",
"type": "string"
},
"deleted": {
"type": "boolean"
},
"enterprise_user": {
"additionalProperties": false,
"properties": {
"enterprise_id": {
"pattern": "^[E][A-Z0-9]{8,}$",
"title": "Enterprise ID",
"type": "string"
},
"enterprise_name": {
"title": "Name of the enterprise org",
"type": "string"
},
"id": {
"pattern": "^[WU][A-Z0-9]{8,}$",
"title": "Enterprise User ID",
"type": "string"
},
"is_admin": {
"type": "boolean"
},
"is_owner": {
"type": "boolean"
},
"teams": {
"items": {
"pattern": "^[T][A-Z0-9]{2,}$",
"title": "Team ID",
"type": "string"
},
"type": "array",
"uniqueItems": true
}
},
"required": [
"id",
"enterprise_id",
"enterprise_name",
"is_admin",
"is_owner",
"teams"
],
"type": "object"
},
"has_2fa": {
"type": "boolean"
},
"id": {
"pattern": "^[UW][A-Z0-9]{2,}$",
"title": "User ID",
"type": "string"
},
"is_admin": {
"type": "boolean"
},
"is_app_user": {
"type": "boolean"
},
"is_bot": {
"type": "boolean"
},
"is_external": {
"type": "boolean"
},
"is_forgotten": {
"type": "boolean"
},
"is_invited_user": {
"type": "boolean"
},
"is_owner": {
"type": "boolean"
},
"is_primary_owner": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean"
},
"is_stranger": {
"type": "boolean"
},
"is_ultra_restricted": {
"type": "boolean"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"presence": {
"type": "string"
},
"profile": {
"additionalProperties": false,
"properties": {
"always_active": {
"type": "boolean"
},
"api_app_id": {
"pattern": "^(A[A-Z0-9]{1,})?$",
"title": "App ID or empty string",
"type": "string"
},
"avatar_hash": {
"type": "string"
},
"bot_id": {
"pattern": "^B[A-Z0-9]{8,}$",
"title": "Bot User ID",
"type": "string"
},
"display_name": {
"type": "string"
},
"display_name_normalized": {
"type": "string"
},
"email": {
"format": "email",
"type": [
"null",
"string"
]
},
"fields": {
"items": {
"type": "object"
},
"type": [
"object",
"null",
"array"
]
},
"first_name": {
"type": [
"null",
"string"
]
},
"guest_expiration_ts": {
"type": [
"null",
"integer"
]
},
"guest_invited_by": {
"type": [
"null",
"string"
]
},
"image_1024": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_192": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_24": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_32": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_48": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_512": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_72": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_original": {
"format": "uri",
"type": [
"null",
"string"
]
},
"is_app_user": {
"type": "boolean"
},
"is_custom_image": {
"type": "boolean"
},
"is_restricted": {
"type": [
"null",
"boolean"
]
},
"is_ultra_restricted": {
"type": [
"null",
"boolean"
]
},
"last_avatar_image_hash": {
"type": "string"
},
"last_name": {
"type": [
"null",
"string"
]
},
"memberships_count": {
"type": "integer"
},
"name": {
"type": [
"null",
"string"
]
},
"phone": {
"type": "string"
},
"pronouns": {
"type": "string"
},
"real_name": {
"type": "string"
},
"real_name_normalized": {
"type": "string"
},
"skype": {
"type": "string"
},
"status_default_emoji": {
"type": "string"
},
"status_default_text": {
"type": "string"
},
"status_default_text_canonical": {
"type": [
"null",
"string"
]
},
"status_emoji": {
"type": "string"
},
"status_expiration": {
"type": "integer"
},
"status_text": {
"type": "string"
},
"status_text_canonical": {
"type": [
"null",
"string"
]
},
"team": {
"pattern": "^[TE][A-Z0-9]{8,}$",
"title": "Team or Enterprise ID",
"type": "string"
},
"title": {
"type": "string"
},
"updated": {
"type": "integer"
},
"user_id": {
"type": "string"
},
"username": {
"type": [
"null",
"string"
]
}
},
"required": [
"real_name",
"display_name",
"avatar_hash",
"real_name_normalized",
"display_name_normalized",
"title",
"phone",
"skype",
"status_text",
"status_emoji",
"fields"
],
"title": "User profile object",
"type": "object"
},
"real_name": {
"type": "string"
},
"team": {
"pattern": "^[TE][A-Z0-9]{8,}$",
"title": "Team or Enterprise ID",
"type": "string"
},
"team_id": {
"pattern": "^[TE][A-Z0-9]{8,}$",
"title": "Team or Enterprise ID",
"type": "string"
},
"team_profile": {
"additionalProperties": false,
"properties": {
"fields": {
"items": {
"additionalProperties": false,
"properties": {
"field_name": {
"type": [
"null",
"string"
]
},
"hint": {
"type": "string"
},
"id": {
"pattern": "^X[a-zA-Z0-9]{9,}$",
"type": "string"
},
"is_hidden": {
"type": "boolean"
},
"label": {
"type": "string"
},
"options": {
"items": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"is_custom": {
"type": [
"null",
"boolean"
]
},
"is_multiple_entry": {
"type": [
"null",
"boolean"
]
},
"is_protected": {
"type": [
"null",
"boolean"
]
},
"is_scim": {
"type": [
"null",
"boolean"
]
}
},
"type": "object"
}
]
},
"ordering": {
"type": "number"
},
"possible_values": {
"items": {
"type": "string"
},
"type": [
"null",
"array"
]
},
"type": {
"enum": [
"text",
"date",
"link",
"mailto",
"options_list",
"user"
],
"type": "string"
}
},
"required": [
"id",
"ordering",
"label",
"hint",
"type"
],
"type": "object"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
}
},
"required": [
"fields"
],
"type": "object"
},
"two_factor_type": {
"type": "string"
},
"tz": {
"items": [
{
"type": "null"
},
{
"type": "string"
}
]
},
"tz_label": {
"type": "string"
},
"tz_offset": {
"type": "number"
},
"updated": {
"type": "number"
}
},
"required": [
"id",
"name",
"profile",
"is_bot",
"updated",
"is_app_user"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "enterprise user",
"properties": {
"color": {
"description": "refercing to bug: https://jira.tinyspeck.com/browse/EVALUE-1559",
"pattern": "^([a-fA-F0-9]{6})?$",
"type": "string"
},
"deleted": {
"type": "boolean"
},
"enterprise_user": {
"additionalProperties": false,
"properties": {
"enterprise_id": {
"pattern": "^[E][A-Z0-9]{8,}$",
"title": "Enterprise ID",
"type": "string"
},
"enterprise_name": {
"title": "Name of the enterprise org",
"type": "string"
},
"id": {
"pattern": "^[WU][A-Z0-9]{8,}$",
"title": "Enterprise User ID",
"type": "string"
},
"is_admin": {
"type": "boolean"
},
"is_owner": {
"type": "boolean"
},
"teams": {
"items": {
"pattern": "^[T][A-Z0-9]{2,}$",
"title": "Team ID",
"type": "string"
},
"type": "array",
"uniqueItems": true
}
},
"required": [
"id",
"enterprise_id",
"enterprise_name",
"is_admin",
"is_owner",
"teams"
],
"type": "object"
},
"has_2fa": {
"type": "boolean"
},
"id": {
"pattern": "^[UW][A-Z0-9]{2,}$",
"title": "User ID",
"type": "string"
},
"is_admin": {
"type": "boolean"
},
"is_app_user": {
"type": "boolean"
},
"is_bot": {
"type": "boolean"
},
"is_external": {
"type": "boolean"
},
"is_forgotten": {
"type": "boolean"
},
"is_owner": {
"type": "boolean"
},
"is_primary_owner": {
"type": "boolean"
},
"is_restricted": {
"type": "boolean"
},
"is_stranger": {
"type": "boolean"
},
"is_ultra_restricted": {
"type": "boolean"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"presence": {
"type": "string"
},
"profile": {
"additionalProperties": false,
"properties": {
"always_active": {
"type": "boolean"
},
"api_app_id": {
"pattern": "^(A[A-Z0-9]{1,})?$",
"title": "App ID or empty string",
"type": "string"
},
"avatar_hash": {
"type": "string"
},
"bot_id": {
"pattern": "^B[A-Z0-9]{8,}$",
"title": "Bot User ID",
"type": "string"
},
"display_name": {
"type": "string"
},
"display_name_normalized": {
"type": "string"
},
"email": {
"format": "email",
"type": [
"null",
"string"
]
},
"fields": {
"items": {
"type": "object"
},
"type": [
"object",
"null",
"array"
]
},
"first_name": {
"type": [
"null",
"string"
]
},
"guest_expiration_ts": {
"type": [
"null",
"integer"
]
},
"guest_invited_by": {
"type": [
"null",
"string"
]
},
"image_1024": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_192": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_24": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_32": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_48": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_512": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_72": {
"format": "uri",
"type": [
"null",
"string"
]
},
"image_original": {
"format": "uri",
"type": [
"null",
"string"
]
},
"is_app_user": {
"type": "boolean"
},
"is_custom_image": {
"type": "boolean"
},
"is_restricted": {
"type": [
"null",
"boolean"
]
},
"is_ultra_restricted": {
"type": [
"null",
"boolean"
]
},
"last_avatar_image_hash": {
"type": "string"
},
"last_name": {
"type": [
"null",
"string"
]
},
"memberships_count": {
"type": "integer"
},
"name": {
"type": [
"null",
"string"
]
},
"phone": {
"type": "string"
},
"pronouns": {
"type": "string"
},
"real_name": {
"type": "string"
},
"real_name_normalized": {
"type": "string"
},
"skype": {
"type": "string"
},
"status_default_emoji": {
"type": "string"
},
"status_default_text": {
"type": "string"
},
"status_default_text_canonical": {
"type": [
"null",
"string"
]
},
"status_emoji": {
"type": "string"
},
"status_expiration": {
"type": "integer"
},
"status_text": {
"type": "string"
},
"status_text_canonical": {
"type": [
"null",
"string"
]
},
"team": {
"pattern": "^[TE][A-Z0-9]{8,}$",
"title": "Team or Enterprise ID",
"type": "string"
},
"title": {
"type": "string"
},
"updated": {
"type": "integer"
},
"user_id": {
"type": "string"
},
"username": {
"type": [
"null",
"string"
]
}
},
"required": [
"real_name",
"display_name",
"avatar_hash",
"real_name_normalized",
"display_name_normalized",
"title",
"phone",
"skype",
"status_text",
"status_emoji",
"fields"
],
"title": "User profile object",
"type": "object"
},
"real_name": {
"type": "string"
},
"team_id": {
"pattern": "^[TE][A-Z0-9]{8,}$",
"title": "Team or Enterprise ID",
"type": "string"
},
"team_profile": {
"additionalProperties": false,
"properties": {
"fields": {
"items": {
"additionalProperties": false,
"properties": {
"field_name": {
"type": [
"null",
"string"
]
},
"hint": {
"type": "string"
},
"id": {
"pattern": "^X[a-zA-Z0-9]{9,}$",
"type": "string"
},
"is_hidden": {
"type": "boolean"
},
"label": {
"type": "string"
},
"options": {
"items": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"is_custom": {
"type": [
"null",
"boolean"
]
},
"is_multiple_entry": {
"type": [
"null",
"boolean"
]
},
"is_protected": {
"type": [
"null",
"boolean"
]
},
"is_scim": {
"type": [
"null",
"boolean"
]
}
},
"type": "object"
}
]
},
"ordering": {
"type": "number"
},
"possible_values": {
"items": {
"type": "string"
},
"type": [
"null",
"array"
]
},
"type": {
"enum": [
"text",
"date",
"link",
"mailto",
"options_list",
"user"
],
"type": "string"
}
},
"required": [
"id",
"ordering",
"label",
"hint",
"type"
],
"type": "object"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
}
},
"required": [
"fields"
],
"type": "object"
},
"teams": {
"items": {
"pattern": "^[TE][A-Z0-9]{8,}$",
"title": "Team or Enterprise ID",
"type": "string"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"two_factor_type": {
"type": "string"
},
"tz": {
"items": [
{
"type": "null"
},
{
"type": "string"
}
]
},
"tz_label": {
"type": "string"
},
"tz_offset": {
"type": "number"
},
"updated": {
"type": "number"
}
},
"required": [
"id",
"name",
"profile",
"is_bot",
"updated",
"is_app_user"
],
"type": "object"
}
]
}
},
"required": [
"ok",
"user"
],
"title": "users.lookupByEmail success schema",
"type": "object"
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('slack')
# Call this tool
result = await agent.call_tool('usersLookupByEmail', {
# Add required parameters here
})