Skip to main content
POST
/
api
/
adm
/
invitations
/
send
Send User Invitations
curl --request POST \
  --url https://localhost:44371/api/adm/invitations/send \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Creates new user invitations and automatically sends invitation emails to the specified recipients. Each invitation includes a unique registration link that expires after a configured period. Recipients can complete registration by clicking the link and providing their account details.

Input

  • Body: model (UserInvitationSendCommandRequest, required) — Invitation request including:
    • companyId (guid, required) — Company identifier for the invitations.
    • emails (string[], required) — Array of email addresses to invite.
    • role (string, required) — User role to assign (Member, Admin, etc.).
    • message (string, optional) — Optional personalized message.

Output

Returns a UserInvitationSendCommandResponse containing IDs of created invitations and send status.

Example Request

POST /api/admin/userInvitations/send
Content-Type: application/json
Authorization: Bearer {token}

{
  "companyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "emails": ["[email protected]", "[email protected]"],
  "role": "Member",
  "message": "Welcome to our platform!"
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "invitationIds": [
    "9ef15c43-a955-6f4h-c7g3-1h6d4f0e3g9c",
    "8de14b32-9844-5e3g-b6f2-0g5c3e9d2f8b"
  ]
}

Errors

  • 400 Bad Request — One or more email addresses already have pending invitations or email is already registered.
  • 404 Not Found — Specified company ID does not exist.

Notes

  • Invitation emails are sent immediately upon creation.
  • Only one pending invitation per email address per company is allowed.
  • Invitations expire after configured period (typically 7-30 days).
  • Failed email sends are logged but invitation records are still created.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

The invitation request containing company ID, email addresses, roles, and optional personalization.

Base structure for command requests that modify data. Represents the command payload to send invitations to prospective users.

companyId
string<guid>

The identifier of the company inviting new users.

userId
string<guid>

The identifier of the user initiating the invitations.

The join link that recipients use to accept the invitation.

emails
string[] | null

The collection of recipient email addresses.

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Represents the response returned after sending user invitations.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null