/v1/apps/{app_id}/end-users/invitesAuthPre-allocate an EndUser invite. Dispatches an invitation email via the workspace's Mail sender.
Path parameters
app_id*stringId of the app.
Headers
Idempotency-KeystringStripe-style idempotency key. Mint dispatches an email + writes an `invite` row; a retry without an idempotency key would double-send.
Request body
email*stringInvitee email. Locks the invite to this address.
Example: "alice@example.com"
namestringOptional human-readable name shown in the email.
Example: "Alice Wong"
role_namestringRole slug to grant on accept. Defaults to `member`.
Example: "member"
max_usesnumberMaximum number of accepts. Defaults to 1.
expires_in_hoursnumberHours until the invite expires. Defaults to 72 (3 days).
Response · 201
id*stringUnique identifier of the invite.
code*stringInvite code the recipient submits to accept.
email*stringEmail address.
role_name*stringName of the role.
role_id*stringId of the role.
max_uses*numberHow many times the invite can be used, or `null` for no limit.
use_count*numberHow many times the invite has been used.
expires_at*string · date-timeWhen the invite expires (ISO 8601), or `null` if it never does.
revoked_at*string · date-timeWhen the invite was revoked (ISO 8601), or `null` while it is active.
created_at*string · date-timeWhen the invite was created (ISO 8601).
Example
Request
POST https://api.auth.productcraft.co/v1/apps/{app_id}/end-users/invites
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"email": "alice@example.com",
"name": "Alice Wong",
"role_name": "member",
"max_uses": 0,
"expires_in_hours": 0
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const endUserInvite = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.create({ email: "alice@example.com" });auth.admin.app(…).endUsers.invites.create(params, options?): Auth.EndUserInvite
Response
{
"id": "string",
"code": "string",
"email": "string",
"role_name": "string",
"role_id": "string",
"max_uses": 0,
"use_count": 0,
"expires_at": "2026-01-01T00:00:00.000Z",
"revoked_at": "2026-01-01T00:00:00.000Z",
"created_at": "2026-01-01T00:00:00.000Z"
}