Skip to main content
POST
https://api-dev.weir.ai/
/
admin
/
member
/
invite
curl -X POST 'https://api.weir.ai/admin/member/invite' \
  -H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "[email protected]",
    "fullname": "New Admin",
    "role": "Admin"
  }'
{
  "data": {
    "invitationId": "inv_admin_123456789",
    "email": "[email protected]",
    "role": "Admin",
    "status": "pending",
    "expiresAt": "2024-01-29T15:30:00Z"
  },
  "message": "Admin invitation sent successfully",
  "status": "success"
}

Invite Admin User

Send an invitation to a user to join as an admin.
curl -X POST 'https://api.weir.ai/admin/member/invite' \
  -H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "[email protected]",
    "fullname": "New Admin",
    "role": "Admin"
  }'
{
  "data": {
    "invitationId": "inv_admin_123456789",
    "email": "[email protected]",
    "role": "Admin",
    "status": "pending",
    "expiresAt": "2024-01-29T15:30:00Z"
  },
  "message": "Admin invitation sent successfully",
  "status": "success"
}

Request Body

email
string
required
Email address of the admin to invite.
fullname
string
required
Full name of the admin.
role
string
Admin role (Admin, Support_Admin). Defaults to Admin.

Usage Examples

const inviteAdmin = async (inviteData, accessToken) => {
  const response = await fetch('https://api.weir.ai/admin/member/invite', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(inviteData)
  });
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return await response.json();
};
Super Admin Only: Only Super_Admin users can invite new admins.