View And Revoke Org Invites Component - PropelAuth Docs

View And Revoke Org Invites Component

PropelAuth's View And Revoke Org Invites Component allow you to customize the UI around viewing and revoking invitations to join an organization. Check out the documentation here for more information about organizations.

Organization Pending Invitations

Email Role Expires Revoke Invite
user1@acmeinc.come Owner 6/4/2026, 9:36:06 PM Revoke
user2@acmeinc.come Admin 6/4/2026, 9:36:06 PM Revoke
user3@acmeinc.come Member 6/4/2026, 9:36:06 PM Revoke

Shadcn Installation

Install this component from our shadcn registry.

npx shadcn@latest add https://components.propelauth.com/r/view-and-revoke-org-invites.json

Reference APIs

These are the APIs that are used by the above component. You can use these APIs directly in your own code.

fetchPendingOrgInvites

Fetches a paginated list of an org's invites.

Arguments

Success Response

An array of invites for the provided org.

Response Functions

The response object has a handle function that you can use to handle the response. These functions can be async, and you can return values from them.

Request

const { fetchPendingOrgInvites } = useAuthFrontendApis()

const response = await fetchPendingOrgInvites("1189c444-8a2d-4c41-8b4b-ae43ce79a492", {
    page_number: 0,
    page_size: 10,
    email_search: "test@test.com",
});
await response.handle({
    success: (data) => {
        console.log("success")
    },
    orgNotFound(error) {
        console.error('Org not found', error);
    },
    orgsNotEnabled(error) {
        console.error('Org not enabled', error);
    },
    unexpectedOrUnhandled(error) {
        console.error('Unexpected or unhandled error', error);
    },
});

Successful Response

{
    "pending_invites": [
        {
            "email": "test@example.com",
            "role": "Admin",
            "additional_roles": [],
            "expires_at_seconds": 1737217437
        }
    ],
    "total_count": 1,
    "page_number": 0,
    "page_size": 10,
    "has_more_results": false
}

revokeUserOrgInvitation

Revokes an existing invitation to a user to join an organization.

Arguments

Response Functions

The response object has a handle function that you can use to handle the response. These functions can be async, and you can return values from them.

Request

const { revokeUserOrgInvitation } = useAuthFrontendApis()

const response = await revokeUserOrgInvitation({
    org_id: "1189c444-8a2d-4c41-8b4b-ae43ce79a492",
    email: "test@test.com",
});
await response.handle({
    async success() {
        console.log("success")
    },
    badRequest(error) {
        for (const [field, fieldErrorMessage] of Object.entries(error.user_facing_errors)) {
            console.log('Error: "' + fieldErrorMessage + '" for field: "' + field + '"')
        }
    },
    orgNotFound(error) {
        console.error('Org not found', error);
    },
    orgsNotEnabled(error) {
        console.error('Org not enabled', error);
    },
    noRevokeInvitePermission(error) {
        console.error('No revoke invite permission', error);
    },
    unexpectedOrUnhandled(error) {
        console.error('Unexpected or unhandled error', error);
    },
});

Successful Response

{}