curl --request POST \
--url https://www.asteragents.com/api/admin/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invitations": [
{
"email": "user1@company.com"
},
{
"email": "user2@company.com"
}
]
}
'{
"success": true,
"total": 2,
"successful": 2,
"failed": 0,
"results": [
{
"email": "newuser@company.com",
"success": true,
"invitationId": "orginv_2ABC123DEF",
"status": "pending",
"type": "invitation",
"metadata": {}
},
{
"email": "existinguser@company.com",
"success": true,
"userId": "user_2XYZ789GHI",
"membershipId": "orgmem_2MNO456PQR",
"status": "active",
"type": "direct_membership",
"metadata": {}
}
]
}{
"success": true,
"total": 123,
"successful": 123,
"failed": 123,
"results": [
{
"email": "jsmith@example.com",
"success": true,
"invitationId": "orginv_2ABC123DEF",
"status": "pending",
"type": "invitation",
"metadata": {}
}
],
"errors": [
{
"email": "jsmith@example.com",
"success": false,
"error": "Invalid email address"
}
]
}{
"error": "Invalid request data",
"details": [
{
"message": "Invalid email address",
"path": [
"invitations",
0,
"email"
]
}
]
}{
"error": "Unauthorized: User is not an admin in this organization"
}{
"error": "Internal Server Error"
}Admin API
Create bulk invitations
Send invitations to multiple email addresses in a single request.
Smart invitation handling:
- If the email already has a Clerk account: Adds them directly as a member (no email sent)
- If the email is already a member: Returns success without error (idempotent)
- If the email is new: Sends an invitation email
Invitations expire after 30 days and can be revoked using DELETE /admin/invitations.
POST
/
admin
/
invitations
curl --request POST \
--url https://www.asteragents.com/api/admin/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invitations": [
{
"email": "user1@company.com"
},
{
"email": "user2@company.com"
}
]
}
'{
"success": true,
"total": 2,
"successful": 2,
"failed": 0,
"results": [
{
"email": "newuser@company.com",
"success": true,
"invitationId": "orginv_2ABC123DEF",
"status": "pending",
"type": "invitation",
"metadata": {}
},
{
"email": "existinguser@company.com",
"success": true,
"userId": "user_2XYZ789GHI",
"membershipId": "orgmem_2MNO456PQR",
"status": "active",
"type": "direct_membership",
"metadata": {}
}
]
}{
"success": true,
"total": 123,
"successful": 123,
"failed": 123,
"results": [
{
"email": "jsmith@example.com",
"success": true,
"invitationId": "orginv_2ABC123DEF",
"status": "pending",
"type": "invitation",
"metadata": {}
}
],
"errors": [
{
"email": "jsmith@example.com",
"success": false,
"error": "Invalid email address"
}
]
}{
"error": "Invalid request data",
"details": [
{
"message": "Invalid email address",
"path": [
"invitations",
0,
"email"
]
}
]
}{
"error": "Unauthorized: User is not an admin in this organization"
}{
"error": "Internal Server Error"
}Authorizations
JWT token from Clerk authentication.
Must be from a user with org:admin role.
Body
application/json
Array of invitations to send
Required array length:
1 - 50 elementsShow child attributes
Show child attributes