Skip to main content
POST
/
tenant
/
{tenantId}
/
admin
/
user
/
first
GetFirstEntryUser
curl --request POST \
  --url https://api.example.com/tenant/{tenantId}/admin/user/first \
  --header 'Content-Type: application/json' \
  --data '
{
  "emails": [
    "[email protected]"
  ],
  "firstName": "Jamie",
  "lastName": "Lee",
  "principalOid": "4edb0c06-a242-4f94-9d2b-35adc68d3e67",
  "tenantId": 1024
}
'
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Description

This endpoint handles first-time user entry by locating an existing user or creating a new one based on provided email addresses and profile information.

Input

  • tenantId (path, required): Identifier of the tenant requesting first-entry access
  • request (body, required): First-entry payload
    • emails: Array of email addresses to match
    • firstName: Optional first name for user creation
    • lastName: Optional last name for user creation
    • principalOid: Optional principal identifier
  • cancellationToken (optional): Token to cancel the asynchronous operation

Output

Returns a Result<TenantUserViewModel> containing the located or created user.

Examples

Request:
POST /api/tenant/1024/users/first-entry
Content-Type: application/json

{
  "emails": ["[email protected]"],
  "firstName": "Jamie",
  "lastName": "Lee",
  "principalOid": "4edb0c06-a242-4f94-9d2b-35adc68d3e67",
  "tenantId": 1024
}
Response (200 OK):
{
  "data": {
    "id": 258,
    "userId": 4244,
    "tenantId": 1024,
    "email": "[email protected]",
    "firstName": "Jamie",
    "lastName": "Lee",
    "isEnabled": true,
    "roles": []
  },
  "isSuccess": true
}

Errors

  • 400 Bad Request: Invalid payload or validation failure
  • 401 Unauthorized: Authentication credentials are missing or invalid
  • 403 Forbidden: User lacks permission to manage first-entry users
  • 500 Internal Server Error: Unexpected server error occurred

Notes

  • Creates new user if no matching email found
  • Multiple emails can be provided for matching
  • Used for onboarding workflows

Path Parameters

tenantId
integer<int64>
required

Identifier of the tenant requesting first-entry access.

Body

application/json

Payload containing user identifiers to process the first entry.

Request to process a user's first-time entry into the platform or tenant.

emails
string[]

Collection of email addresses to locate or create the user.

Example:
firstName
string | null

Optional first name to associate with the user.

Example:

"Jamie"

lastName
string | null

Optional last name to associate with the user.

Example:

"Lee"

principalOid
string | null

Optional Azure AD principal object identifier.

Example:

"4edb0c06-a242-4f94-9d2b-35adc68d3e67"

tenantId
integer<int64> | null

Optional tenant identifier for tenant-scoped first entry.

Example:

1024

Response

First-entry user information returned 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:
{
"id": 256,
"userId": 4242,
"tenantId": 1024,
"principalOid": "d3b07384-d9a1-4655-a08e-df5f4f6d7d19",
"firstName": "Casey",
"lastName": "Taylor",
"email": "[email protected]",
"isEnabled": true,
"roles": [
{
"id": 12,
"name": "TenantAdministrator",
"description": "Grants full tenant administration capabilities."
}
]
}