Skip to main content
GET
/
tenant
/
admin
/
user
/
by_email
GetTenantUserByEmail
curl --request GET \
  --url https://api.example.com/tenant/admin/user/by_email
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Description

This endpoint retrieves comprehensive multi-tenant membership information for a user based on their email address, including all tenants they belong to and any pending invitations.

Input

  • email (query, required): Email address used to locate the tenant user across all tenants
  • cancellationToken (optional): Token to cancel the asynchronous operation

Output

Returns a Result<MultiTenantUserModel> containing:
  • User identifier and email
  • Collection of tenants the user belongs to
  • Collection of pending invitations
  • Current active tenant context (if applicable)

Examples

Request:
GET /api/tenant/[email protected]
Response (200 OK):
{
  "data": {
    "userId": 4242,
    "userName": "[email protected]",
    "tenantId": 1024,
    "tenants": [
      {
        "id": 1024,
        "name": "Acme Corp",
        "isUserEnabled": true
      },
      {
        "id": 512,
        "name": "Globex",
        "isUserEnabled": true
      }
    ],
    "invitations": [
      {
        "id": 9001,
        "tenant": {
          "id": 256,
          "name": "Initech",
          "isUserEnabled": false
        },
        "invitorFirstName": "Dana",
        "invitorLastName": "Scully"
      }
    ]
  },
  "isSuccess": true
}

Errors

  • 400 Bad Request: Invalid email address format
  • 401 Unauthorized: Authentication credentials are missing or invalid
  • 403 Forbidden: User lacks permission to query tenant users
  • 404 Not Found: No user exists for the supplied email address
  • 500 Internal Server Error: Unexpected server error occurred during retrieval

Notes

  • Returns membership across all tenants the user belongs to
  • Includes pending invitations from other tenants
  • Does not require tenant identifier in request
  • Useful for multi-tenant user switching workflows

Query Parameters

email
string

Email address used to locate the tenant user across all tenants.

Response

User membership details retrieved successfully.

Wrapper for API operation results containing success status, error information, and return value.

isSuccess
boolean

True if the operation completed successfully, false otherwise.

Example:

true

isFailure
boolean

True if the operation failed, false otherwise.

Example:

false

error
object

Error information returned when the operation fails.

Example:
{
"code": "ValidationError",
"message": "The request parameters failed validation.",
"info": [
"The Name field is required.",
"The Id field must be greater than 0."
]
}
value
object

The result value returned when the operation is successful.

Example:
{
"tenants": [
{
"id": 1024,
"name": "Acme Corp",
"isUserEnabled": true
}
],
"invitations": [
{
"id": 9001,
"tenant": {
"id": 512,
"name": "Globex",
"isUserEnabled": false
},
"invitorFirstName": "Dana",
"invitorLastName": "Scully"
}
],
"tenantId": 1024,
"userId": 4242,
"userName": "[email protected]"
}